17 template <
class ADExprType
20 Eigen::MatrixBase<MatType>& adjoints,
21 Eigen::MatrixBase<MatType>& tp_adjoints)
24 tp_adjoints.setZero();
25 return ad::autodiff(ad_expr);
49 template <
class ADExprType
51 ,
class MomentumHandlerType>
53 Eigen::MatrixBase<MatType>& theta,
54 Eigen::MatrixBase<MatType>& theta_adj,
55 Eigen::MatrixBase<MatType>& tp_adj,
56 Eigen::MatrixBase<MatType>& r,
57 const MomentumHandlerType& m_handler,
64 const double half_step = epsilon/2.;
65 r += half_step * theta_adj;
67 theta += epsilon * m_handler.dkinetic_dr(r);
69 const double new_potential =
71 r += half_step * theta_adj;