36 #include <qpOASES.hpp> 46 real_t H[4*4] = { 1.0, 0.0, 0.0, 0.5,
50 real_t A[3*4] = { 1.0, 1.0, 0.0, 0.0,
53 real_t g[4] = { 1.5, 1.0, -1.0, -1.0 };
54 real_t lb[4] = { 0.5, -2.0, 0.0, 0.0 };
55 real_t ub[4] = { 1.0, 2.0, 1.0, 0.5 };
69 example.
init( H,g,A,lb,ub,lbA,ubA, nWSR );
76 print( xOpt,4,
"xOpt" );
77 print( yOpt,4+3,
"yOpt" );
78 printf(
"objVal = %e\n\n", example.
getObjVal() );
85 printf(
"stat = %e\nfeas = %e\ncmpl = %e\n", stat,feas,cmpl );
100 example.
hotstart( g,lb,ub,lbA,ubA, nWSR,0,&prevBounds,&prevConstraints );
105 print( xOpt,4,
"xOpt" );
106 print( yOpt,4+3,
"yOpt" );
107 printf(
"objVal = %e\n\n", example.
getObjVal() );
111 printf(
"stat = %e\nfeas = %e\ncmpl = %e\n", stat,feas,cmpl );
124 prevConstraints.
print();
127 prevConstraints.
print();
130 example.
hotstart( g,lb,ub,lbA,ubA, nWSR,0,&prevBounds,&prevConstraints );
135 print( xOpt,4,
"xOpt" );
136 print( yOpt,4+3,
"yOpt" );
137 printf(
"objVal = %e\n\n", example.
getObjVal() );
141 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)
Manages working sets of constraints.
virtual returnValue rotate(int offset)
returnValue getBounds(Bounds *const _bounds) const
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)
returnValue setOptions(const Options &_options)
returnValue getConstraints(Constraints *const _constraints) const
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
returnValue moveActiveToInactive(int _number)
BEGIN_NAMESPACE_QPOASES returnValue print(const real_t *const v, int n)
Manages working sets of bounds (= box constraints).
Implements the online active set strategy for QPs with general constraints.
returnValue getDualSolution(real_t *const yOpt) const