36 const std::vector<ConstraintObject> &constraints = {})
95 bool evaluate_all_constraint_hessians =
false)
const {
100 !cstr.
set_->disableGaussNewton() || evaluate_all_constraint_hessians;
132template <
typename Scalar,
typename VectorType>
135 std::vector<Eigen::Ref<VectorType>> &out) {
136 static_assert(VectorType::IsVectorAtCompileTime,
137 "Function only supports compile-time vectors.");
146template <
typename Scalar>
160#ifdef PROXSUITE_NLP_ENABLE_TEMPLATE_INSTANTIATION
161#include "proxsuite-nlp/problem-base.txx"
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
void createConstraintWiseView(const ProblemTpl< Scalar > &prob, typename math_types< Scalar >::VectorXs &input, std::vector< Eigen::Ref< VectorType > > &out)
void allocateMultipliersOrResiduals(const ProblemTpl< Scalar > &prob, typename math_types< Scalar >::VectorXs &data, typename math_types< Scalar >::VectorOfRef &out)
Allocate a set of multipliers (or residuals) for a given problem instance.
int nr() const
Get function codimension.
virtual void computeJacobian(const ConstVectorRef &x, MatrixRef Jout) const =0
Jacobian matrix of the constraint function.
virtual void vectorHessianProduct(const ConstVectorRef &, const ConstVectorRef &, MatrixRef Hout) const
Vector-hessian product.
Packs a ConstraintSetTpl and C2FunctionTpl together.
const FunctionType & func() const
polymorphic< ConstraintSet > set_
Base class for differentiable cost functions.
virtual void computeHessian(const ConstVectorRef &x, MatrixRef out) const =0
virtual Scalar call(const ConstVectorRef &x) const =0
Evaluate the cost function.
virtual void computeGradient(const ConstVectorRef &x, VectorRef out) const =0
std::vector< int > indices_
auto getSegment(VectorXs &x, std::size_t i) const
int getTotalConstraintDim() const
const Manifold & manifold() const
auto getConstSegment(const VectorXs &x, std::size_t i) const
std::size_t getNumConstraints() const
Get the number of constraint blocks.
void computeDerivatives(const ConstVectorRef &x, Workspace &workspace) const
shared_ptr< CostType > cost_
The cost function.
polymorphic< Manifold > manifold_
The working manifold .
void computeHessians(const ConstVectorRef &x, Workspace &workspace, bool evaluate_all_constraint_hessians=false) const
void evaluate(const ConstVectorRef &x, Workspace &workspace) const
const CostType & cost() const
int nc_total_
Total number of constraints.
std::vector< int > getIndices() const
ProblemTpl(U &&manifold, shared_ptr< CostType > cost, const std::vector< ConstraintObject > &constraints={})
void addConstraint(T &&cstr)
Add a constraint to the problem, after initialization.
void reset_constraint_dim_vars()
Set values of const data members for constraint dimensions.
int getConstraintDim(std::size_t i) const
Get dimension of constraint i.
const ConstraintObject & getConstraint(const std::size_t &i) const
Get a pointer to the -th constraint pointer.
int getIndex(std::size_t i) const
std::vector< ConstraintObject > constraints_
The set of constraints.
Scalar objective_value
Objective value.
std::vector< VectorRef > cstr_values
Values of each constraint.
VectorXs objective_gradient
Objective function gradient.
std::vector< VectorRef > lams_pdal
Primal-dual multiplier estimates (from the pdBCL algorithm)
MatrixXs objective_hessian
Objective function Hessian.
std::vector< MatrixRef > cstr_jacobians
std::vector< MatrixRef > cstr_vector_hessian_prod
Typedefs for math (Eigen vectors, matrices) depending on scalar type.