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] = { 5.0, 5.0, 8.0, 9.0, 5.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 );
88 printf(
"\nxOpt = [ %e, %e, %e, %e, %e ]; objVal = %e\n\n", xOpt[0],xOpt[1],xOpt[2],xOpt[3],xOpt[4],example.
getObjVal() );
93 getKktViolation( 5,2, H,g,A,lb,ub,lbA,ubA, xOpt,yOpt, stat,feas,cmpl );
94 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)
returnValue getKktViolation(int_t nV, int_t nC, 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, const real_t *const x, const real_t *const y, real_t &stat, real_t &feas, real_t &cmpl, const real_t *const workingSetB=0, const real_t *const workingSetC=0, BooleanType hasIdentityHessian=BT_FALSE)
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.
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