Skip to content
Snippets Groups Projects
Commit 05d76f6d authored by Steve Tonneau's avatar Steve Tonneau
Browse files

adding option to canonicalize polytope generators in api

parent 6c0d8725
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,8 @@ private:
* indicate the max number of attempts to compute the cone by introducing
* a small pertubation of the system */
const unsigned max_num_cdd_trials;
/** whether to remove redundant inequalities when computing double description matrices*/
const bool canonicalize_cdd_matrix;
/** Inequality matrix and vector defining the CoM support polygon HD com + Hd <= h */
MatrixX3 m_HD;
......@@ -88,10 +90,12 @@ public:
* @param solver_type Type of LP solver to use.
* @param useWarmStart Whether the LP solver can warm start the resolution.
* @param max_num_cdd_trials indicate the max number of attempts to compute the cone by introducing
* @param canonicalize_cdd_matrix whether to remove redundant inequalities when computing double description matrices
* a small pertubation of the system
*/
StaticEquilibrium(std::string name, double mass, unsigned int generatorsPerContact,
SolverLP solver_type, bool useWarmStart=true, const unsigned int max_num_cdd_trials=0);
SolverLP solver_type, bool useWarmStart=true, const unsigned int max_num_cdd_trials=0,
const bool canonicalize_cdd_matrix=false);
/**
* @brief Returns the useWarmStart flag.
......
......@@ -19,9 +19,10 @@ bool StaticEquilibrium::m_is_cdd_initialized = false;
StaticEquilibrium::StaticEquilibrium(string name, double mass, unsigned int generatorsPerContact,
SolverLP solver_type, bool useWarmStart,
const unsigned int max_num_cdd_trials)
const unsigned int max_num_cdd_trials, const bool canonicalize_cdd_matrix)
: m_is_cdd_stable(true)
, max_num_cdd_trials(max_num_cdd_trials)
, canonicalize_cdd_matrix(canonicalize_cdd_matrix)
{
if(!m_is_cdd_initialized)
{
......@@ -495,7 +496,7 @@ LP_status StaticEquilibrium::findExtremumInDirection(Cref_vector3 direction, Ref
bool StaticEquilibrium::computePolytopeProjection(Cref_matrix6X v)
{
// getProfiler().start("eigen_to_cdd");
dd_MatrixPtr V = cone_span_eigen_to_cdd(v.transpose());
dd_MatrixPtr V = cone_span_eigen_to_cdd(v.transpose(),canonicalize_cdd_matrix);
// getProfiler().stop("eigen_to_cdd");
dd_ErrorType error = dd_NoError;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment