Stan Math Library  2.20.0
reverse mode automatic differentiation
Public Member Functions | Public Attributes | List of all members
stan::math::algebra_solver_vari< Fs, F, T, Fx > Struct Template Reference

The vari class for the algebraic solver. More...

#include <algebra_solver.hpp>

Inheritance diagram for stan::math::algebra_solver_vari< Fs, F, T, Fx >:
stan::math::vari

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...
 
- Public Member Functions inherited from stan::math::vari
 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...
 
- Public Attributes inherited from stan::math::vari
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 Public Member Functions inherited from stan::math::vari
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...
 

Detailed Description

template<typename Fs, typename F, typename T, typename Fx>
struct stan::math::algebra_solver_vari< Fs, F, T, Fx >

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.

Constructor & Destructor Documentation

◆ algebra_solver_vari()

template<typename Fs, typename F, typename T, typename Fx>
stan::math::algebra_solver_vari< Fs, F, T, Fx >::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 
)
inline

Definition at line 40 of file algebra_solver.hpp.

Member Function Documentation

◆ chain()

template<typename Fs, typename F, typename T, typename Fx>
void stan::math::algebra_solver_vari< Fs, F, T, Fx >::chain ( )
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.

Member Data Documentation

◆ Jx_y_

template<typename Fs, typename F, typename T, typename Fx>
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.

◆ theta_

template<typename Fs, typename F, typename T, typename Fx>
vari** stan::math::algebra_solver_vari< Fs, F, T, Fx >::theta_

vector of solution

Definition at line 36 of file algebra_solver.hpp.

◆ x_size_

template<typename Fs, typename F, typename T, typename Fx>
int stan::math::algebra_solver_vari< Fs, F, T, Fx >::x_size_

number of unknowns

Definition at line 34 of file algebra_solver.hpp.

◆ y_

template<typename Fs, typename F, typename T, typename Fx>
vari** stan::math::algebra_solver_vari< Fs, F, T, Fx >::y_

vector of parameters

Definition at line 30 of file algebra_solver.hpp.

◆ y_size_

template<typename Fs, typename F, typename T, typename Fx>
int stan::math::algebra_solver_vari< Fs, F, T, Fx >::y_size_

number of parameters

Definition at line 32 of file algebra_solver.hpp.


The documentation for this struct was generated from the following file:

     [ Stan Home Page ] © 2011–2018, Stan Development Team.