37 #ifndef QPOASES_QPROBLEM_H 38 #define QPOASES_QPROBLEM_H 238 const char*
const H_file,
240 const char*
const g_file,
241 const char*
const A_file,
242 const char*
const lb_file,
244 const char*
const ub_file,
246 const char*
const lbA_file,
248 const char*
const ubA_file,
298 Bounds*
const guessedBounds,
348 Bounds*
const guessedBounds,
378 const char*
const H_file,
380 const char*
const g_file,
381 const char*
const A_file,
382 const char*
const lb_file,
384 const char*
const ub_file,
386 const char*
const lbA_file,
388 const char*
const ubA_file,
398 Bounds*
const guessedBounds,
400 const char*
const R_file
457 const char*
const g_file,
458 const char*
const lb_file,
460 const char*
const ub_file,
462 const char*
const lbA_file,
464 const char*
const ubA_file,
504 Bounds*
const guessedBounds,
532 const char*
const g_file,
533 const char*
const lb_file,
535 const char*
const ub_file,
537 const char*
const lbA_file,
539 const char*
const ubA_file,
545 Bounds*
const guessedBounds,
779 Bounds*
const guessedBounds,
902 Bounds*
const guessedBounds,
919 Bounds*
const auxiliaryBounds,
946 Bounds*
const auxiliaryBounds,
1049 const int*
const idxList,
1104 const real_t*
const delta_g,
1105 const real_t*
const delta_lbA,
1106 const real_t*
const delta_ubA,
1107 const real_t*
const delta_lb,
1108 const real_t*
const delta_ub,
1123 const real_t*
const delta_g,
1124 const real_t*
const delta_lbA,
1125 const real_t*
const delta_ubA,
1126 const real_t*
const delta_lb,
1127 const real_t*
const delta_ub,
1128 const real_t*
const delta_xFX,
1129 const real_t*
const delta_xFR,
1130 const real_t*
const delta_yAC,
1131 const real_t*
const delta_yFX,
1171 real_t*
const lb_new_far,
1173 real_t*
const ub_new_far,
1175 real_t*
const lbA_new_far,
1177 real_t*
const ubA_new_far
1185 real_t*
const lb_new_far,
1197 const int*
const idxList,
1220 Bounds*
const guessedBounds,
1229 Bounds*
const guessedBounds,
1246 const real_t*
const _lbA,
1268 const real_t*
const _lbA,
1283 const char*
const H_file,
1285 const char*
const g_file,
1286 const char*
const A_file,
1287 const char*
const lb_file,
1289 const char*
const ub_file,
1291 const char*
const lbA_file,
1293 const char*
const ubA_file
1303 const char*
const g_file,
1304 const char*
const lb_file,
1306 const char*
const ub_file,
1308 const char*
const lbA_file,
1310 const char*
const ubA_file,
1432 const real_t*
const yOpt,
1434 Bounds*
const guessedBounds,
1511 const char*
const H_file,
1513 const char*
const g_file,
1514 const char*
const lb_file,
1516 const char*
const ub_file
1526 const char*
const g_file,
1527 const char*
const lb_file,
1529 const char*
const ub_file,
1552 const real_t*
const cputime,
1634 const int*
const idxList,
1661 const char*
const filename
1668 const char*
const filename
1682 *_bounds = _THIS->
bounds;
1845 return _THIS->
count;
1915 memcpy( _THIS->
g,g_new,nV*
sizeof(
real_t) );
1934 memcpy( _THIS->
lb,lb_new,nV*
sizeof(
real_t) );
1939 for( i=0; i<nV; ++i )
1957 if ( ( number >= 0 ) && ( number < nV ) )
1959 _THIS->
lb[number] = value;
1982 memcpy( _THIS->
ub,ub_new,nV*
sizeof(
real_t) );
1987 for( i=0; i<nV; ++i )
2005 if ( ( number >= 0 ) && ( number < nV ) )
2007 _THIS->
ub[number] = value;
2030 if ( ( den >= epsDen ) && ( num >= epsNum ) )
2032 if ( num < (*t)*den )
2131 for( j=0; j<nC; ++j )
2133 _THIS->
Ax_u[j] = _THIS->
ubA[j] - _THIS->
Ax[j];
2134 _THIS->
Ax_l[j] = _THIS->
Ax[j] - _THIS->
lbA[j];
2159 memcpy( _THIS->
lbA,lbA_new,nC*
sizeof(
real_t) );
2164 for( i=0; i<nC; ++i )
2183 if ( ( number >= 0 ) && ( number < nC ) )
2185 _THIS->
lbA[number] = value;
2207 memcpy( _THIS->
ubA,ubA_new,nC*
sizeof(
real_t) );
2212 for( i=0; i<nC; ++i )
2231 if ( ( number >= 0 ) && ( number < nC ) )
2233 _THIS->
ubA[number] = value;
returnValue QProblem_backsolveR(QProblem *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
returnValue QProblem_printProperties(QProblem *_THIS)
returnValue QProblem_writeQpWorkspaceIntoMatFile(QProblem *_THIS, const char *const filename)
returnValue QProblem_writeQpDataIntoMatFile(QProblem *_THIS, const char *const filename)
returnValue QProblem_getPrimalSolution(QProblem *_THIS, real_t *const xOpt)
static int QProblem_getNIAC(QProblem *_THIS)
static int Constraints_getNC(Constraints *_THIS)
void QProblemCPY(QProblem *FROM, QProblem *TO)
returnValue QProblem_addBound_ensureLI(QProblem *_THIS, int number, SubjectToStatus B_status)
returnValue QProblem_setupQPdataM(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)
static Options QProblem_getOptions(QProblem *_THIS)
Interface for specifying user-defined evaluations of constraint products.
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 QProblem_obtainAuxiliaryWorkingSet(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, Bounds *auxiliaryBounds, Constraints *auxiliaryConstraints)
Manages working sets of constraints.
USING_NAMESPACE_ACADO typedef TaylorVariable< Interval > T
static int Bounds_getNFV(Bounds *_THIS)
returnValue QProblem_setInfeasibilityFlag(QProblem *_THIS, returnValue returnvalue, BooleanType doThrowError)
returnValue QProblemBCPY_updateFarBounds(QProblem *_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)
real_t DenseMatrix_getRowNorm(DenseMatrix *_THIS, int rNum, int type)
returnValue QProblem_loadQPvectorsFromFile(QProblem *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, real_t *const g_new, real_t *const lb_new, real_t *const ub_new, real_t *const lbA_new, real_t *const ubA_new)
returnValue QProblem_init(QProblem *_THIS, real_t *const _H, const real_t *const _g, 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, real_t *const cputime)
int QProblem_getNZ(QProblem *_THIS)
BooleanType QProblem_isCPUtimeLimitExceeded(QProblem *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
returnValue QProblem_regulariseHessian(QProblem *_THIS)
ConstraintProduct constraintProduct
returnValue QProblem_removeConstraint(QProblem *_THIS, int number, BooleanType updateCholesky, BooleanType allowFlipping, BooleanType ensureNZC)
returnValue QProblemBCPY_setupQPdataFromFile(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
Allows to pass back messages to the calling function.
static returnValue QProblem_resetCounter(QProblem *_THIS)
returnValue QProblem_hotstartW(QProblem *_THIS, 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, Bounds *const guessedBounds, Constraints *const guessedConstraints)
returnValue QProblem_setupInitialCholesky(QProblem *_THIS)
returnValue QProblem_addConstraint_checkLI(QProblem *_THIS, int number)
returnValue QProblem_setupAuxiliaryQP(QProblem *_THIS, Bounds *const guessedBounds, Constraints *const guessedConstraints)
static int QProblem_getNFR(QProblem *_THIS)
static returnValue QProblem_setLBAn(QProblem *_THIS, int number, real_t value)
#define THROWERROR(retval)
returnValue Options_ensureConsistency(Options *_THIS)
returnValue QProblem_initMW(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, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, const real_t *const _R)
returnValue QProblemBCPY_determineDataShift(QProblem *_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)
real_t QProblem_getObjValX(QProblem *_THIS, const real_t *const _x)
Auxiliary class for storing a copy of the current matrix factorisations.
static BooleanType QProblem_isInfeasible(QProblem *_THIS)
static int QProblem_getNAC(QProblem *_THIS)
returnValue QProblem_removeBound(QProblem *_THIS, int number, BooleanType updateCholesky, BooleanType allowFlipping, BooleanType ensureNZC)
returnValue QProblem_performStep(QProblem *_THIS, const real_t *const delta_g, const real_t *const delta_lbA, const real_t *const delta_ubA, 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_yAC, const real_t *const delta_yFX, int *BC_idx, SubjectToStatus *BC_status, BooleanType *BC_isBound)
static const real_t QPOASES_ZERO
returnValue QProblem_areBoundsConsistent(QProblem *_THIS, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA)
static BooleanType qpOASES_isZero(real_t x, real_t TOL)
static int Constraints_getNEC(Constraints *_THIS)
static int QProblem_getNV(QProblem *_THIS)
returnValue QProblemBCPY_loadQPvectorsFromFile(QProblem *_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 QProblem_setUBA(QProblem *_THIS, const real_t *const ubA_new)
returnValue QProblem_setupAuxiliaryQPgradient(QProblem *_THIS)
returnValue QProblem_determineDataShift(QProblem *_THIS, const real_t *const g_new, const real_t *const lbA_new, const real_t *const ubA_new, const real_t *const lb_new, const real_t *const ub_new, real_t *const delta_g, real_t *const delta_lbA, real_t *const delta_ubA, real_t *const delta_lb, real_t *const delta_ub, BooleanType *Delta_bC_isZero, BooleanType *Delta_bB_isZero)
returnValue QProblem_performDriftCorrection(QProblem *_THIS)
returnValue QProblem_solveCurrentEQP(QProblem *_THIS, 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)
static BooleanType QProblem_isInitialised(QProblem *_THIS)
returnValue QProblem_performRatioTestB(QProblem *_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 QProblem_setPrintLevel(QProblem *_THIS, PrintLevel _printlevel)
void DenseMatrixCON(DenseMatrix *_THIS, int m, int n, int lD, real_t *v)
returnValue QProblem_solveQP(QProblem *_THIS, 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, int nWSRperformed, BooleanType isFirstCall)
returnValue QProblem_addConstraint(QProblem *_THIS, int number, SubjectToStatus C_status, BooleanType updateCholesky, BooleanType ensureLI)
void ConstraintsCPY(Constraints *FROM, Constraints *TO)
returnValue QProblemBCPY_obtainAuxiliaryWorkingSet(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Bounds *auxiliaryBounds)
returnValue QProblem_ensureNonzeroCurvature(QProblem *_THIS, BooleanType removeBoundNotConstraint, int remIdx, BooleanType *exchangeHappened, BooleanType *addBoundNotConstraint, int *addIdx, SubjectToStatus *addStatus)
returnValue QProblem_dropInfeasibles(QProblem *_THIS, int BC_number, SubjectToStatus BC_status, BooleanType BC_isBound, real_t *xiB, real_t *xiC)
Interfaces matrix-vector operations tailored to general dense matrices.
returnValue QProblem_hotstart(QProblem *_THIS, 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)
static returnValue QProblem_setHessianType(QProblem *_THIS, HessianType _hessianType)
returnValue QProblem_setupQPdata(QProblem *_THIS, real_t *const _H, const real_t *const _g, real_t *const _A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA)
static returnValue QProblem_setG(QProblem *_THIS, const real_t *const g_new)
returnValue QProblemBCPY_setupQPdataM(QProblem *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
static int Bounds_getNFX(Bounds *_THIS)
Provides a generic way to set and pass user-specified options.
returnValue QProblem_addConstraint_ensureLI(QProblem *_THIS, int number, SubjectToStatus C_status)
real_t A[NCMAX_ALLOC *NVMAX]
real_t QProblem_getRelativeHomotopyLength(QProblem *_THIS, 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)
real_t QProblem_getObjVal(QProblem *_THIS)
static BooleanType QProblem_isSolved(QProblem *_THIS)
returnValue QProblem_initW(QProblem *_THIS, real_t *const _H, const real_t *const _g, 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, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, const real_t *const _R)
returnValue QProblem_solveInitialQP(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, const real_t *const _R, int *nWSR, real_t *const cputime)
static returnValue QProblem_setAM(QProblem *_THIS, DenseMatrix *A_new)
static int Bounds_getNV(Bounds *_THIS)
returnValue QProblem_addBound(QProblem *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky, BooleanType ensureLI)
static returnValue QProblem_setHM(QProblem *_THIS, DenseMatrix *H_new)
TabularOutput tabularOutput
static int QProblem_getNFX(QProblem *_THIS)
returnValue QProblem_initF(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime)
returnValue QProblem_setupTQfactorisation(QProblem *_THIS)
static int QProblem_getNFV(QProblem *_THIS)
returnValue QProblem_addBound_checkLI(QProblem *_THIS, int number)
returnValue QProblem_changeActiveSet(QProblem *_THIS, int BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound)
static returnValue QProblem_setH(QProblem *_THIS, real_t *const H_new)
static const real_t QPOASES_INFTY
static QProblemStatus QProblem_getStatus(QProblem *_THIS)
static int Bounds_getNFR(Bounds *_THIS)
returnValue QProblem_setupAuxiliaryQPbounds(QProblem *_THIS, Bounds *const auxiliaryBounds, Constraints *const auxiliaryConstraints, BooleanType useRelaxation)
returnValue QProblem_setupQPdataFromFile(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file)
#define END_NAMESPACE_QPOASES
returnValue QProblemBCPY_setupQPdata(QProblem *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
returnValue QProblem_hotstartF(QProblem *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime)
void OptionsCPY(Options *FROM, Options *TO)
static returnValue QProblem_setLB(QProblem *_THIS, const real_t *const lb_new)
returnValue QProblem_setConstraintProduct(QProblem *_THIS, ConstraintProduct _constraintProduct)
static int QProblem_getNC(QProblem *_THIS)
returnValue QProblem_getDualSolution(QProblem *_THIS, real_t *const yOpt)
static returnValue QProblem_setLBA(QProblem *_THIS, const real_t *const lbA_new)
static real_t * DenseMatrix_getVal(DenseMatrix *_THIS)
returnValue QProblem_getWorkingSetConstraints(QProblem *_THIS, real_t *workingSetC)
static returnValue QProblem_setUBn(QProblem *_THIS, int number, real_t value)
returnValue QProblem_backsolveRrem(QProblem *_THIS, const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a)
static BooleanType QProblem_isBlocking(QProblem *_THIS, real_t num, real_t den, real_t epsNum, real_t epsDen, real_t *t)
Stores internal information for tabular (debugging) output.
returnValue QProblem_performPlainRatioTest(QProblem *_THIS, int nIdx, const int *const idxList, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t *t, int *BC_idx)
returnValue QProblemBCPY_computeCholesky(QProblem *_THIS)
static returnValue QProblem_getConstraints(QProblem *_THIS, Constraints *_constraints)
static unsigned int QProblem_getCount(QProblem *_THIS)
returnValue QProblem_getWorkingSet(QProblem *_THIS, real_t *workingSet)
returnValue QProblem_setupSubjectToTypeNew(QProblem *_THIS, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new)
static HessianType QProblem_getHessianType(QProblem *_THIS)
real_t QProblemBCPY_getRelativeHomotopyLength(QProblem *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
returnValue QProblem_reset(QProblem *_THIS)
static PrintLevel QProblem_getPrintLevel(QProblem *_THIS)
static returnValue Constraints_setType(Constraints *_THIS, int i, SubjectToType value)
returnValue QProblem_setupAuxiliaryWorkingSet(QProblem *_THIS, Bounds *const auxiliaryBounds, Constraints *const auxiliaryConstraints, BooleanType setupAfresh)
returnValue QProblem_performRamping(QProblem *_THIS)
Manages working sets of bounds (= box constraints).
static int Constraints_getNIAC(Constraints *_THIS)
returnValue QProblem_setupSubjectToType(QProblem *_THIS)
returnValue QProblem_printIteration(QProblem *_THIS, int iter, int BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound, real_t homotopyLength, BooleanType isFirstCall)
#define BEGIN_NAMESPACE_QPOASES
returnValue QProblem_updateFarBounds(QProblem *_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, const real_t *const lbA_new, real_t *const lbA_new_far, const real_t *const ubA_new, real_t *const ubA_new_far)
returnValue DenseMatrix_times(DenseMatrix *_THIS, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD)
returnValue QProblem_computeProjectedCholesky(QProblem *_THIS)
static BooleanType QProblem_usingRegularisation(QProblem *_THIS)
static returnValue QProblem_setLBn(QProblem *_THIS, int number, real_t value)
returnValue QProblem_determineStepDirection(QProblem *_THIS, const real_t *const delta_g, const real_t *const delta_lbA, const real_t *const delta_ubA, const real_t *const delta_lb, const real_t *const delta_ub, BooleanType Delta_bC_isZero, BooleanType Delta_bB_isZero, real_t *const delta_xFX, real_t *const delta_xFR, real_t *const delta_yAC, real_t *const delta_yFX)
Implements the online active set strategy for QPs with general constraints.
static returnValue QProblem_setUB(QProblem *_THIS, const real_t *const ub_new)
returnValue QProblem_initFW(QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, const char *const R_file)
void QProblemCON(QProblem *_THIS, int _nV, int _nC, HessianType _hessianType)
BooleanType QProblem_shallRefactorise(QProblem *_THIS, Bounds *const guessedBounds, Constraints *const guessedConstraints)
returnValue QProblem_determineHessianType(QProblem *_THIS)
static returnValue QProblem_setUBAn(QProblem *_THIS, int number, real_t value)
returnValue QProblem_performRatioTestC(QProblem *_THIS, int nIdx, const int *const idxList, Constraints *const subjectTo, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t *t, int *BC_idx)
static returnValue QProblem_setA(QProblem *_THIS, real_t *const A_new)
static returnValue QProblem_getBounds(QProblem *_THIS, Bounds *_bounds)
static returnValue QProblem_setOptions(QProblem *_THIS, Options _options)
static int QProblem_getNEC(QProblem *_THIS)
returnValue QProblem_printOptions(QProblem *_THIS)
returnValue QProblem_hotstartFW(QProblem *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int *nWSR, real_t *const cputime, Bounds *const guessedBounds, Constraints *const guessedConstraints)
returnValue QProblem_backsolveT(QProblem *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
static int Constraints_getNAC(Constraints *_THIS)
returnValue QProblem_setupAuxiliaryQPsolution(QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt)
returnValue QProblem_getWorkingSetBounds(QProblem *_THIS, real_t *workingSetB)
static BooleanType QProblem_isUnbounded(QProblem *_THIS)
returnValue QProblem_solveRegularisedQP(QProblem *_THIS, 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, int nWSRperformed, BooleanType isFirstCall)