Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ vari_value() [1/3]

template<typename T >
template<typename S , require_convertible_t< S &, T > * = nullptr>
stan::math::vari_value< T, require_eigen_sparse_base_t< T > >::vari_value ( S &&  x)
inlineexplicit

Construct a variable implementation from a value.

The adjoint is initialized to zero.

All constructed variables are added to the stack. For a sparse eigen matrix this includes the nozero values as well the inner and outer indices. Variables should be constructed before variables on which they depend to insure proper partial derivative propagation. During derivative propagation, the chain() method of each variable will be called in the reverse order of construction.

Template Parameters
SA sparse Eigen type that is convertible to value_type
Parameters
xValue of the constructed variable.

Definition at line 849 of file vari.hpp.