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

◆ grad_hessian()

template<typename F >
void stan::math::grad_hessian ( const F &  f,
const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  x,
double &  fx,
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &  H,
std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > > &  grad_H 
)

Calculate the value, the Hessian, and the gradient of the Hessian of the specified function at the specified argument.

The functor must implement

fvar<fvar<var> > operator()(const Eigen::Matrix<fvar<fvar<var> >, Eigen::Dynamic, 1>&)

using only operations that are defined for fvar and var.

This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.

Template Parameters
FType of function
Parameters
[in]fFunction
[in]xArgument to function
[out]fxFunction applied to argument
[out]HHessian of function at argument
[out]grad_HGradient of the Hessian of function at argument

Definition at line 42 of file grad_hessian.hpp.