39 #include <qpOASES.hpp> 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 )
121 example.
init( H,g,A,0,0,lbA,0, nWSR,&cputime );
130 const int_t n_rhs = 7+7+50;
135 real_t y_out[(7+50)*n_rhs];
138 memset (g_in, 0,
sizeof (g_in));
139 memset (b_in, 0,
sizeof (b_in));
140 memset (bA_in, 0,
sizeof (bA_in));
142 for ( ii = 0; ii < 7; ++ii )
143 g_in[ii*7 + ii] = 1.0;
144 for ( ii = 0; ii < 7; ++ii )
145 b_in[(ii+7)*7 + ii] = 1.0;
146 for ( ii = 0; ii < 50; ++ii )
147 bA_in[(ii+14)*50 + ii] = 1.0;
149 example.
solveCurrentEQP ( n_rhs, g_in, b_in, b_in, bA_in, bA_in, x_out, y_out );
154 for ( ii = 0; ii < n_rhs; ++ii )
156 for ( jj = 0; jj < 7; ++jj )
157 g_in[ii*7 + jj] = g[jj] + g_in[ii*7+jj]*perturb;
158 for ( jj = 0; jj < 50; ++jj )
159 bA_in[ii*50 + jj] = lbA[jj] + bA_in[ii*50+jj]*perturb;
162 example.
hotstart( &g_in[ii*7],0,0,&bA_in[ii*50],0, nWSR, 0 );
164 real_t xPer[7], yPer[7+50];
168 for ( jj = 0; jj < 7; ++jj )
170 d =
getAbs (x_out[ii*7+jj]*perturb - (xPer[jj]-xOpt[jj]) );
173 for ( jj = 0; jj < 7+50; ++jj )
175 d =
getAbs (y_out[ii*(7+50)+jj]*perturb - (yPer[jj]-yOpt[jj]) );
179 printf (
"Maximum perturbation over all directions: %e\n", nrm);
returnValue getPrimalSolution(real_t *const xOpt) const
#define USING_NAMESPACE_QPOASES
returnValue solveCurrentEQP(const int n_rhs, const real_t *g_in, const real_t *lb_in, const real_t *ub_in, const real_t *lbA_in, const real_t *ubA_in, real_t *x_out, real_t *y_out)
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)
Implements the online active set strategy for QPs with general constraints.
returnValue getDualSolution(real_t *const yOpt) const