21 template <
typename SCALAR>
25 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
51 virtual void evalGradient(
size_t grad_length, Eigen::Map<Eigen::Matrix<SCALAR, Eigen::Dynamic, 1>>& grad) = 0;
55 throw std::runtime_error(
56 "Hessian evaluation not implemented for this cost function. Use limited-memory Hessian approximation!");
66 virtual void sparseHessianValues(
const Eigen::VectorXd& optVec,
const Eigen::VectorXd& lambda, Eigen::VectorXd& hes)
68 throw std::runtime_error(
69 "Hessian evaluation not implemented for this cost function. Use limited-memory Hessian approximation!");
Implements an abstract base class which evaluates the cost function and its gradient in the NLP...
Definition: DiscreteCostEvaluatorBase.h:22
virtual void evalGradient(size_t grad_length, Eigen::Map< Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 >> &grad)=0
Evaluates the cost gradient.
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual void getSparsityPatternHessian(Eigen::VectorXi &iRow, Eigen::VectorXi &jCol)
Definition: DiscreteCostEvaluatorBase.h:53
virtual void sparseHessianValues(const Eigen::VectorXd &optVec, const Eigen::VectorXd &lambda, Eigen::VectorXd &hes)
Evaluates the cost hessian.
Definition: DiscreteCostEvaluatorBase.h:66
virtual ~DiscreteCostEvaluatorBase()=default
Destructor.
virtual SCALAR eval()=0
Evaluates the cost function.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW DiscreteCostEvaluatorBase()=default
Default constructor.