51 int* nQP,
int* nV,
int* nC,
int* nEC
72 if ( ( *nQP <= 0 ) || ( *nV <= 0 ) || ( *nC < 0 ) || ( *nEC < 0 ) )
86 int* nQP,
int* nV,
int* nC,
int* nEC,
94 if ( ( H == 0 ) || ( g == 0 ) || ( lb == 0 ) || ( ub == 0 ) )
104 if ( ( *nC > 0 ) && ( ( A == 0 ) || ( lbA == 0 ) || ( ubA == 0 ) ) )
198 real_t CPUtimeLimit = *maxCPUtime;
199 real_t CPUtimeCur = CPUtimeLimit;
228 *maxStationarity = 0.0;
229 *maxFeasibility = 0.0;
230 *maxComplementarity = 0.0;
243 for( k=0; k<nQP; ++k )
247 lbCur = &( lb[k*nV] );
248 ubCur = &( ub[k*nV] );
249 lbACur = &( lbA[k*nC] );
250 ubACur = &( ubA[k*nC] );
253 nWSRcur = maxAllowedNWSR;
254 CPUtimeCur = CPUtimeLimit;
257 if ( ( k == 0 ) || ( useHotstarts ==
BT_FALSE ) )
260 returnvalue =
QProblem_initM( &qp, H,gCur,A,lbCur,ubCur,lbACur,ubACur, &nWSRcur,&CPUtimeCur );
267 returnvalue =
QProblem_hotstart( &qp, gCur,lbCur,ubCur,lbACur,ubACur, &nWSRcur,&CPUtimeCur );
277 qpOASES_getKktViolation( nV,nC, _H,gCur,_A,lbCur,ubCur,lbACur,ubACur, x,y, &stat,&feas,&cmpl );
280 if ( nWSRcur > *maxNWSR )
282 if (stat > *maxStationarity) *maxStationarity = stat;
283 if (feas > *maxFeasibility) *maxFeasibility = feas;
284 if (cmpl > *maxComplementarity) *maxComplementarity = cmpl;
286 if ( CPUtimeCur > *maxCPUtime )
287 *maxCPUtime = CPUtimeCur;
290 *avgCPUtime += CPUtimeCur;
293 *avgCPUtime /= ((double)nQP);
321 real_t CPUtimeLimit = *maxCPUtime;
322 real_t CPUtimeCur = CPUtimeLimit;
345 *maxStationarity = 0.0;
346 *maxFeasibility = 0.0;
347 *maxComplementarity = 0.0;
356 for( k=0; k<nQP; ++k )
360 lbCur = &( lb[k*nV] );
361 ubCur = &( ub[k*nV] );
364 nWSRcur = maxAllowedNWSR;
365 CPUtimeCur = CPUtimeLimit;
368 if ( ( k == 0 ) || ( useHotstarts ==
BT_FALSE ) )
371 returnvalue =
QProblemB_initM( &qp,H,gCur,lbCur,ubCur, &nWSRcur,&CPUtimeCur );
391 if ( nWSRcur > *maxNWSR )
393 if (stat > *maxStationarity) *maxStationarity = stat;
394 if (feas > *maxFeasibility) *maxFeasibility = feas;
395 if (cmpl > *maxComplementarity) *maxComplementarity = cmpl;
397 if ( CPUtimeCur > *maxCPUtime )
398 *maxCPUtime = CPUtimeCur;
401 *avgCPUtime += CPUtimeCur;
404 *avgCPUtime /= ((double)nQP);
419 int nQP=0, nV=0, nC=0, nEC=0;
451 isSparse,useHotstarts,
452 options,maxAllowedNWSR,
453 maxNWSR,avgNWSR,maxCPUtime,avgCPUtime,
454 maxStationarity,maxFeasibility,maxComplementarity
464 isSparse,useHotstarts,
465 options,maxAllowedNWSR,
466 maxNWSR,avgNWSR,maxCPUtime,avgCPUtime,
467 maxStationarity,maxFeasibility,maxComplementarity
void QProblemBCON(QProblemB *_THIS, int _nV, HessianType _hessianType)
returnValue QProblem_getPrimalSolution(QProblem *_THIS, real_t *const xOpt)
returnValue QProblem_initM(QProblem *_THIS, DenseMatrix *_H, const real_t *const _g, DenseMatrix *_A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA, int *nWSR, real_t *const cputime)
returnValue solveOQPbenchmark(int nQP, int nV, int nC, int nEC, real_t *_H, const real_t *const g, real_t *_A, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA, BooleanType isSparse, BooleanType useHotstarts, const Options *options, int maxAllowedNWSR, real_t *maxNWSR, real_t *avgNWSR, real_t *maxCPUtime, real_t *avgCPUtime, real_t *maxStationarity, real_t *maxFeasibility, real_t *maxComplementarity)
BEGIN_NAMESPACE_QPOASES returnValue readOQPdimensions(const char *path, int *nQP, int *nV, int *nC, int *nEC)
Implements the online active set strategy for box-constrained QPs.
returnValue QProblemB_getDualSolution(QProblemB *_THIS, real_t *const yOpt)
returnValue qpOASES_getKktViolation(int nV, int 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 *const _stat, real_t *const feas, real_t *const cmpl)
Allows to pass back messages to the calling function.
#define THROWERROR(retval)
returnValue readOQPdata(const char *path, int *nQP, int *nV, int *nC, int *nEC, real_t *H, real_t *g, real_t *A, real_t *lb, real_t *ub, real_t *lbA, real_t *ubA, real_t *xOpt, real_t *yOpt, real_t *objOpt)
returnValue runOQPbenchmark(const char *path, BooleanType isSparse, BooleanType useHotstarts, const Options *options, int maxAllowedNWSR, real_t *maxNWSR, real_t *avgNWSR, real_t *maxCPUtime, real_t *avgCPUtime, real_t *maxStationarity, real_t *maxFeasibility, real_t *maxComplementarity)
returnValue qpOASES_readFromFileM(real_t *data, int nrow, int ncol, const char *datafilename)
void DenseMatrixCON(DenseMatrix *_THIS, int m, int n, int lD, real_t *v)
Interfaces matrix-vector operations tailored to general dense matrices.
returnValue qpOASES_getKktViolationSB(int nV, const real_t *const H, const real_t *const g, const real_t *const lb, const real_t *const ub, const real_t *const x, const real_t *const y, real_t *const _stat, real_t *const feas, real_t *const cmpl)
int_t QProblemB_hotstart(const real_t *const g, const real_t *const lb, const real_t *const ub, int_t *const nWSR, real_t *const cputime, real_t *const x, real_t *const y, real_t *const obj, int_t *const status)
Provides a generic way to set and pass user-specified options.
returnValue QProblemB_initM(QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime)
static returnValue QProblemB_setOptions(QProblemB *_THIS, Options _options)
#define END_NAMESPACE_QPOASES
returnValue QProblemB_getPrimalSolution(QProblemB *_THIS, real_t *const xOpt)
returnValue QProblem_getDualSolution(QProblem *_THIS, real_t *const yOpt)
returnValue solveOQPbenchmarkB(int nQP, int nV, real_t *_H, const real_t *const g, const real_t *const lb, const real_t *const ub, BooleanType isSparse, BooleanType useHotstarts, const Options *options, int maxAllowedNWSR, real_t *maxNWSR, real_t *avgNWSR, real_t *maxCPUtime, real_t *avgCPUtime, real_t *maxStationarity, real_t *maxFeasibility, real_t *maxComplementarity)
#define QPOASES_MAX_STRING_LENGTH
int_t QProblem_hotstart(const real_t *const g, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA, int_t *const nWSR, real_t *const cputime, real_t *const x, real_t *const y, real_t *const obj, int_t *const status)
#define BEGIN_NAMESPACE_QPOASES
Implements the online active set strategy for QPs with general constraints.
returnValue qpOASES_readFromFileI(int *data, int n, const char *datafilename)
void QProblemCON(QProblem *_THIS, int _nV, int _nC, HessianType _hessianType)
static returnValue QProblem_setOptions(QProblem *_THIS, Options _options)