aligator  0.14.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
 
Loading...
Searching...
No Matches
aligator::ConstraintSetTpl< _Scalar > Struct Template Referenceabstract

Base constraint set type. More...

#include <aligator/core/constraint-set.hpp>

Inheritance diagram for aligator::ConstraintSetTpl< _Scalar >:
[legend]

Public Types

using Scalar = _Scalar
 
using ActiveType = Eigen::Matrix<bool, Eigen::Dynamic, 1>
 

Public Member Functions

 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
 
 ConstraintSetTpl ()=default
 
virtual bool disableGaussNewton () const
 
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.
 
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 \( \mathrm{id} - P\).
 
virtual void applyProjectionJacobian (const ConstVectorRef &z, MatrixRef Jout) const
 Apply a jacobian of the projection/proximal operator to a matrix.
 
virtual void applyNormalConeProjectionJacobian (const ConstVectorRef &z, MatrixRef Jout) const
 Apply the jacobian of the projection on the normal cone.
 
void setProxParameter (const Scalar mu) const
 Update proximal parameter; this applies to when this class is a proximal operator that isn't a projection (e.g. \( \ell_1 \)).
 
virtual void computeActiveSet (const ConstVectorRef &z, Eigen::Ref< ActiveType > out) const =0
 
virtual ~ConstraintSetTpl ()=default
 
bool operator== (const ConstraintSetTpl< Scalar > &rhs)
 
Scalar evaluateMoreauEnvelope (const ConstVectorRef &zin, const ConstVectorRef &zproj) const
 Evaluate the Moreau envelope with parameter mu for the given contraint set or nonsmooth penalty \(g\) at point zin.
 
Scalar computeMoreauEnvelope (const ConstVectorRef &zin, VectorRef zprojout) const
 Evaluate the Moreau envelope with parameter mu for the given contraint set or nonsmooth penalty \(g\) at point zin. This variant evaluates the prox map.
 
Scalar mu () const
 
Scalar mu_inv () const
 

Protected Attributes

Scalar mu_ = 0.
 
Scalar mu_inv_
 

Detailed Description

template<typename _Scalar>
struct aligator::ConstraintSetTpl< _Scalar >

Base constraint set type.

Constraint sets can be the negative or positive orthant, the \(\{0\}\) singleton, cones, etc... The expected inputs are constraint values or shifted constraint values (as in ALM-type algorithms).

Definition at line 16 of file constraint-set.hpp.

Member Typedef Documentation

◆ Scalar

template<typename _Scalar>
using aligator::ConstraintSetTpl< _Scalar >::Scalar = _Scalar

Definition at line 18 of file constraint-set.hpp.

◆ ActiveType

template<typename _Scalar>
using aligator::ConstraintSetTpl< _Scalar >::ActiveType = Eigen::Matrix<bool, Eigen::Dynamic, 1>

Definition at line 20 of file constraint-set.hpp.

Constructor & Destructor Documentation

◆ ConstraintSetTpl()

template<typename _Scalar>
aligator::ConstraintSetTpl< _Scalar >::ConstraintSetTpl ( )
default

◆ ~ConstraintSetTpl()

template<typename _Scalar>
virtual aligator::ConstraintSetTpl< _Scalar >::~ConstraintSetTpl ( )
virtualdefault

Member Function Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS()

template<typename _Scalar>
aligator::ConstraintSetTpl< _Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS ( Scalar )

◆ disableGaussNewton()

template<typename _Scalar>
virtual bool aligator::ConstraintSetTpl< _Scalar >::disableGaussNewton ( ) const
inlinevirtual

Do not use the vector-Hessian product in the Hessian for Gauss Newton.

Reimplemented in aligator::EqualityConstraintTpl< _Scalar >, aligator::EqualityConstraintTpl< Scalar >, and aligator::EqualityConstraintTpl< Scalar >.

Definition at line 26 of file constraint-set.hpp.

◆ evaluate()

template<typename _Scalar>
virtual Scalar aligator::ConstraintSetTpl< _Scalar >::evaluate ( const ConstVectorRef & ) const
inlinevirtual

Provided the image zproj by the proximal/projection map, evaluate the nonsmooth penalty or constraint set indicator function.

Note
This will be 0 for projection operators.

Reimplemented in aligator::ConstraintSetProductTpl< Scalar >, aligator::NonsmoothPenaltyL1Tpl< _Scalar >, aligator::NonsmoothPenaltyL1Tpl< Scalar >, and aligator::NonsmoothPenaltyL1Tpl< Scalar >.

Definition at line 31 of file constraint-set.hpp.

◆ projection()

◆ normalConeProjection()

template<typename _Scalar>
virtual void aligator::ConstraintSetTpl< _Scalar >::normalConeProjection ( const ConstVectorRef & z,
VectorRef zout ) const
pure virtual

◆ applyProjectionJacobian()

template<typename _Scalar>
virtual void aligator::ConstraintSetTpl< _Scalar >::applyProjectionJacobian ( const ConstVectorRef & z,
MatrixRef Jout ) const
virtual

Apply a jacobian of the projection/proximal operator to a matrix.

This carries out the product \(PJ\), where \( P \in\partial_B\prox(z)\).

Parameters
[in]zInput vector (multiplier estimate)
[out]JoutOutput Jacobian matrix, which will be modifed in-place and returned.

Reimplemented in aligator::ConstraintSetProductTpl< Scalar >, aligator::EqualityConstraintTpl< _Scalar >, aligator::EqualityConstraintTpl< Scalar >, and aligator::EqualityConstraintTpl< Scalar >.

◆ applyNormalConeProjectionJacobian()

template<typename _Scalar>
virtual void aligator::ConstraintSetTpl< _Scalar >::applyNormalConeProjectionJacobian ( const ConstVectorRef & z,
MatrixRef Jout ) const
virtual

Apply the jacobian of the projection on the normal cone.

Parameters
[in]zInput vector
[out]JoutOutput Jacobian matrix of shape \((nr, ndx)\), which will be modified in place. The modification should be a row-wise operation.

Reimplemented in aligator::ConstraintSetProductTpl< Scalar >, aligator::EqualityConstraintTpl< _Scalar >, aligator::EqualityConstraintTpl< Scalar >, and aligator::EqualityConstraintTpl< Scalar >.

◆ setProxParameter()

template<typename _Scalar>
void aligator::ConstraintSetTpl< _Scalar >::setProxParameter ( const Scalar mu) const
inline

Update proximal parameter; this applies to when this class is a proximal operator that isn't a projection (e.g. \( \ell_1 \)).

Definition at line 68 of file constraint-set.hpp.

◆ computeActiveSet()

◆ operator==()

template<typename _Scalar>
bool aligator::ConstraintSetTpl< _Scalar >::operator== ( const ConstraintSetTpl< Scalar > & rhs)
inline

Definition at line 80 of file constraint-set.hpp.

◆ evaluateMoreauEnvelope()

template<typename _Scalar>
Scalar aligator::ConstraintSetTpl< _Scalar >::evaluateMoreauEnvelope ( const ConstVectorRef & zin,
const ConstVectorRef & zproj ) const
inline

Evaluate the Moreau envelope with parameter mu for the given contraint set or nonsmooth penalty \(g\) at point zin.

The envelope is

\[ M_{\mu g}(z) := g(\prox_{\mu g}(z)) + \frac{1}{2\mu} \| z - \prox_{\mu g}(z) \|^2. \]

Parameters
zinThe input.
zprojProjection of the input to the normal.

Definition at line 93 of file constraint-set.hpp.

◆ computeMoreauEnvelope()

template<typename _Scalar>
Scalar aligator::ConstraintSetTpl< _Scalar >::computeMoreauEnvelope ( const ConstVectorRef & zin,
VectorRef zprojout ) const
inline

Evaluate the Moreau envelope with parameter mu for the given contraint set or nonsmooth penalty \(g\) at point zin. This variant evaluates the prox map.

The envelope is

\[ M_{\mu g}(z) := g(\prox_{\mu g}(z)) + \frac{1}{2\mu} \| z - \prox_{\mu g}(z) \|^2. \]

Parameters
zinThe input.
zprojProjection of the input to the normal.

Definition at line 102 of file constraint-set.hpp.

◆ mu()

template<typename _Scalar>
Scalar aligator::ConstraintSetTpl< _Scalar >::mu ( ) const
inline

Definition at line 108 of file constraint-set.hpp.

◆ mu_inv()

template<typename _Scalar>
Scalar aligator::ConstraintSetTpl< _Scalar >::mu_inv ( ) const
inline

Definition at line 109 of file constraint-set.hpp.

Member Data Documentation

◆ mu_

template<typename _Scalar>
Scalar aligator::ConstraintSetTpl< _Scalar >::mu_ = 0.
mutableprotected

Definition at line 112 of file constraint-set.hpp.

◆ mu_inv_

template<typename _Scalar>
Scalar aligator::ConstraintSetTpl< _Scalar >::mu_inv_
mutableprotected

Definition at line 113 of file constraint-set.hpp.


The documentation for this struct was generated from the following file: