37 #include <qpOASES.hpp> 110 constrValue[0] = 0.0;
112 for( i=0; i<maxI; ++i )
113 constrValue[0] +=
A[constrIndex*nV + i] * x[i];
140 const char* path =
"./cpp/data/oqp/diesel/";
148 &H,&g,&A,&lb,&ub,&lbA,&ubA,
160 qp.
init( H,&(g[k*nV]),A,&(lb[k*nV]),&(ub[k*nV]),&(lbA[k*nC]),&(ubA[k*nC]),nWSR,&cputime );
163 printf(
"cputime without constraintProduct: %.3ems\n", cputime*1000.0 );
172 qpCP.
init( H,&(g[k*nV]),A,&(lb[k*nV]),&(ub[k*nV]),&(lbA[k*nC]),&(ubA[k*nC]),nWSR,&cputime );
175 printf(
"cputime without constraintProduct: %.3ems\n", cputime*1000.0 );
188 for(
int_t ii=0; ii<nV+
nC; ++ii )
returnValue getPrimalSolution(real_t *const xOpt) const
#define USING_NAMESPACE_QPOASES
virtual ~MpcConstraintProduct()
returnValue init(const real_t *const _H, const real_t *const _g, const real_t *const _A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA, int &nWSR, const real_t *const yOpt=0, real_t *const cputime=0)
virtual int_t operator()(int_t constrIndex, const real_t *const x, real_t *const constrValue) const
Interface for specifying user-defined evaluations of constraint products.
#define TEST_DATA_NOT_FOUND
real_t getMin(real_t x, real_t y)
returnValue setOptions(const Options &_options)
returnValue setConstraintProduct(ConstraintProduct *const _constraintProduct)
Provides a generic way to set and pass user-specified options.
MpcConstraintProduct & operator=(const MpcConstraintProduct &rhs)
void rhs(const real_t *x, real_t *f)
Example illustrating the use of the ConstraintProduct class.
MpcConstraintProduct(int_t _nV, int_t _nC, int_t _diagOffset, real_t *_A)
#define QPOASES_TEST_FOR_NEAR(x, y)
Implements the online active set strategy for QPs with general constraints.
MpcConstraintProduct(const MpcConstraintProduct &rhs)
returnValue getDualSolution(real_t *const yOpt) const