Commit ace0f4bb authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add benchmark timer in LinearConstraint::decompose

parent 5b8792d8
......@@ -35,6 +35,8 @@ namespace hpp {
b.setZero();
}
~LinearConstraint ();
void concatenate (const LinearConstraint& oc)
{
assert(oc.J.cols() == J.cols());
......
......@@ -16,6 +16,8 @@
#include <hpp/core/path-optimization/linear-constraint.hh>
#include <hpp/util/timer.hh>
// #define USE_SVD
#ifdef USE_SVD
# include <hpp/constraints/svd.hh>
......@@ -24,8 +26,17 @@
namespace hpp {
namespace core {
namespace pathOptimization {
HPP_DEFINE_TIMECOUNTER(LinearConstraint_decompose);
LinearConstraint::~LinearConstraint ()
{
HPP_DISPLAY_TIMECOUNTER(LinearConstraint_decompose);
}
bool LinearConstraint::decompose (bool check)
{
HPP_SCOPE_TIMECOUNTER(LinearConstraint_decompose);
if (J.rows() == 0) { // No constraint
PK = matrix_t::Identity (J.cols(), J.cols());
xStar = vector_t::Zero (PK.rows());
......
......@@ -42,7 +42,6 @@ namespace hpp {
typedef Eigen::BlockIndex BlockIndex;
HPP_DEFINE_TIMECOUNTER(SGB_constraintDecomposition);
HPP_DEFINE_TIMECOUNTER(SGB_qpDecomposition);
HPP_DEFINE_TIMECOUNTER(SGB_findNewConstraint);
HPP_DEFINE_TIMECOUNTER(SGB_qpSolve);
......@@ -515,10 +514,7 @@ namespace hpp {
SquaredLength<Spline, 1> cost (splines, rDof, rDof);
// 5
bool feasible;
{ HPP_SCOPE_TIMECOUNTER(SGB_constraintDecomposition);
feasible = constraint.decompose (true); // true = check that the constraint is feasible
}
bool feasible = constraint.decompose (true); // true = check that the constraint is feasible
if (!feasible) throw std::invalid_argument("Constraints are not feasible");
LinearConstraint collisionReduced (constraint.PK.rows(), 0);
......@@ -664,7 +660,6 @@ namespace hpp {
}
// 7
HPP_DISPLAY_TIMECOUNTER(SGB_constraintDecomposition);
HPP_DISPLAY_TIMECOUNTER(SGB_qpDecomposition);
HPP_DISPLAY_TIMECOUNTER(SGB_findNewConstraint);
HPP_DISPLAY_TIMECOUNTER(SGB_qpSolve);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment