1#ifndef ROBOTOC_CONSTRAINT_COMPONENT_DATA_HPP_
2#define ROBOTOC_CONSTRAINT_COMPONENT_DATA_HPP_
108 std::vector<Eigen::VectorXd>
r;
114 std::vector<Eigen::MatrixXd>
J;
135 return residual.template lpNorm<p>();
147 return cmpl.template lpNorm<p>();
Data used in constraint components. Composed by slack, dual (Lagrange multiplier),...
Definition: constraint_component_data.hpp:17
Eigen::VectorXd ddual
Newton direction of the dual. Size is ConstraintComponentData::dimc().
Definition: constraint_component_data.hpp:91
double primalFeasibility() const
Returns the lp norm of the primal feasibility, i.e., the constraint violation. Default norm is l1-nor...
Definition: constraint_component_data.hpp:134
double dualFeasibility() const
Returns the lp norm of the dual feasibility. Default norm is l1-norm. You can also specify l-infty no...
Definition: constraint_component_data.hpp:146
std::vector< Eigen::VectorXd > r
std vector of Eigen::VectorXd used to store residual temporaly. Only be allocated in ConstraintCompon...
Definition: constraint_component_data.hpp:108
Eigen::VectorXd residual
Primal residual of the constraint. Size is ConstraintComponentData::dimc().
Definition: constraint_component_data.hpp:73
bool checkDimensionalConsistency() const
Check whether dimensions of slack, dual, residual, cmpl, dslack, ddual are ConstraintComponentData::d...
ConstraintComponentData(const int dimc, const double barrier_param)
Constructor.
void resize(const int dimc)
Resizes the constraint.
ConstraintComponentData(const ConstraintComponentData &)=default
Default copy constructor.
int dimc() const
Dimension of the constraint.
Definition: constraint_component_data.hpp:160
ConstraintComponentData()
Default constructor.
Eigen::VectorXd dslack
Newton direction of the slack. Size is ConstraintComponentData::dimc().
Definition: constraint_component_data.hpp:85
~ConstraintComponentData()=default
Default destructor.
Eigen::VectorXd cond
Used in condensing of slack and dual. Size is ConstraintComponentData::dimc().
Definition: constraint_component_data.hpp:97
Eigen::VectorXd cmpl
Residual in the complementary slackness between slack and dual. Size is ConstraintComponentData::dimc...
Definition: constraint_component_data.hpp:79
ConstraintComponentData & operator=(const ConstraintComponentData &)=default
Default copy operator.
std::vector< Eigen::MatrixXd > J
std vector of Eigen::MatrixXd used to store Jacobian temporaly. Only be allocated in ConstraintCompon...
Definition: constraint_component_data.hpp:114
Eigen::VectorXd slack
Slack variable of the constraint. Size is ConstraintComponentData::dimc(). All elements must be posit...
Definition: constraint_component_data.hpp:61
ConstraintComponentData(ConstraintComponentData &&) noexcept=default
Default move constructor.
bool isApprox(const ConstraintComponentData &other) const
Checks the equivalence of two ConstraintComponentData.
double log_barrier
Value of the log berrier function of the slack variable.
Definition: constraint_component_data.hpp:102
double KKTError() const
Returns the squared norm of the KKT reisdual, that is, the sum of the squared norm of the primal resi...
Definition: constraint_component_data.hpp:122
Eigen::VectorXd dual
Dual variable (Lagrange multiplier) of the constraint. Size is ConstraintComponentData::dimc()....
Definition: constraint_component_data.hpp:67
Definition: constraint_component_base.hpp:17