hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
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)
 
void computeRank ()
 Compute rank of the constraint using a LU decomposition. More...
 
bool reduceConstraint (const LinearConstraint &lc, LinearConstraint &lcr, bool computeRank=true) const
 
void computeSolution (const vector_t &v)
 
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

◆ ~LinearConstraint()

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

Member Function Documentation

◆ addRows()

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

◆ computeRank()

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

Compute rank of the constraint using a LU decomposition.

◆ 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

◆ concatenate()

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

◆ 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) \).

◆ 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.

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

Projector onto \( kernel(J) \).

◆ rank

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

Rank of J.

◆ xSol

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

◆ xStar

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

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


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