39 #include <qpOASES.hpp> 40 #include "../../examples/example4CP.cpp" 65 for( i=0; i<7*7; ++i )
84 for( i=0; i<50*7; ++i )
91 A[i*7 + (i/10)+2] = 1.0;
106 for( i=0; i<50; ++i )
123 exampleCP.
init( H,g,A,0,0,lbA,0, nWSR,&cputime );
132 exampleCP.
hotstart( g,0,0,lbA,0, nWSR,&cputime );
139 printf(
"\nxOpt = [ %e, %e, %e ... ]; objVal = %e\n", xOptCP[0],xOptCP[1],xOptCP[2],exampleCP.
getObjVal() );
140 printf(
"CPU time: %.3f microseconds\n\n", cputime*1.0e6 );
147 printf(
"stat = %e\nfeas = %e\ncmpl = %e\n", stat,feas,cmpl );
164 example.
init( H,g,A,0,0,lbA,0, nWSR,&cputime );
172 example.
hotstart( g,0,0,lbA,0, nWSR,&cputime );
179 printf(
"\nxOpt = [ %e, %e, %e ... ]; objVal = %e\n", xOpt[0],xOpt[1],xOpt[2],example.
getObjVal() );
180 printf(
"CPU time: %.3f microseconds\n\n", cputime*1.0e6 );
186 printf(
"stat = %e\nfeas = %e\ncmpl = %e\n", stat,feas,cmpl );
192 for(
int_t ii=0; ii<7; ++ii )
195 for(
int_t ii=0; ii<7+50; ++ii )
returnValue getPrimalSolution(real_t *const xOpt) const
#define USING_NAMESPACE_QPOASES
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)
returnValue hotstart(const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new, int &nWSR, real_t *const cputime)
Example illustrating the use of the ConstraintProduct class.
returnValue setConstraintProduct(ConstraintProduct *const _constraintProduct)
Provides additional tools for analysing QP solutions.
#define QPOASES_TEST_FOR_TOL(x, tol)
real_t getKktViolation(QProblemB *const qp, real_t *const maxStat=0, real_t *const maxFeas=0, real_t *const maxCmpl=0) const
#define QPOASES_TEST_FOR_NEAR(x, y)
Implements the online active set strategy for QPs with general constraints.
returnValue setPrintLevel(PrintLevel _printlevel)
returnValue getDualSolution(real_t *const yOpt) const