Skip to content
Snippets Groups Projects
Commit 5635c2c3 authored by stevet's avatar stevet
Browse files

tracks LP status. Test that lp fails when expected

parent 5bc8ace9
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,8 @@
glp_load_matrix(lp,idConsMat-1,ia,ja,ar);
int res = glp_simplex(lp, &opts);
if(res == 0)
res = glp_get_status(lp);
if(res == GLP_OPT)
{
cost = glp_get_obj_val(lp); //obtains a computed value of the objective function
idrow = 1;
......
......@@ -19,6 +19,7 @@
#include "solver/solver-abstract.hpp"
#ifdef USE_GLPK_SOLVER
#include <solver/glpk-wrapper.hpp>
#include <glpk.h>
#endif
#include <solver/eiquadprog-fast.hpp>
......@@ -135,7 +136,7 @@ ResultData solve( const MatrixXd & A,
#ifdef USE_GLPK_SOLVER
case SOLVER_GLPK:
{
res.success_ = (solvers::solveglpk(g,D,d,A,b,minBounds, maxBounds,res.x,res.cost_) == 0);
res.success_ = (solvers::solveglpk(g,D,d,A,b,minBounds, maxBounds,res.x,res.cost_) == GLP_OPT);
return res;
}
#endif
......
......@@ -150,6 +150,18 @@ void check_transition(bezier_com_traj::ProblemData& pData, VectorX Ts,bool shoul
if(shouldFail){
BOOST_CHECK(!res.success_);
if(test_continuous)
{
res = bezier_com_traj::computeCOMTraj(pData,Ts,-1,solvers::SOLVER_QUADPROG);
BOOST_CHECK(!res.success_);
pData.representation_ == bezier_com_traj::FORCE;
res = bezier_com_traj::computeCOMTraj(pData,Ts,-1,solvers::SOLVER_QUADPROG);
BOOST_CHECK(!res.success_);
#ifdef USE_GLPK_SOLVER
res = bezier_com_traj::computeCOMTraj(pData,Ts,-1,solvers::SOLVER_GLPK);
BOOST_CHECK(!res.success_);
#endif
}
return;
}
......
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