17 #ifndef HPP_CORE_PATH_OPTIMIZATION_SPLINE_GRADIENT_BASED_LINEAR_CONSTRAINT_HH 18 #define HPP_CORE_PATH_OPTIMIZATION_SPLINE_GRADIENT_BASED_LINEAR_CONSTRAINT_HH 22 #include <hpp/util/debug.hh> 26 namespace pathOptimization {
31 J (outputSize, inputSize),
b (outputSize),
43 J.conservativeResize (
J.rows() + oc.
J.rows(),
J.cols());
44 J.bottomRows(oc.
J.rows()) = oc.
J;
45 b.conservativeResize (
b.rows() + oc.
b.rows());
46 b.tail(oc.
b.rows()) = oc.
b;
54 bool decompose (
bool check =
false,
bool throwIfNotValid =
false);
59 if (
J.size() == 0)
rank = 0;
61 Eigen::FullPivLU <matrix_t> lu (
J);
74 lcr.
J.noalias() = lc.
J *
PK;
75 lcr.
b.noalias() = lc.
b - lc.
J *
xStar;
80 return lcr.
rank == std::min(lcr.
J.rows(), lcr.
J.cols());
100 if (err.isZero(threshold))
return true;
101 hppDout (error,
"constraints could not be satisfied: " << err.norm() <<
'\n' << err);
108 J.conservativeResize(
J.rows() + nbRows,
J.cols());
109 b.conservativeResize(
b.rows() + nbRows);
111 J.bottomRows(nbRows).setZero();
139 #endif // HPP_CORE_PATH_OPTIMIZATION_SPLINE_GRADIENT_BASED_LINEAR_CONSTRAINT_HH void concatenate(const LinearConstraint &oc)
Definition: linear-constraint.hh:40
#define hppDout(channel, data)
bool decompose(bool check=false, bool throwIfNotValid=false)
pinocchio::size_type size_type
Definition: fwd.hh:156
matrix_t J
Definition: linear-constraint.hh:117
vector_t xSol
Definition: linear-constraint.hh:131
LinearConstraint(size_type inputSize, size_type outputSize)
Definition: linear-constraint.hh:30
void addRows(const std::size_t &nbRows)
Definition: linear-constraint.hh:105
assert(d.lhs()._blocks()==d.rhs()._blocks())
bool isSatisfied(const vector_t &x, const value_type &threshold=Eigen::NumTraits< value_type >::dummy_precision())
Returns .
Definition: linear-constraint.hh:97
vector_t b
Definition: linear-constraint.hh:118
pinocchio::matrix_t matrix_t
Definition: fwd.hh:145
pinocchio::vector_t vector_t
Definition: fwd.hh:201
pinocchio::value_type value_type
Definition: fwd.hh:157
bool reduceConstraint(const LinearConstraint &lc, LinearConstraint &lcr, bool computeRank=true) const
Definition: linear-constraint.hh:72
void computeRank()
Compute rank of the constraint using a LU decomposition.
Definition: linear-constraint.hh:57
size_type rank
Rank of J.
Definition: linear-constraint.hh:126
void computeSolution(const vector_t &v)
Definition: linear-constraint.hh:88
A linear constraint .
Definition: linear-constraint.hh:28
vector_t xStar
is a particular solution.
Definition: linear-constraint.hh:131
matrix_t PK
Projector onto .
Definition: linear-constraint.hh:129