1 #ifndef STAN_MATH_REV_MAT_FUN_GRAD_HPP 2 #define STAN_MATH_REV_MAT_FUN_GRAD_HPP 25 inline void grad(
var& v, Eigen::Matrix<var, Eigen::Dynamic, 1>& x,
29 for (
int i = 0; i < x.size(); ++i)
30 g(i) = x(i).vi_->adj_;
Independent (input) and dependent (output) variables for gradients.
static void grad(vari *vi)
Compute the gradient for all variables starting from the specified root variable implementation.
vari * vi_
Pointer to the implementation of this variable.