1 #ifndef STAN__AGRAD__REV__VARI_HPP
2 #define STAN__AGRAD__REV__VARI_HPP
63 vari(
const double x,
bool stacked):
109 return os << v <<
" " << v->
val_ <<
" : " << v->
adj_;
virtual void init_dependent()
Initialize the adjoint for this (dependent) variable to 1.
Abstract base class for variable implementations that handles memory management and applying the chai...
const double val_
The value of this variable.
vari(const double x, bool stacked)
vari(const double x)
Construct a variable implementation from a value.
The variable implementation base class.
std::vector< chainable * > var_stack_
virtual ~vari()
Throw an illegal argument exception.
Independent (input) and dependent (output) variables for gradients.
virtual void set_zero_adjoint()
Set the adjoint value of this variable to 0.
double adj_
The adjoint of this variable, which is the partial derivative of this variable with respect to the ro...
std::vector< chainable * > var_nochain_stack_
friend std::ostream & operator<<(std::ostream &os, const vari *v)
Insertion operator for vari.