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

Cartesian product of multiple constraint sets. This class makes computing multipliers and Jacobian matrix projections more convenient. More...

#include <aligator/modelling/constraints/constraint-set-product.hpp>

Inheritance diagram for aligator::ConstraintSetProductTpl< Scalar >:
[legend]
Collaboration diagram for aligator::ConstraintSetProductTpl< Scalar >:
[legend]

Public Types

using Base = ConstraintSetTpl<Scalar>
 
using ActiveType = typename Base::ActiveType
 
- Public Types inherited from aligator::ConstraintSetTpl< Scalar >
using Scalar
 
using ActiveType
 
using Scalar
 
using ActiveType
 

Public Member Functions

 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
 
 ConstraintSetProductTpl (const std::vector< xyz::polymorphic< Base > > components, const std::vector< Eigen::Index > &blockSizes)
 
 ConstraintSetProductTpl (const ConstraintSetProductTpl &)=default
 
ConstraintSetProductTploperator= (const ConstraintSetProductTpl &)=default
 
 ConstraintSetProductTpl (ConstraintSetProductTpl &&)=default
 
ConstraintSetProductTploperator= (ConstraintSetProductTpl &&)=default
 
Scalar evaluate (const ConstVectorRef &zproj) const override
 
void projection (const ConstVectorRef &z, VectorRef zout) const override
 Compute projection of variable z onto the constraint set.
 
void normalConeProjection (const ConstVectorRef &z, VectorRef zout) const override
 Compute projection of z onto the normal cone to the set. The default implementation is just \( \mathrm{id} - P\).
 
void applyProjectionJacobian (const ConstVectorRef &z, MatrixRef Jout) const override
 Apply a jacobian of the projection/proximal operator to a matrix.
 
void applyNormalConeProjectionJacobian (const ConstVectorRef &z, MatrixRef Jout) const override
 Apply the jacobian of the projection on the normal cone.
 
void computeActiveSet (const ConstVectorRef &z, Eigen::Ref< ActiveType > out) const override
 
const std::vector< xyz::polymorphic< Base > > & components () const
 
const std::vector< Eigen::Index > & blockSizes () const
 
- Public Member Functions inherited from aligator::ConstraintSetTpl< Scalar >
 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
 
 ConstraintSetTpl ()=default
 
virtual bool disableGaussNewton () const
 
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 ~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
 
 ALIGATOR_DYNAMIC_TYPEDEFS (Scalar)
 
 ConstraintSetTpl ()=default
 
virtual bool disableGaussNewton () const
 
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 ~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
 

Additional Inherited Members

- Protected Attributes inherited from aligator::ConstraintSetTpl< Scalar >
Scalar mu_
 
Scalar mu_inv_
 
Scalar mu_
 
Scalar mu_inv_
 

Detailed Description

template<typename Scalar>
struct aligator::ConstraintSetProductTpl< Scalar >

Cartesian product of multiple constraint sets. This class makes computing multipliers and Jacobian matrix projections more convenient.

Warning
This struct contains a non-owning vector of its component sets.

Definition at line 38 of file constraint-set-product.hpp.

Member Typedef Documentation

◆ Base

Definition at line 40 of file constraint-set-product.hpp.

◆ ActiveType

template<typename Scalar>
using aligator::ConstraintSetProductTpl< Scalar >::ActiveType = typename Base::ActiveType

Definition at line 41 of file constraint-set-product.hpp.

Constructor & Destructor Documentation

◆ ConstraintSetProductTpl() [1/3]

template<typename Scalar>
aligator::ConstraintSetProductTpl< Scalar >::ConstraintSetProductTpl ( const std::vector< xyz::polymorphic< Base > > components,
const std::vector< Eigen::Index > & blockSizes )
inline

Definition at line 43 of file constraint-set-product.hpp.

◆ ConstraintSetProductTpl() [2/3]

template<typename Scalar>
aligator::ConstraintSetProductTpl< Scalar >::ConstraintSetProductTpl ( const ConstraintSetProductTpl< Scalar > & )
default

◆ ConstraintSetProductTpl() [3/3]

template<typename Scalar>
aligator::ConstraintSetProductTpl< Scalar >::ConstraintSetProductTpl ( ConstraintSetProductTpl< Scalar > && )
default

Member Function Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS()

template<typename Scalar>
aligator::ConstraintSetProductTpl< Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS ( Scalar )

◆ operator=() [1/2]

template<typename Scalar>
ConstraintSetProductTpl & aligator::ConstraintSetProductTpl< Scalar >::operator= ( const ConstraintSetProductTpl< Scalar > & )
default

◆ operator=() [2/2]

◆ evaluate()

template<typename Scalar>
Scalar aligator::ConstraintSetProductTpl< Scalar >::evaluate ( const ConstVectorRef & ) const
inlineoverridevirtual

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 from aligator::ConstraintSetTpl< Scalar >.

Definition at line 58 of file constraint-set-product.hpp.

◆ projection()

template<typename Scalar>
void aligator::ConstraintSetProductTpl< Scalar >::projection ( const ConstVectorRef & z,
VectorRef zout ) const
inlineoverridevirtual

Compute projection of variable z onto the constraint set.

Parameters
[in]zInput vector
[out]zoutOutput projection

Implements aligator::ConstraintSetTpl< Scalar >.

Definition at line 67 of file constraint-set-product.hpp.

◆ normalConeProjection()

template<typename Scalar>
void aligator::ConstraintSetProductTpl< Scalar >::normalConeProjection ( const ConstVectorRef & z,
VectorRef zout ) const
inlineoverridevirtual

Compute projection of z onto the normal cone to the set. The default implementation is just \( \mathrm{id} - P\).

Parameters
[in]zInput vector
[out]zoutOutput projection on the normal projection

Implements aligator::ConstraintSetTpl< Scalar >.

Definition at line 75 of file constraint-set-product.hpp.

◆ applyProjectionJacobian()

template<typename Scalar>
void aligator::ConstraintSetProductTpl< Scalar >::applyProjectionJacobian ( const ConstVectorRef & z,
MatrixRef Jout ) const
inlineoverridevirtual

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 from aligator::ConstraintSetTpl< Scalar >.

Definition at line 84 of file constraint-set-product.hpp.

◆ applyNormalConeProjectionJacobian()

template<typename Scalar>
void aligator::ConstraintSetProductTpl< Scalar >::applyNormalConeProjectionJacobian ( const ConstVectorRef & z,
MatrixRef Jout ) const
inlineoverridevirtual

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 from aligator::ConstraintSetTpl< Scalar >.

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

◆ computeActiveSet()

template<typename Scalar>
void aligator::ConstraintSetProductTpl< Scalar >::computeActiveSet ( const ConstVectorRef & z,
Eigen::Ref< ActiveType > out ) const
inlineoverridevirtual

Compute the active set of the constraint. Active means the Jacobian of the proximal operator is nonzero.

Implements aligator::ConstraintSetTpl< Scalar >.

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

◆ components()

template<typename Scalar>
const std::vector< xyz::polymorphic< Base > > & aligator::ConstraintSetProductTpl< Scalar >::components ( ) const
inline

Definition at line 111 of file constraint-set-product.hpp.

◆ blockSizes()

template<typename Scalar>
const std::vector< Eigen::Index > & aligator::ConstraintSetProductTpl< Scalar >::blockSizes ( ) const
inline

Definition at line 114 of file constraint-set-product.hpp.


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