robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::ConstraintComponentData Class Reference

Data used in constraint components. Composed by slack, dual (Lagrange multiplier), primal residual, complementary slackness between the slack and dual, and directions of slack and dual. More...

#include <constraint_component_data.hpp>

Public Member Functions

 ConstraintComponentData (const int dimc, const double barrier_param)
 Constructor. More...
 
 ConstraintComponentData ()
 Default constructor. More...
 
 ~ConstraintComponentData ()=default
 Default destructor. More...
 
 ConstraintComponentData (const ConstraintComponentData &)=default
 Default copy constructor. More...
 
ConstraintComponentDataoperator= (const ConstraintComponentData &)=default
 Default copy operator. More...
 
 ConstraintComponentData (ConstraintComponentData &&) noexcept=default
 Default move constructor. More...
 
ConstraintComponentDataoperator= (ConstraintComponentData &&) noexcept=default
 Default move assign operator. More...
 
double KKTError () const
 Returns the squared norm of the KKT reisdual, that is, the sum of the squared norm of the primal residual and complementary slackness of the constraint. More...
 
template<int p = 1>
double primalFeasibility () const
 Returns the lp norm of the primal feasibility, i.e., the constraint violation. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter. More...
 
template<int p = 1>
double dualFeasibility () const
 Returns the lp norm of the dual feasibility. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter. More...
 
void resize (const int dimc)
 Resizes the constraint. More...
 
int dimc () const
 Dimension of the constraint. More...
 
bool checkDimensionalConsistency () const
 Check whether dimensions of slack, dual, residual, cmpl, dslack, ddual are ConstraintComponentData::dimc(). More...
 
bool isApprox (const ConstraintComponentData &other) const
 Checks the equivalence of two ConstraintComponentData. More...
 

Public Attributes

Eigen::VectorXd slack
 Slack variable of the constraint. Size is ConstraintComponentData::dimc(). All elements must be positive. More...
 
Eigen::VectorXd dual
 Dual variable (Lagrange multiplier) of the constraint. Size is ConstraintComponentData::dimc(). All elements must be positive. More...
 
Eigen::VectorXd residual
 Primal residual of the constraint. Size is ConstraintComponentData::dimc(). More...
 
Eigen::VectorXd cmpl
 Residual in the complementary slackness between slack and dual. Size is ConstraintComponentData::dimc(). More...
 
Eigen::VectorXd dslack
 Newton direction of the slack. Size is ConstraintComponentData::dimc(). More...
 
Eigen::VectorXd ddual
 Newton direction of the dual. Size is ConstraintComponentData::dimc(). More...
 
Eigen::VectorXd cond
 Used in condensing of slack and dual. Size is ConstraintComponentData::dimc(). More...
 
double log_barrier
 Value of the log berrier function of the slack variable. More...
 
std::vector< Eigen::VectorXd > r
 std vector of Eigen::VectorXd used to store residual temporaly. Only be allocated in ConstraintComponentBase::allocateExtraData(). More...
 
std::vector< Eigen::MatrixXd > J
 std vector of Eigen::MatrixXd used to store Jacobian temporaly. Only be allocated in ConstraintComponentBase::allocateExtraData(). More...
 

Detailed Description

Data used in constraint components. Composed by slack, dual (Lagrange multiplier), primal residual, complementary slackness between the slack and dual, and directions of slack and dual.

Constructor & Destructor Documentation

◆ ConstraintComponentData() [1/4]

robotoc::ConstraintComponentData::ConstraintComponentData ( const int  dimc,
const double  barrier_param 
)

Constructor.

Parameters
[in]dimcDimension of the constraint component. Must be positive.
[in]barrier_paramBarrier parameter. Must be positive. Should be small. Only used to initialize the slack and dual variables.

◆ ConstraintComponentData() [2/4]

robotoc::ConstraintComponentData::ConstraintComponentData ( )

Default constructor.

◆ ~ConstraintComponentData()

robotoc::ConstraintComponentData::~ConstraintComponentData ( )
default

Default destructor.

◆ ConstraintComponentData() [3/4]

robotoc::ConstraintComponentData::ConstraintComponentData ( const ConstraintComponentData )
default

Default copy constructor.

◆ ConstraintComponentData() [4/4]

robotoc::ConstraintComponentData::ConstraintComponentData ( ConstraintComponentData &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ checkDimensionalConsistency()

bool robotoc::ConstraintComponentData::checkDimensionalConsistency ( ) const

Check whether dimensions of slack, dual, residual, cmpl, dslack, ddual are ConstraintComponentData::dimc().

Returns
Dimension of the constraint.

◆ dimc()

int robotoc::ConstraintComponentData::dimc ( ) const
inline

Dimension of the constraint.

Returns
Dimension of the constraint.

◆ dualFeasibility()

template<int p = 1>
double robotoc::ConstraintComponentData::dualFeasibility ( ) const
inline

Returns the lp norm of the dual feasibility. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter.

Template Parameters
pIndex of norm. Default is 1 (l1-norm).
Returns
The lp norm of the dual feasibility.

◆ isApprox()

bool robotoc::ConstraintComponentData::isApprox ( const ConstraintComponentData other) const

Checks the equivalence of two ConstraintComponentData.

Parameters
[in]otherOther object.
Returns
true if this and other is same. false otherwise.

◆ KKTError()

double robotoc::ConstraintComponentData::KKTError ( ) const
inline

Returns the squared norm of the KKT reisdual, that is, the sum of the squared norm of the primal residual and complementary slackness of the constraint.

Returns
Squared norm of the KKT residual.

◆ operator=() [1/2]

ConstraintComponentData & robotoc::ConstraintComponentData::operator= ( const ConstraintComponentData )
default

Default copy operator.

◆ operator=() [2/2]

ConstraintComponentData & robotoc::ConstraintComponentData::operator= ( ConstraintComponentData &&  )
defaultnoexcept

Default move assign operator.

◆ primalFeasibility()

template<int p = 1>
double robotoc::ConstraintComponentData::primalFeasibility ( ) const
inline

Returns the lp norm of the primal feasibility, i.e., the constraint violation. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter.

Template Parameters
pIndex of norm. Default is 1 (l1-norm).
Returns
The lp norm of the primal feasibility.

◆ resize()

void robotoc::ConstraintComponentData::resize ( const int  dimc)

Resizes the constraint.

Parameters
[in]dimcThe new size.

Member Data Documentation

◆ cmpl

Eigen::VectorXd robotoc::ConstraintComponentData::cmpl

Residual in the complementary slackness between slack and dual. Size is ConstraintComponentData::dimc().

◆ cond

Eigen::VectorXd robotoc::ConstraintComponentData::cond

Used in condensing of slack and dual. Size is ConstraintComponentData::dimc().

◆ ddual

Eigen::VectorXd robotoc::ConstraintComponentData::ddual

Newton direction of the dual. Size is ConstraintComponentData::dimc().

◆ dslack

Eigen::VectorXd robotoc::ConstraintComponentData::dslack

Newton direction of the slack. Size is ConstraintComponentData::dimc().

◆ dual

Eigen::VectorXd robotoc::ConstraintComponentData::dual

Dual variable (Lagrange multiplier) of the constraint. Size is ConstraintComponentData::dimc(). All elements must be positive.

◆ J

std::vector<Eigen::MatrixXd> robotoc::ConstraintComponentData::J

std vector of Eigen::MatrixXd used to store Jacobian temporaly. Only be allocated in ConstraintComponentBase::allocateExtraData().

◆ log_barrier

double robotoc::ConstraintComponentData::log_barrier

Value of the log berrier function of the slack variable.

◆ r

std::vector<Eigen::VectorXd> robotoc::ConstraintComponentData::r

std vector of Eigen::VectorXd used to store residual temporaly. Only be allocated in ConstraintComponentBase::allocateExtraData().

◆ residual

Eigen::VectorXd robotoc::ConstraintComponentData::residual

Primal residual of the constraint. Size is ConstraintComponentData::dimc().

◆ slack

Eigen::VectorXd robotoc::ConstraintComponentData::slack

Slack variable of the constraint. Size is ConstraintComponentData::dimc(). All elements must be positive.


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