1#ifndef STAN_MATH_REV_FUNCTOR_ALGEBRA_SYSTEM_HPP
2#define STAN_MATH_REV_FUNCTOR_ALGEBRA_SYSTEM_HPP
23template <
typename T,
int NX = Eigen::Dynamic,
int NY = Eigen::Dynamic>
61 int operator()(
const Eigen::VectorXd& iv, Eigen::VectorXd& fvec) {
72 int df(
const Eigen::VectorXd& iv, Eigen::MatrixXd& fjac)
const {
95 Eigen::VectorXd
get_value(
const Eigen::VectorXd& iv)
const {
return fs_(iv); }
100template <
typename T1,
typename T2>
102 const Eigen::Matrix<T2, Eigen::Dynamic, 1> y,
103 const std::vector<double>& dat,
104 const std::vector<int>& dat_int,
105 double function_tolerance,
106 long int max_num_steps) {
111 check_finite(
"algebra_solver",
"integer data", dat_int);
void jacobian(const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &fx, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &J)
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
void algebra_solver_check(const Eigen::Matrix< T1, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< T2, Eigen::Dynamic, 1 > y, const std::vector< double > &dat, const std::vector< int > &dat_int, double function_tolerance, long int max_num_steps)
void check_finite(const char *function, const char *name, const T_y &y)
Return true if all values in y are finite.
void check_nonzero_size(const char *function, const char *name, const T_y &y)
Check if the specified matrix/vector is of non-zero size.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
int operator()(const Eigen::VectorXd &iv, Eigen::VectorXd &fvec)
Computes the value the algebraic function, f, when pluging in the independent variables,...
Eigen::MatrixXd J_
Jacobian of algebraic function wrt unknowns.
hybrj_functor_solver(const S &fs)
Eigen::MatrixXd get_jacobian(const Eigen::VectorXd &iv)
Performs the same task as the operator(), but returns the Jacobian, instead of saving it inside an ar...
Eigen::VectorXd get_value(const Eigen::VectorXd &iv) const
Performs the same task as df(), but returns the value of algebraic function, instead of saving it ins...
S fs_
Wrapper around algebraic system.
int df(const Eigen::VectorXd &iv, Eigen::MatrixXd &fjac) const
Assign the Jacobian to fjac.
A functor with the required operators to call Eigen's algebraic solver.
nlo_functor(int inputs, int values)
A structure which gets passed to Eigen's dogleg algebraic solver.