hpp-core 9.3.0
Implement basic classes for canonical path planning for kinematic chains.
Loading...
Searching...
No Matches
hpp::core::pathOptimization::LinearConstraint Struct Reference

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

Public Member Functions

 LinearConstraint (size_type inputSize, size_type outputSize)
 ~LinearConstraint ()
void concatenate (const LinearConstraint &oc)
void setBlock (size_type row, size_type col, const matrix_t &block)
bool decompose (bool check=false, bool throwIfNotValid=false)
void computeRank ()
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) \).
void addRows (const std::size_t &nbRows)

Public Attributes

Model
RowMajorSparseMatrix_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.
SparseMatrix_t PK
 Projector onto \( kernel(J) \).
vector_t xStar
 \( x^* \) is a particular solution.
vector_t xSol

Detailed Description

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

J is sparse: constraints on splines only involve the parameters of one or two consecutive splines.

Constructor & Destructor Documentation

◆ LinearConstraint()

hpp::core::pathOptimization::LinearConstraint::LinearConstraint(size_typeinputSize,
size_typeoutputSize )
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()

Compute rank of the constraint using a LU decomposition of a dense copy of J

◆ 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(boolcheck = false,
boolthrowIfNotValid = false )

Compute one solution and a base of the kernel of matrix J. rank is also updated.

The columns of J are split into the connected components of the variables coupled by its rows, and each component is decomposed separately: PK is block diagonal up to a permutation of the variables.

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,
boolcomputeRank = 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.

◆ setBlock()

void hpp::core::pathOptimization::LinearConstraint::setBlock(size_typerow,
size_typecol,
const matrix_t &block )
inline

Set the block of J starting at (row, col) to block. Zero coefficients are stored only where J already has a non-zero.

Member Data Documentation

◆ b

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

◆ J

RowMajorSparseMatrix_t hpp::core::pathOptimization::LinearConstraint::J

◆ PK

SparseMatrix_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: