36 #include <qpOASES.hpp> 46 real_t H[5*5] = { 1.224642131370767e+01, 2.908638763113702e+00, 0.0, 0.0, 0.0,
47 2.908638763113702e+00, 2.497106275003180e+00, 0.0, 0.0, 0.0,
48 0.0, 0.0, 1.0, 0.0, 0.0,
49 0.0, 0.0, 0.0, 5.158460640334052e-02, 4.723556059962540e-02,
50 0.0, 0.0, 0.0, 4.723556059962540e-02, 4.325317843302175e-02 };
51 real_t A[2*5] = { -1.404358970692652e+00, -2.556613491156063e+00, 3.202524559238066e+00, -1.0, 0.0,
52 6.587910295430314e-01, -5.349454475937998e-01, 4.391976356955536e-01, 0.0, -1.0 };
53 real_t g[5] = { 2.474135331302147e+01,
54 5.857286430296258e+00,
55 2.359382646348721e-01,
56 1.721047069188781e-01,
57 1.575947337774199e-01 };
58 real_t lb[5] = { -10.0, -10.0, -10.0, -10.0, -10.0 };
59 real_t ub[5] = { 10.0, 10.0, 10.0, 10.0, 10.0 };
60 real_t lbA[2] = { 1.643135416077167e+00, 1.056813028189597e+00 };
61 real_t ubA[2] = { 1.643135416077167e+00, 1.056813028189597e+00 };
75 int_t simpleStatus = -1;
78 retVal = example.
init( H,g,A,lb,ub,lbA,ubA, nWSR,0 );
90 printf(
"\nxOpt = [ %e, %e, ... ]; objVal = %e\n\n", xOpt[0],xOpt[1],example.
getObjVal() );
97 printf(
"stat = %e\nfeas = %e\ncmpl = %e\n", stat,feas,cmpl );
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)
Allows to pass back messages to the calling function.
returnValue setOptions(const Options &_options)
Provides a generic way to set and pass user-specified options.
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
int_t getSimpleStatus(returnValue returnvalue, BooleanType doPrintStatus=BT_FALSE)
Implements the online active set strategy for QPs with general constraints.
#define QPOASES_TEST_FOR_TRUE(x)
returnValue setPrintLevel(PrintLevel _printlevel)
returnValue getDualSolution(real_t *const yOpt) const