![]() |
Stan Math Library
2.20.0
reverse mode automatic differentiation
|
The vari class for the algebraic solver. More...
#include <algebra_solver.hpp>
Public Member Functions | |
algebra_solver_vari (const Fs &fs, const F &f, const Eigen::VectorXd &x, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, const std::vector< double > &dat, const std::vector< int > &dat_int, const Eigen::VectorXd &theta_dbl, Fx &fx, std::ostream *msgs) | |
void | chain () |
Apply the chain rule to this variable based on the variables on which it depends. More... | |
![]() | |
vari (double x) | |
Construct a variable implementation from a value. More... | |
vari (double x, bool stacked) | |
virtual | ~vari () |
Throw an illegal argument exception. More... | |
void | init_dependent () |
Initialize the adjoint for this (dependent) variable to 1. More... | |
void | set_zero_adjoint () |
Set the adjoint value of this variable to 0. More... | |
Public Attributes | |
vari ** | y_ |
vector of parameters More... | |
int | y_size_ |
number of parameters More... | |
int | x_size_ |
number of unknowns More... | |
vari ** | theta_ |
vector of solution More... | |
double * | Jx_y_ |
Jacobian of the solution w.r.t parameters. More... | |
![]() | |
const double | val_ |
The value of this variable. More... | |
double | adj_ |
The adjoint of this variable, which is the partial derivative of this variable with respect to the root variable. More... | |
Additional Inherited Members | |
![]() | |
static void * | operator new (size_t nbytes) |
Allocate memory from the underlying memory pool. More... | |
static void | operator delete (void *) |
Delete a pointer from the underlying memory pool. More... | |
The vari class for the algebraic solver.
We compute the Jacobian of the solutions with respect to the parameters using the implicit function theorem. The call to Jacobian() occurs outside the call to chain() – this prevents malloc issues.
Definition at line 28 of file algebra_solver.hpp.
|
inline |
Definition at line 40 of file algebra_solver.hpp.
|
inlinevirtual |
Apply the chain rule to this variable based on the variables on which it depends.
The base implementation in this class is a no-op.
Reimplemented from stan::math::vari.
Definition at line 72 of file algebra_solver.hpp.
double* stan::math::algebra_solver_vari< Fs, F, T, Fx >::Jx_y_ |
Jacobian of the solution w.r.t parameters.
Definition at line 38 of file algebra_solver.hpp.
vari** stan::math::algebra_solver_vari< Fs, F, T, Fx >::theta_ |
vector of solution
Definition at line 36 of file algebra_solver.hpp.
int stan::math::algebra_solver_vari< Fs, F, T, Fx >::x_size_ |
number of unknowns
Definition at line 34 of file algebra_solver.hpp.
vari** stan::math::algebra_solver_vari< Fs, F, T, Fx >::y_ |
vector of parameters
Definition at line 30 of file algebra_solver.hpp.
int stan::math::algebra_solver_vari< Fs, F, T, Fx >::y_size_ |
number of parameters
Definition at line 32 of file algebra_solver.hpp.