hpp::core::pathOptimization::LinearConstraint Struct Reference

A linear constraint \( J \times x = b \). More...

#include <hpp/core/path-optimization/linear-constraint.hh>

Public Member Functions

 LinearConstraint (size_type inputSize, size_type outputSize)
 
 ~LinearConstraint ()
 
void concatenate (const LinearConstraint &oc)
 
bool decompose (bool check=false, bool throwIfNotValid=false)
 Compute one solution and a base of the kernel of matrix J. More...
 
void computeRank ()
 Compute rank of the constraint using a LU decomposition. More...
 
bool reduceConstraint (const LinearConstraint &lc, LinearConstraint &lcr, bool computeRank=true) const
 Reduced constraint into the set of solutions of this constraint. More...
 
void computeSolution (const vector_t &v)
 Compute the unique solution derived from v into xSol. More...
 
bool isSatisfied (const vector_t &x, const value_type &threshold=Eigen::NumTraits< value_type >::dummy_precision())
 Returns \( ( J \times x - b ).isZero (threshold) \). More...
 
void addRows (const std::size_t &nbRows)
 

Public Attributes

Model
matrix_t J
 
vector_t b
 
Data

Solutions are \( \left\{ x^* + PK \times v, v \in \mathbb{R}^{nCols(J) - rank} \right\} \)

size_type rank
 Rank of J. More...
 
matrix_t PK
 Projector onto \( kernel(J) \). More...
 
vector_t xStar
 \( x^* \) is a particular solution. More...
 
vector_t xSol
 

Detailed Description

A linear constraint \( J \times x = b \).

Constructor & Destructor Documentation

◆ LinearConstraint()

hpp::core::pathOptimization::LinearConstraint::LinearConstraint ( size_type  inputSize,
size_type  outputSize 
)
inline

References b, J, and ~LinearConstraint().

◆ ~LinearConstraint()

hpp::core::pathOptimization::LinearConstraint::~LinearConstraint ( )

Referenced by LinearConstraint().

Member Function Documentation

◆ addRows()

void hpp::core::pathOptimization::LinearConstraint::addRows ( const std::size_t &  nbRows)
inline

References b, and J.

◆ computeRank()

void hpp::core::pathOptimization::LinearConstraint::computeRank ( )
inline

Compute rank of the constraint using a LU decomposition.

References J, and rank.

Referenced by reduceConstraint().

◆ computeSolution()

void hpp::core::pathOptimization::LinearConstraint::computeSolution ( const vector_t v)
inline

Compute the unique solution derived from v into xSol.

\( xSol \gets x^* + PK \times v \)

Parameters
van element of the kernel of matrix J.
Return values
this->xSol

References isSatisfied(), PK, xSol, and xStar.

◆ concatenate()

void hpp::core::pathOptimization::LinearConstraint::concatenate ( const LinearConstraint oc)
inline

References b, and J.

◆ decompose()

bool hpp::core::pathOptimization::LinearConstraint::decompose ( bool  check = false,
bool  throwIfNotValid = false 
)

Compute one solution and a base of the kernel of matrix J.

rank is also updated.

Parameters
checkIf true, checks whether the constraint is feasible.
Returns
whether the constraint is feasible (alwys true when check is false)

◆ isSatisfied()

bool hpp::core::pathOptimization::LinearConstraint::isSatisfied ( const vector_t x,
const value_type threshold = Eigen::NumTraits<value_type>::dummy_precision() 
)
inline

Returns \( ( J \times x - b ).isZero (threshold) \).

References b, and J.

Referenced by computeSolution().

◆ reduceConstraint()

bool hpp::core::pathOptimization::LinearConstraint::reduceConstraint ( const LinearConstraint lc,
LinearConstraint lcr,
bool  computeRank = true 
) const
inline

Reduced constraint into the set of solutions of this constraint.

Parameters
[in]lcthe full constraint
[out]lcrthe reduced constraint
Returns
if computeRank, returns true if the reduced constraint is full rank. if not computeRank, returns true.
Note
rank is computed using computeRank method.

References b, computeRank(), J, PK, rank, and xStar.

Member Data Documentation

◆ b

vector_t hpp::core::pathOptimization::LinearConstraint::b

◆ J

matrix_t hpp::core::pathOptimization::LinearConstraint::J

◆ PK

matrix_t hpp::core::pathOptimization::LinearConstraint::PK

◆ rank

size_type hpp::core::pathOptimization::LinearConstraint::rank

Rank of J.

Referenced by computeRank(), and reduceConstraint().

◆ xSol

vector_t hpp::core::pathOptimization::LinearConstraint::xSol

Referenced by computeSolution().

◆ xStar

vector_t hpp::core::pathOptimization::LinearConstraint::xStar

\( x^* \) is a particular solution.

Referenced by computeSolution(), reduceConstraint(), and hpp::core::pathOptimization::QuadraticProgram::reduced().