1 #ifndef STAN_MATH_REV_CORE_VARI_HPP
2 #define STAN_MATH_REV_CORE_VARI_HPP
56 explicit vari(
const double x):
62 vari(
const double x,
bool stacked):
108 return os << v->
val_ <<
":" << v->
adj_;
vari(const double x)
Construct a variable implementation from a value.
friend std::ostream & operator<<(std::ostream &os, const vari *v)
Insertion operator for vari.
Abstract base class for variable implementations that handles memory management and applying the chai...
The variable implementation base class.
virtual void init_dependent()
Initialize the adjoint for this (dependent) variable to 1.
Independent (input) and dependent (output) variables for gradients.
virtual ~vari()
Throw an illegal argument exception.
const double val_
The value of this variable.
vari(const double x, bool stacked)
static std::vector< ChainableT * > var_nochain_stack_
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...
static std::vector< ChainableT * > var_stack_