18template <
typename _Scalar>
struct ConstraintSetTpl {
22 using ActiveType = Eigen::Matrix<bool, Eigen::Dynamic, 1>;
39 virtual void projection(
const ConstVectorRef &z, VectorRef zout)
const = 0;
47 VectorRef zout)
const = 0;
57 MatrixRef Jout)
const;
66 MatrixRef Jout)
const;
78 Eigen::Ref<ActiveType> out)
const = 0;
96 const ConstVectorRef &zproj)
const {
98 res +=
static_cast<Scalar>(0.5) *
mu_inv_ * zproj.squaredNorm();
105 VectorRef zprojout)
const {
149#ifdef PROXSUITE_NLP_ENABLE_TEMPLATE_INSTANTIATION
150extern template struct PROXSUITE_NLP_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI
151 ConstraintSetTpl<context::Scalar>;
152extern template struct PROXSUITE_NLP_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI
153 ConstraintObjectTpl<context::Scalar>;
159#include "proxsuite-nlp/constraint-set.hxx"
Base definitions for function classes.
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Twice-differentiable function, with method Jacobian and vector-hessian product evaluation.
Packs a ConstraintSetTpl and C2FunctionTpl together.
const FunctionType & func() const
ConstraintObjectTpl(const ConstraintObjectTpl &)=default
polymorphic< ConstraintSet > set_
ConstraintObjectTpl(shared_ptr< FunctionType > func, const polymorphic< ConstraintSet > &set)
ConstraintObjectTpl & operator=(const ConstraintObjectTpl &)=default
shared_ptr< FunctionType > func_
ConstraintObjectTpl & operator=(ConstraintObjectTpl &&)=default
ConstraintObjectTpl(ConstraintObjectTpl &&)=default
bool operator==(const ConstraintObjectTpl &other) const
Base constraint set type.
virtual void computeActiveSet(const ConstVectorRef &z, Eigen::Ref< ActiveType > out) const =0
virtual Scalar evaluate(const ConstVectorRef &) const
virtual void projection(const ConstVectorRef &z, VectorRef zout) const =0
Compute projection of variable z onto the constraint set.
Eigen::Matrix< bool, Eigen::Dynamic, 1 > ActiveType
Scalar evaluateMoreauEnvelope(const ConstVectorRef &zin, const ConstVectorRef &zproj) const
Evaluate the Moreau envelope with parameter mu for the given contraint set or nonsmooth penalty at p...
Scalar computeMoreauEnvelope(const ConstVectorRef &zin, VectorRef zprojout) const
Evaluate the Moreau envelope with parameter mu for the given contraint set or nonsmooth penalty at p...
void setProxParameter(const Scalar mu) const
Update proximal parameter; this applies to when this class is a proximal operator that isn't a projec...
virtual bool disableGaussNewton() const
virtual void applyNormalConeProjectionJacobian(const ConstVectorRef &z, MatrixRef Jout) const
Apply the jacobian of the projection on the normal cone.
bool operator==(const ConstraintSetTpl< Scalar > &rhs)
virtual ~ConstraintSetTpl()=default
virtual void normalConeProjection(const ConstVectorRef &z, VectorRef zout) const =0
Compute projection of z onto the normal cone to the set. The default implementation is just .
ConstraintSetTpl()=default
virtual void applyProjectionJacobian(const ConstVectorRef &z, MatrixRef Jout) const
Apply a jacobian of the projection/proximal operator to a matrix.