38 #ifndef QPOASES_QPROBLEMB_H 39 #define QPOASES_QPROBLEMB_H 194 const char*
const H_file,
196 const char*
const g_file,
197 const char*
const lb_file,
199 const char*
const ub_file,
242 Bounds*
const guessedBounds,
286 Bounds*
const guessedBounds,
315 const char*
const H_file,
317 const char*
const g_file,
318 const char*
const lb_file,
320 const char*
const ub_file,
330 Bounds*
const guessedBounds,
332 const char*
const R_file
385 const char*
const g_file,
386 const char*
const lb_file,
388 const char*
const ub_file,
424 Bounds*
const guessedBounds
450 const char*
const g_file,
451 const char*
const lb_file,
453 const char*
const ub_file,
459 Bounds*
const guessedBounds
668 Bounds*
const guessedBounds,
753 const char*
const H_file,
755 const char*
const g_file,
756 const char*
const lb_file,
758 const char*
const ub_file
768 const char*
const g_file,
769 const char*
const lb_file,
771 const char*
const ub_file,
794 const real_t*
const cputime,
920 const int*
const idxList,
957 Bounds*
const guessedBounds,
1032 Bounds*
const auxiliaryBounds,
1068 Bounds*
const guessedBounds
1075 const real_t*
const delta_g,
1076 const real_t*
const delta_lb,
1077 const real_t*
const delta_ub,
1090 const real_t*
const delta_g,
1091 const real_t*
const delta_lb,
1092 const real_t*
const delta_ub,
1118 Bounds*
const guessedBounds
1163 *_bounds = _THIS->
bounds;
1327 return _THIS->
count;
1397 memcpy( _THIS->
g,g_new,nV*
sizeof(
real_t) );
1416 memcpy( _THIS->
lb,lb_new,nV*
sizeof(
real_t) );
1421 for( i=0; i<nV; ++i )
1439 if ( ( number >= 0 ) && ( number < nV ) )
1441 _THIS->
lb[number] = value;
1464 memcpy( _THIS->
ub,ub_new,nV*
sizeof(
real_t) );
1469 for( i=0; i<nV; ++i )
1487 if ( ( number >= 0 ) && ( number < nV ) )
1489 _THIS->
ub[number] = value;
1520 if ( fabs( yold ) > mu )
1523 t = mu *
sqrt( (xold/mu)*(xold/mu) + (yold/mu)*(yold/mu) );
1545 #ifdef __USE_THREE_MULTS_GIVENS__ 1550 *xnew = xold*c + yold*s;
1551 *ynew = (*xnew+xold)*nu - yold;
1556 *xnew = c*xold + s*yold;
1557 *ynew = -s*xold + c*yold;
1576 if ( ( den >= epsDen ) && ( num >= epsNum ) )
1578 if ( num < (*t)*den )
void QProblemBCON(QProblemB *_THIS, int _nV, HessianType _hessianType)
returnValue QProblemB_getWorkingSetBounds(QProblemB *_THIS, real_t *workingSetB)
static int QProblemB_getNV(QProblemB *_THIS)
static QProblemStatus QProblemB_getStatus(QProblemB *_THIS)
IntermediateState sqrt(const Expression &arg)
returnValue QProblemB_determineDataShift(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, real_t *const delta_g, real_t *const delta_lb, real_t *const delta_ub, BooleanType *Delta_bB_isZero)
returnValue QProblemB_computeCholesky(QProblemB *_THIS)
returnValue QProblemB_setupAuxiliaryQPbounds(QProblemB *_THIS, BooleanType useRelaxation)
returnValue QProblemB_setupQPdata(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
static int Bounds_getNFV(Bounds *_THIS)
returnValue QProblemB_hotstart(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime)
Implements the online active set strategy for box-constrained QPs.
returnValue QProblemB_getDualSolution(QProblemB *_THIS, real_t *const yOpt)
returnValue QProblemB_setupInitialCholesky(QProblemB *_THIS)
static BooleanType QProblemB_isInfeasible(QProblemB *_THIS)
returnValue QProblemB_reset(QProblemB *_THIS)
static returnValue QProblemB_setLBn(QProblemB *_THIS, int number, real_t value)
returnValue QProblemB_backsolveRrem(QProblemB *_THIS, const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a)
returnValue QProblemB_getWorkingSet(QProblemB *_THIS, real_t *workingSet)
returnValue QProblemB_solveQP(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)
returnValue QProblemB_setupQPdataM(QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
real_t QProblemB_getRelativeHomotopyLength(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
static returnValue QProblemB_setHM(QProblemB *_THIS, DenseMatrix *H_new)
Allows to pass back messages to the calling function.
static int QProblemB_getNFX(QProblemB *_THIS)
returnValue QProblemB_setupAuxiliaryQP(QProblemB *_THIS, Bounds *const guessedBounds)
returnValue QProblemB_backsolveR(QProblemB *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
static BooleanType QProblemB_isUnbounded(QProblemB *_THIS)
real_t QProblemB_getObjVal(QProblemB *_THIS)
static returnValue QProblemB_setLB(QProblemB *_THIS, const real_t *const lb_new)
#define THROWERROR(retval)
returnValue Options_ensureConsistency(Options *_THIS)
returnValue QProblemB_setupAuxiliaryQPgradient(QProblemB *_THIS)
returnValue QProblemB_addBound(QProblemB *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky)
Auxiliary class for storing a copy of the current matrix factorisations.
returnValue QProblemB_hotstartW(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
returnValue QProblemB_hotstartFW(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
static const real_t QPOASES_ZERO
returnValue QProblemB_performRamping(QProblemB *_THIS)
returnValue QProblemB_changeActiveSet(QProblemB *_THIS, int BC_idx, SubjectToStatus BC_status)
static BooleanType QProblemB_isBlocking(QProblemB *_THIS, real_t num, real_t den, real_t epsNum, real_t epsDen, real_t *t)
static int QProblemB_getNFR(QProblemB *_THIS)
returnValue QProblemB_initFW(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const char *const R_file)
void QProblemBCPY(QProblemB *FROM, QProblemB *TO)
returnValue QProblemB_obtainAuxiliaryWorkingSet(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Bounds *auxiliaryBounds)
static BooleanType QProblemB_isSolved(QProblemB *_THIS)
static returnValue QProblemB_getBounds(QProblemB *_THIS, Bounds *_bounds)
returnValue QProblemB_setupSubjectToType(QProblemB *_THIS)
void DenseMatrixCON(DenseMatrix *_THIS, int m, int n, int lD, real_t *v)
static returnValue QProblemB_resetCounter(QProblemB *_THIS)
Interfaces matrix-vector operations tailored to general dense matrices.
static int QProblemB_getNFV(QProblemB *_THIS)
returnValue QProblemB_determineHessianType(QProblemB *_THIS)
static BooleanType QProblemB_usingRegularisation(QProblemB *_THIS)
returnValue QProblemB_determineStepDirection(QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, BooleanType Delta_bB_isZero, real_t *const delta_xFX, real_t *const delta_xFR, real_t *const delta_yFX)
returnValue QProblemB_setupAuxiliaryWorkingSet(QProblemB *_THIS, Bounds *const auxiliaryBounds, BooleanType setupAfresh)
static int Bounds_getNFX(Bounds *_THIS)
returnValue QProblemB_solveInitialQP(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R, int *nWSR, real_t *const cputime)
returnValue QProblemB_hotstartF(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
Provides a generic way to set and pass user-specified options.
static void QProblemB_applyGivens(real_t c, real_t s, real_t nu, real_t xold, real_t yold, real_t *xnew, real_t *ynew)
static returnValue QProblemB_setH(QProblemB *_THIS, real_t *const H_new)
static int Bounds_getNV(Bounds *_THIS)
real_t QProblemB_getObjValX(QProblemB *_THIS, const real_t *const _x)
returnValue QProblemB_init(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime)
returnValue QProblemB_performStep(QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, const real_t *const delta_xFX, const real_t *const delta_xFR, const real_t *const delta_yFX, int *BC_idx, SubjectToStatus *BC_status)
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)
returnValue QProblemB_setPrintLevel(QProblemB *_THIS, PrintLevel _printlevel)
static returnValue QProblemB_setOptions(QProblemB *_THIS, Options _options)
static const real_t QPOASES_INFTY
static int Bounds_getNFR(Bounds *_THIS)
#define END_NAMESPACE_QPOASES
void OptionsCPY(Options *FROM, Options *TO)
BooleanType QProblemB_isCPUtimeLimitExceeded(QProblemB *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
returnValue QProblemB_regulariseHessian(QProblemB *_THIS)
returnValue QProblemB_getPrimalSolution(QProblemB *_THIS, real_t *const xOpt)
returnValue QProblemB_initF(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
static real_t * DenseMatrix_getVal(DenseMatrix *_THIS)
static BooleanType QProblemB_isInitialised(QProblemB *_THIS)
BooleanType QProblemB_shallRefactorise(QProblemB *_THIS, Bounds *const guessedBounds)
returnValue QProblemB_initW(QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R)
static returnValue QProblemB_setHessianType(QProblemB *_THIS, HessianType _hessianType)
returnValue QProblemB_printOptions(QProblemB *_THIS)
returnValue QProblemB_printIteration(QProblemB *_THIS, int iter, int BC_idx, SubjectToStatus BC_status, real_t homotopyLength, BooleanType isFirstCall)
static HessianType QProblemB_getHessianType(QProblemB *_THIS)
Stores internal information for tabular (debugging) output.
returnValue QProblemB_printProperties(QProblemB *_THIS)
returnValue QProblemB_areBoundsConsistent(QProblemB *_THIS, const real_t *const lb, const real_t *const ub)
returnValue QProblemB_setupQPdataFromFile(QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
returnValue QProblemB_setInfeasibilityFlag(QProblemB *_THIS, returnValue returnvalue, BooleanType doThrowError)
static returnValue QProblemB_setG(QProblemB *_THIS, const real_t *const g_new)
returnValue QProblemB_getWorkingSetConstraints(QProblemB *_THIS, real_t *workingSetC)
static unsigned int QProblemB_getCount(QProblemB *_THIS)
returnValue QProblemB_setupAuxiliaryQPsolution(QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt)
returnValue QProblemB_performDriftCorrection(QProblemB *_THIS)
returnValue QProblemB_removeBound(QProblemB *_THIS, int number, BooleanType updateCholesky)
int QProblemB_getNZ(QProblemB *_THIS)
Manages working sets of bounds (= box constraints).
#define BEGIN_NAMESPACE_QPOASES
returnValue QProblemB_updateFarBounds(QProblemB *_THIS, real_t curFarBound, int nRamp, const real_t *const lb_new, real_t *const lb_new_far, const real_t *const ub_new, real_t *const ub_new_far)
static void QProblemB_computeGivens(real_t xold, real_t yold, real_t *xnew, real_t *ynew, real_t *c, real_t *s)
returnValue QProblemB_loadQPvectorsFromFile(QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, real_t *const g_new, real_t *const lb_new, real_t *const ub_new)
static returnValue QProblemB_setUBn(QProblemB *_THIS, int number, real_t value)
static returnValue QProblemB_setUB(QProblemB *_THIS, const real_t *const ub_new)
returnValue QProblemB_performRatioTestB(QProblemB *_THIS, int nIdx, const int *const idxList, Bounds *const subjectTo, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t *t, int *BC_idx)
returnValue QProblemB_initMW(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, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R)
static PrintLevel QProblemB_getPrintLevel(QProblemB *_THIS)
returnValue QProblemB_setupSubjectToTypeNew(QProblemB *_THIS, const real_t *const lb_new, const real_t *const ub_new)
returnValue QProblemB_solveRegularisedQP(QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)
static Options QProblemB_getOptions(QProblemB *_THIS)