Functions
QProblem.c File Reference
#include <qpOASES_e/QProblem.h>
#include <qpOASES_e/QProblemB.h>
Include dependency graph for QProblem.c:

Go to the source code of this file.

Functions

returnValue QProblem_addBound (QProblem *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky, BooleanType ensureLI)
 
returnValue QProblem_addBound_checkLI (QProblem *_THIS, int number)
 
returnValue QProblem_addBound_ensureLI (QProblem *_THIS, int number, SubjectToStatus B_status)
 
returnValue QProblem_addConstraint (QProblem *_THIS, int number, SubjectToStatus C_status, BooleanType updateCholesky, BooleanType ensureLI)
 
returnValue QProblem_addConstraint_checkLI (QProblem *_THIS, int number)
 
returnValue QProblem_addConstraint_ensureLI (QProblem *_THIS, int number, SubjectToStatus C_status)
 
returnValue QProblem_areBoundsConsistent (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)
 
returnValue QProblem_backsolveR (QProblem *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
 
returnValue QProblem_backsolveRrem (QProblem *_THIS, const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a)
 
returnValue QProblem_backsolveT (QProblem *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
 
returnValue QProblem_changeActiveSet (QProblem *_THIS, int BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound)
 
returnValue QProblem_computeProjectedCholesky (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_determineHessianType (QProblem *_THIS)
 
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)
 
returnValue QProblem_dropInfeasibles (QProblem *_THIS, int BC_number, SubjectToStatus BC_status, BooleanType BC_isBound, real_t *xiB, real_t *xiC)
 
returnValue QProblem_ensureNonzeroCurvature (QProblem *_THIS, BooleanType removeBoundNotConstraint, int remIdx, BooleanType *exchangeHappened, BooleanType *addBoundNotConstraint, int *addIdx, SubjectToStatus *addStatus)
 
returnValue QProblem_getDualSolution (QProblem *_THIS, real_t *const yOpt)
 
int QProblem_getNZ (QProblem *_THIS)
 
real_t QProblem_getObjVal (QProblem *_THIS)
 
real_t QProblem_getObjValX (QProblem *_THIS, const real_t *const _x)
 
returnValue QProblem_getPrimalSolution (QProblem *_THIS, real_t *const xOpt)
 
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)
 
returnValue QProblem_getWorkingSet (QProblem *_THIS, real_t *workingSet)
 
returnValue QProblem_getWorkingSetBounds (QProblem *_THIS, real_t *workingSetB)
 
returnValue QProblem_getWorkingSetConstraints (QProblem *_THIS, real_t *workingSetC)
 
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)
 
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)
 
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_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_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)
 
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_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)
 
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_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 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)
 
BooleanType QProblem_isCPUtimeLimitExceeded (QProblem *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
 
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_obtainAuxiliaryWorkingSet (QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Constraints *const guessedConstraints, Bounds *auxiliaryBounds, Constraints *auxiliaryConstraints)
 
returnValue QProblem_performDriftCorrection (QProblem *_THIS)
 
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 QProblem_performRamping (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_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)
 
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)
 
returnValue QProblem_printIteration (QProblem *_THIS, int iter, int BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound, real_t homotopyLength, BooleanType isFirstCall)
 
returnValue QProblem_printOptions (QProblem *_THIS)
 
returnValue QProblem_printProperties (QProblem *_THIS)
 
returnValue QProblem_regulariseHessian (QProblem *_THIS)
 
returnValue QProblem_removeBound (QProblem *_THIS, int number, BooleanType updateCholesky, BooleanType allowFlipping, BooleanType ensureNZC)
 
returnValue QProblem_removeConstraint (QProblem *_THIS, int number, BooleanType updateCholesky, BooleanType allowFlipping, BooleanType ensureNZC)
 
returnValue QProblem_reset (QProblem *_THIS)
 
returnValue QProblem_setConstraintProduct (QProblem *_THIS, ConstraintProduct _constraintProduct)
 
returnValue QProblem_setInfeasibilityFlag (QProblem *_THIS, returnValue returnvalue, BooleanType doThrowError)
 
returnValue QProblem_setPrintLevel (QProblem *_THIS, PrintLevel _printLevel)
 
returnValue QProblem_setupAuxiliaryQP (QProblem *_THIS, Bounds *const guessedBounds, Constraints *const guessedConstraints)
 
returnValue QProblem_setupAuxiliaryQPbounds (QProblem *_THIS, Bounds *const auxiliaryBounds, Constraints *const auxiliaryConstraints, BooleanType useRelaxation)
 
returnValue QProblem_setupAuxiliaryQPgradient (QProblem *_THIS)
 
returnValue QProblem_setupAuxiliaryQPsolution (QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt)
 
returnValue QProblem_setupAuxiliaryWorkingSet (QProblem *_THIS, Bounds *const auxiliaryBounds, Constraints *const auxiliaryConstraints, BooleanType setupAfresh)
 
returnValue QProblem_setupInitialCholesky (QProblem *_THIS)
 
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)
 
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)
 
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)
 
returnValue QProblem_setupSubjectToType (QProblem *_THIS)
 
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)
 
returnValue QProblem_setupTQfactorisation (QProblem *_THIS)
 
BooleanType QProblem_shallRefactorise (QProblem *_THIS, Bounds *const guessedBounds, Constraints *const guessedConstraints)
 
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)
 
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)
 
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_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)
 
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 QProblemBCPY_computeCholesky (QProblem *_THIS)
 
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 QProblemBCPY_getRelativeHomotopyLength (QProblem *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
 
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)
 
returnValue QProblemBCPY_obtainAuxiliaryWorkingSet (QProblem *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Bounds *auxiliaryBounds)
 
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 QProblemBCPY_setupQPdataFromFile (QProblem *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
 
returnValue QProblemBCPY_setupQPdataM (QProblem *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
 
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)
 
BEGIN_NAMESPACE_QPOASES void QProblemCON (QProblem *_THIS, int _nV, int _nC, HessianType _hessianType)
 
void QProblemCPY (QProblem *FROM, QProblem *TO)
 

Detailed Description

Author
Hans Joachim Ferreau, Andreas Potschka, Christian Kirches (thanks to D. Kwame Minde Kufoalor)
Version
3.1embedded
Date
2007-2015

Implementation of the QProblem class which is able to use the newly developed online active set strategy for parametric quadratic programming.

Definition in file QProblem.c.

Function Documentation

returnValue QProblem_addBound ( QProblem _THIS,
int  number,
SubjectToStatus  B_status,
BooleanType  updateCholesky,
BooleanType  ensureLI 
)

Adds a bound to active set.

Returns
SUCCESSFUL_RETURN
RET_ADDBOUND_FAILED
RET_ADDBOUND_FAILED_INFEASIBILITY
RET_ENSURELI_FAILED
Parameters
numberNumber of bound to be added to active set.
B_statusStatus of new active bound.
updateCholeskyFlag indicating if Cholesky decomposition shall be updated.
ensureLIEnsure linear independence by exchange rules by default.

Definition at line 4107 of file QProblem.c.

returnValue QProblem_addBound_checkLI ( QProblem _THIS,
int  number 
)

Checks if new active bound to be added is linearly dependent from from row of the active constraints matrix.

Returns
RET_LINEARLY_DEPENDENT
RET_LINEARLY_INDEPENDENT
Parameters
numberNumber of bound to be added to active set.

Definition at line 4283 of file QProblem.c.

returnValue QProblem_addBound_ensureLI ( QProblem _THIS,
int  number,
SubjectToStatus  B_status 
)

Ensures linear independence of constraint matrix when a new bound is added. To _THIS end a bound or constraint is removed simultaneously if necessary.

Returns
SUCCESSFUL_RETURN
RET_LI_RESOLVED
RET_ENSURELI_FAILED
RET_ENSURELI_FAILED_TQ
RET_ENSURELI_FAILED_NOINDEX
RET_REMOVE_FROM_ACTIVESET
Parameters
numberNumber of bound to be added to active set.
B_statusStatus of new active bound.

Definition at line 4388 of file QProblem.c.

returnValue QProblem_addConstraint ( QProblem _THIS,
int  number,
SubjectToStatus  C_status,
BooleanType  updateCholesky,
BooleanType  ensureLI 
)

Adds a constraint to active set.

Returns
SUCCESSFUL_RETURN
RET_ADDCONSTRAINT_FAILED
RET_ADDCONSTRAINT_FAILED_INFEASIBILITY
RET_ENSURELI_FAILED
Parameters
numberNumber of constraint to be added to active set.
C_statusStatus of new active constraint.
updateCholeskyFlag indicating if Cholesky decomposition shall be updated.
ensureLIEnsure linear independence by exchange rules by default.

Definition at line 3639 of file QProblem.c.

returnValue QProblem_addConstraint_checkLI ( QProblem _THIS,
int  number 
)

Checks if new active constraint to be added is linearly dependent from from row of the active constraints matrix.

Returns
RET_LINEARLY_DEPENDENT
RET_LINEARLY_INDEPENDENT
RET_INDEXLIST_CORRUPTED
Parameters
numberNumber of constraint to be added to active set.

Definition at line 3803 of file QProblem.c.

returnValue QProblem_addConstraint_ensureLI ( QProblem _THIS,
int  number,
SubjectToStatus  C_status 
)

Ensures linear independence of constraint matrix when a new constraint is added. To _THIS end a bound or constraint is removed simultaneously if necessary.

Returns
SUCCESSFUL_RETURN
RET_LI_RESOLVED
RET_ENSURELI_FAILED
RET_ENSURELI_FAILED_TQ
RET_ENSURELI_FAILED_NOINDEX
RET_REMOVE_FROM_ACTIVESET
Parameters
numberNumber of constraint to be added to active set.
C_statusStatus of new active bound.

Definition at line 3925 of file QProblem.c.

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 
)

Decides if lower bounds are smaller than upper bounds

Returns
SUCCESSFUL_RETURN
RET_QP_INFEASIBLE
Parameters
lb_newVector of lower bounds
ub_newVector of upper bounds
lbA_newVector of lower constraints
ubA_newVector of upper constraints

Definition at line 7090 of file QProblem.c.

returnValue QProblem_backsolveR ( QProblem _THIS,
const real_t *const  b,
BooleanType  transposed,
real_t *const  a 
)

Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix.

Returns
SUCCESSFUL_RETURN
RET_DIV_BY_ZERO
Parameters
bRight hand side vector.
transposedIndicates if the transposed system shall be solved.
aOutput: Solution vector

Definition at line 1748 of file QProblem.c.

returnValue QProblem_backsolveRrem ( QProblem _THIS,
const real_t *const  b,
BooleanType  transposed,
BooleanType  removingBound,
real_t *const  a 
)

Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix.
Special variant for the case that _THIS function is called from within "removeBound()".

Returns
SUCCESSFUL_RETURN
RET_DIV_BY_ZERO
Parameters
bRight hand side vector.
transposedIndicates if the transposed system shall be solved.
removingBoundIndicates if function is called from "removeBound()".
aOutput: Solution vector

Definition at line 1760 of file QProblem.c.

returnValue QProblem_backsolveT ( QProblem _THIS,
const real_t *const  b,
BooleanType  transposed,
real_t *const  a 
)

Solves the system Ta = b or T^Ta = b where T is a reverse upper triangular matrix.

Returns
SUCCESSFUL_RETURN
RET_DIV_BY_ZERO
Parameters
bRight hand side vector.
transposedIndicates if the transposed system shall be solved.
aOutput: Solution vector

Definition at line 5280 of file QProblem.c.

returnValue QProblem_changeActiveSet ( QProblem _THIS,
int  BC_idx,
SubjectToStatus  BC_status,
BooleanType  BC_isBound 
)

Updates the active set.

Returns
SUCCESSFUL_RETURN
RET_REMOVE_FROM_ACTIVESET_FAILED
RET_ADD_TO_ACTIVESET_FAILED
Parameters
BC_idxIndex of blocking constraint.
BC_statusStatus of blocking constraint.
BC_isBoundIndicates if blocking constraint is a bound.

Definition at line 6055 of file QProblem.c.

returnValue QProblem_computeProjectedCholesky ( QProblem _THIS)

Computes the Cholesky decomposition of the projected Hessian (i.e. R^T*R = Z^T*H*Z). Note: If Hessian turns out not to be positive definite, the Hessian type is set to HST_SEMIDEF accordingly.

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_NOT_SPD
RET_INDEXLIST_CORRUPTED

Definition at line 2917 of file QProblem.c.

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 
)

Determines step direction of the shift of the QP data.

Returns
SUCCESSFUL_RETURN
Parameters
g_newNew gradient vector.
lbA_newNew lower constraints' bounds.
ubA_newNew upper constraints' bounds.
lb_newNew lower bounds.
ub_newNew upper bounds.
delta_gOutput: Step direction of gradient vector.
delta_lbAOutput: Step direction of lower constraints' bounds.
delta_ubAOutput: Step direction of upper constraints' bounds.
delta_lbOutput: Step direction of lower bounds.
delta_ubOutput: Step direction of upper bounds.
Delta_bC_isZeroOutput: Indicates if active constraints' bounds are to be shifted.
Delta_bB_isZeroOutput: Indicates if active bounds are to be shifted.

Definition at line 5333 of file QProblem.c.

returnValue QProblem_determineHessianType ( QProblem _THIS)

If Hessian type has been set by the user, nothing is done. Otherwise the Hessian type is set to HST_IDENTITY, HST_ZERO, or HST_POSDEF (default), respectively.

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_INDEFINITE

Definition at line 1421 of file QProblem.c.

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 
)

Determines step direction of the homotopy path.

Returns
SUCCESSFUL_RETURN
RET_STEPDIRECTION_FAILED_TQ
RET_STEPDIRECTION_FAILED_CHOLESKY
Parameters
delta_gStep direction of gradient vector.
delta_lbAStep direction of lower constraints' bounds.
delta_ubAStep direction of upper constraints' bounds.
delta_lbStep direction of lower bounds.
delta_ubStep direction of upper bounds.
Delta_bC_isZeroIndicates if active constraints' bounds are to be shifted.
Delta_bB_isZeroIndicates if active bounds are to be shifted.
delta_xFXOutput: Primal homotopy step direction of fixed variables.
delta_xFROutput: Primal homotopy step direction of free variables.
delta_yACOutput: Dual homotopy step direction of active constraints' multiplier.
delta_yFXOutput: Dual homotopy step direction of fixed variables' multiplier.

Definition at line 5397 of file QProblem.c.

returnValue QProblem_dropInfeasibles ( QProblem _THIS,
int  BC_number,
SubjectToStatus  BC_status,
BooleanType  BC_isBound,
real_t xiB,
real_t xiC 
)

Drops the blocking bound/constraint that led to infeasibility, or finds another bound/constraint to drop according to drop priorities.

Returns
SUCCESSFUL_RETURN
Parameters
BC_numberNumber of the bound or constraint to be added
BC_statusNew status of the bound or constraint to be added
BC_isBoundWhether a bound or a constraint is to be added

Definition at line 7121 of file QProblem.c.

returnValue QProblem_ensureNonzeroCurvature ( QProblem _THIS,
BooleanType  removeBoundNotConstraint,
int  remIdx,
BooleanType exchangeHappened,
BooleanType addBoundNotConstraint,
int *  addIdx,
SubjectToStatus addStatus 
)

Ensure non-zero curvature by primal jump.

Returns
SUCCESSFUL_RETURN
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
Parameters
removeBoundNotConstraintSubjectTo to be removed is a bound.
remIdxIndex of bound/constraint to be removed.
exchangeHappenedOutput: Exchange was necessary to ensure.
addBoundNotConstraintSubjectTo to be added is a bound.
addIdxIndex of bound/constraint to be added.
addStatusStatus of bound/constraint to be added.

Definition at line 5050 of file QProblem.c.

returnValue QProblem_getDualSolution ( QProblem _THIS,
real_t *const  yOpt 
)

Returns the dual solution vector (deep copy).

Returns
SUCCESSFUL_RETURN
RET_QP_NOT_SOLVED
Parameters
yOptOutput: Dual solution vector (if QP has been solved).

Definition at line 1058 of file QProblem.c.

int QProblem_getNZ ( QProblem _THIS)

Returns the dimension of null space.

Returns
Dimension of null space.

Definition at line 1048 of file QProblem.c.

real_t QProblem_getObjVal ( QProblem _THIS)

Returns the optimal objective function value.

Returns
finite value: Optimal objective function value (QP was solved)
+infinity: QP was not yet solved

Definition at line 1095 of file QProblem.c.

real_t QProblem_getObjValX ( QProblem _THIS,
const real_t *const  _x 
)

Returns the objective function value at an arbitrary point x.

Returns
Objective function value at point x
Parameters
_xPoint at which the objective function shall be evaluated.

Definition at line 1119 of file QProblem.c.

returnValue QProblem_getPrimalSolution ( QProblem _THIS,
real_t *const  xOpt 
)

Returns the primal solution vector.

Returns
SUCCESSFUL_RETURN
RET_QP_NOT_SOLVED
Parameters
xOptOutput: Primal solution vector (if QP has been solved).

Definition at line 1168 of file QProblem.c.

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 
)

Compute relative length of homotopy in data space for termination criterion.

Returns
Relative length in data space.
Parameters
g_newFinal gradient.
lb_newFinal lower variable bounds.
ub_newFinal upper variable bounds.
lbA_newFinal lower constraint bounds.
ubA_newFinal upper constraint bounds.

Definition at line 6142 of file QProblem.c.

returnValue QProblem_getWorkingSet ( QProblem _THIS,
real_t workingSet 
)

Writes a vector with the state of the working set

Returns
SUCCESSFUL_RETURN
Parameters
workingSetOutput: array containing state of the working set.

Definition at line 981 of file QProblem.c.

returnValue QProblem_getWorkingSetBounds ( QProblem _THIS,
real_t workingSetB 
)

Writes a vector with the state of the working set of bounds

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
Parameters
workingSetBOutput: array containing state of the working set of bounds.

Definition at line 1001 of file QProblem.c.

returnValue QProblem_getWorkingSetConstraints ( QProblem _THIS,
real_t workingSetC 
)

Writes a vector with the state of the working set of constraints

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
Parameters
workingSetCOutput: array containing state of the working set of constraints.

Definition at line 1022 of file QProblem.c.

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 
)

Solves an initialised QP sequence using the online active set strategy. QP solution is started from previous solution.

Note: This function internally calls solveQP/solveRegularisedQP for solving an initialised QP!

Returns
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_SHIFT_DETERMINATION_FAILED
RET_STEPDIRECTION_DETERMINATION_FAILED
RET_STEPLENGTH_DETERMINATION_FAILED
RET_HOMOTOPY_STEP_FAILED
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
Parameters
g_newGradient of neighbouring QP to be solved.
lb_newLower bounds of neighbouring QP to be solved.
If no lower bounds exist, a NULL pointer can be passed.
ub_newUpper bounds of neighbouring QP to be solved.
If no upper bounds exist, a NULL pointer can be passed.
lbA_newLower constraints' bounds of neighbouring QP to be solved.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_newUpper constraints' bounds of neighbouring QP to be solved.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).

Definition at line 578 of file QProblem.c.

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 
)

Solves an initialised QP sequence using the online active set strategy, where QP data is read from files. QP solution is started from previous solution.

Note: This function internally calls solveQP/solveRegularisedQP for solving an initialised QP!

Returns
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_SHIFT_DETERMINATION_FAILED
RET_STEPDIRECTION_DETERMINATION_FAILED
RET_STEPLENGTH_DETERMINATION_FAILED
RET_HOMOTOPY_STEP_FAILED
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
Parameters
g_fileName of file where gradient, of neighbouring QP to be solved, is stored.
lb_fileName of file where lower bounds, of neighbouring QP to be solved, is stored.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bounds, of neighbouring QP to be solved, is stored.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bounds, of neighbouring QP to be solved, is stored.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bounds, of neighbouring QP to be solved, is stored.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).

Definition at line 759 of file QProblem.c.

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 
)

Solves an initialised QP sequence using the online active set strategy, where QP data is read from files. By default, QP solution is started from previous solution. If a guess for the working set is provided, an initialised homotopy is performed.

Note: This function internally calls solveQP/solveRegularisedQP for solving an initialised QP!

Returns
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_SHIFT_DETERMINATION_FAILED
RET_STEPDIRECTION_DETERMINATION_FAILED
RET_STEPLENGTH_DETERMINATION_FAILED
RET_HOMOTOPY_STEP_FAILED
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
RET_SETUP_AUXILIARYQP_FAILED
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
Parameters
g_fileName of file where gradient, of neighbouring QP to be solved, is stored.
lb_fileName of file where lower bounds, of neighbouring QP to be solved, is stored.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bounds, of neighbouring QP to be solved, is stored.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bounds, of neighbouring QP to be solved, is stored.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bounds, of neighbouring QP to be solved, is stored.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of bounds is kept!)
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of constraints is kept!)

Definition at line 864 of file QProblem.c.

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 
)

Solves an initialised QP sequence using the online active set strategy. By default, QP solution is started from previous solution. If a guess for the working set is provided, an initialised homotopy is performed.

Note: This function internally calls solveQP/solveRegularisedQP for solving an initialised QP!

Returns
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_SHIFT_DETERMINATION_FAILED
RET_STEPDIRECTION_DETERMINATION_FAILED
RET_STEPLENGTH_DETERMINATION_FAILED
RET_HOMOTOPY_STEP_FAILED
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
RET_SETUP_AUXILIARYQP_FAILED
Parameters
g_newGradient of neighbouring QP to be solved.
lb_newLower bounds of neighbouring QP to be solved.
If no lower bounds exist, a NULL pointer can be passed.
ub_newUpper bounds of neighbouring QP to be solved.
If no upper bounds exist, a NULL pointer can be passed.
lbA_newLower constraints' bounds of neighbouring QP to be solved.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_newUpper constraints' bounds of neighbouring QP to be solved.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of bounds is kept!)
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of constraints is kept!)

Definition at line 801 of file QProblem.c.

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 
)

Initialises a QP problem with given QP data and tries to solve it using at most nWSR iterations.

Note: This function internally calls solveInitialQP for initialisation!

\return SUCCESSFUL_RETURN \n
            RET_INIT_FAILED \n
            RET_INIT_FAILED_CHOLESKY \n
            RET_INIT_FAILED_TQ \n
            RET_INIT_FAILED_HOTSTART \n
            RET_INIT_FAILED_INFEASIBILITY \n
            RET_INIT_FAILED_UNBOUNDEDNESS \n
            RET_MAX_NWSR_REACHED \n
            RET_INVALID_ARGUMENTS  
Parameters
_HHessian matrix.
If Hessian matrix is trivial, a NULL pointer can be passed.
_gGradient vector.
_AConstraint matrix.
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation (if pointer passed).

Definition at line 299 of file QProblem.c.

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 
)

Initialises a QP problem with given QP data to be read from files and tries to solve it using at most nWSR iterations.

Note: This function internally calls solveInitialQP for initialisation!

\return SUCCESSFUL_RETURN \n
            RET_INIT_FAILED \n
            RET_INIT_FAILED_CHOLESKY \n
            RET_INIT_FAILED_TQ \n
            RET_INIT_FAILED_HOTSTART \n
            RET_INIT_FAILED_INFEASIBILITY \n
            RET_INIT_FAILED_UNBOUNDEDNESS \n
            RET_MAX_NWSR_REACHED \n
            RET_UNABLE_TO_READ_FILE  
Parameters
H_fileName of file where Hessian matrix is stored.
If Hessian matrix is trivial, a NULL pointer can be passed.
g_fileName of file where gradient vector is stored.
A_fileName of file where constraint matrix is stored.
lb_fileName of file where lower bound vector.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bound vector.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bound vector.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation (if pointer passed).

Definition at line 327 of file QProblem.c.

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 
)

Initialises a QP problem with given QP data to be ream from files and tries to solve it using at most nWSR iterations. Depending on the parameter constellation it:

  1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB/gC empty (or all implicit equality bounds),
  2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB/gC by "clipping",
  3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB/gC from yOpt != 0,
  4. 0, 0, gB/gC: starts with xOpt = 0, yOpt = 0 and gB/gC,
  5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB/gC from yOpt != 0,
  6. xOpt, 0, gB/gC: starts with xOpt, yOpt = 0 and gB/gC,
  7. xOpt, yOpt, gB/gC: starts with xOpt, yOpt and gB/gC (assume them to be consistent!)

Note: This function internally calls solveInitialQP for initialisation!

\return SUCCESSFUL_RETURN \n
            RET_INIT_FAILED \n
            RET_INIT_FAILED_CHOLESKY \n
            RET_INIT_FAILED_TQ \n
            RET_INIT_FAILED_HOTSTART \n
            RET_INIT_FAILED_INFEASIBILITY \n
            RET_INIT_FAILED_UNBOUNDEDNESS \n
            RET_MAX_NWSR_REACHED \n
            RET_UNABLE_TO_READ_FILE  
Parameters
H_fileName of file where Hessian matrix is stored.
If Hessian matrix is trivial, a NULL pointer can be passed.
g_fileName of file where gradient vector is stored.
A_fileName of file where constraint matrix is stored.
lb_fileName of file where lower bound vector.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bound vector.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bound vector.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation.
xOptOptimal primal solution vector.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
R_filePre-computed (upper triangular) Cholesky factor of Hessian matrix. The Cholesky factor must be stored in a real_t array of size nV*nV in row-major format. Note: Only used if xOpt/yOpt and gB are NULL!
(If a null pointer is passed, Cholesky decomposition is computed internally!)

Definition at line 472 of file QProblem.c.

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 
)

Initialises a QP problem with given QP data and tries to solve it using at most nWSR iterations.

Note: This function internally calls solveInitialQP for initialisation!

\return SUCCESSFUL_RETURN \n
            RET_INIT_FAILED \n
            RET_INIT_FAILED_CHOLESKY \n
            RET_INIT_FAILED_TQ \n
            RET_INIT_FAILED_HOTSTART \n
            RET_INIT_FAILED_INFEASIBILITY \n
            RET_INIT_FAILED_UNBOUNDEDNESS \n
            RET_MAX_NWSR_REACHED \n
            RET_INVALID_ARGUMENTS  
Parameters
_HHessian matrix.
_gGradient vector.
_AConstraint matrix.
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation (if pointer passed).

Definition at line 256 of file QProblem.c.

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 
)

Initialises a QP problem with given QP data and tries to solve it using at most nWSR iterations. Depending on the parameter constellation it:

  1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB/gC empty (or all implicit equality bounds),
  2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB/gC by "clipping",
  3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB/gC from yOpt != 0,
  4. 0, 0, gB/gC: starts with xOpt = 0, yOpt = 0 and gB/gC,
  5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB/gC from yOpt != 0,
  6. xOpt, 0, gB/gC: starts with xOpt, yOpt = 0 and gB/gC,
  7. xOpt, yOpt, gB/gC: starts with xOpt, yOpt and gB/gC (assume them to be consistent!)

Note: This function internally calls solveInitialQP for initialisation!

\return SUCCESSFUL_RETURN \n
            RET_INIT_FAILED \n
            RET_INIT_FAILED_CHOLESKY \n
            RET_INIT_FAILED_TQ \n
            RET_INIT_FAILED_HOTSTART \n
            RET_INIT_FAILED_INFEASIBILITY \n
            RET_INIT_FAILED_UNBOUNDEDNESS \n
            RET_MAX_NWSR_REACHED \n
            RET_INVALID_ARGUMENTS  
Parameters
_HHessian matrix.
If Hessian matrix is trivial, a NULL pointer can be passed.
_gGradient vector.
_AConstraint matrix.
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation.
xOptOptimal primal solution vector.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
_RPre-computed (upper triangular) Cholesky factor of Hessian matrix. The Cholesky factor must be stored in a real_t array of size nV*nV in row-major format. Note: Only used if xOpt/yOpt and gB are NULL!
(If a null pointer is passed, Cholesky decomposition is computed internally!)

Definition at line 355 of file QProblem.c.

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 
)

Initialises a QP problem with given QP data and tries to solve it using at most nWSR iterations. Depending on the parameter constellation it:

  1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB/gC empty (or all implicit equality bounds),
  2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB/gC by "clipping",
  3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB/gC from yOpt != 0,
  4. 0, 0, gB/gC: starts with xOpt = 0, yOpt = 0 and gB/gC,
  5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB/gC from yOpt != 0,
  6. xOpt, 0, gB/gC: starts with xOpt, yOpt = 0 and gB/gC,
  7. xOpt, yOpt, gB/gC: starts with xOpt, yOpt and gB/gC (assume them to be consistent!)

Note: This function internally calls solveInitialQP for initialisation!

\return SUCCESSFUL_RETURN \n
            RET_INIT_FAILED \n
            RET_INIT_FAILED_CHOLESKY \n
            RET_INIT_FAILED_TQ \n
            RET_INIT_FAILED_HOTSTART \n
            RET_INIT_FAILED_INFEASIBILITY \n
            RET_INIT_FAILED_UNBOUNDEDNESS \n
            RET_MAX_NWSR_REACHED \n
            RET_INVALID_ARGUMENTS  
Parameters
_HHessian matrix.
If Hessian matrix is trivial, a NULL pointer can be passed.
_gGradient vector.
_AConstraint matrix.
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation.
xOptOptimal primal solution vector.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
_RPre-computed (upper triangular) Cholesky factor of Hessian matrix. The Cholesky factor must be stored in a real_t array of size nV*nV in row-major format. Note: Only used if xOpt/yOpt and gB are NULL!
(If a null pointer is passed, Cholesky decomposition is computed internally!)

Definition at line 414 of file QProblem.c.

BooleanType QProblem_isCPUtimeLimitExceeded ( QProblem _THIS,
const real_t *const  cputime,
real_t  starttime,
int  nWSR 
)

Determines if next QP iteration can be performed within given CPU time limit.

Returns
BT_TRUE: CPU time limit is exceeded, stop QP solution.
BT_FALSE: Sufficient CPU time for next QP iteration.
Parameters
cputimeMaximum CPU time allowed for QP solution.
starttimeStart time of current QP solution.
nWSRNumber of working set recalculations performed so far.

Definition at line 2064 of file QProblem.c.

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 
)

Loads new QP vectors from files (internal members are not affected!).

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
Parameters
g_fileName of file where gradient, of neighbouring QP to be solved, is stored.
lb_fileName of file where lower bounds, of neighbouring QP to be solved, is stored.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bounds, of neighbouring QP to be solved, is stored.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bounds, of neighbouring QP to be solved, is stored.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bounds, of neighbouring QP to be solved, is stored.
If no upper constraints' bounds exist, a NULL pointer can be passed.
g_newOutput: Gradient of neighbouring QP to be solved.
lb_newOutput: Lower bounds of neighbouring QP to be solved
ub_newOutput: Upper bounds of neighbouring QP to be solved
lbA_newOutput: Lower constraints' bounds of neighbouring QP to be solved
ubA_newOutput: Upper constraints' bounds of neighbouring QP to be solved

Definition at line 6785 of file QProblem.c.

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 
)

Obtains the desired working set for the auxiliary initial QP in accordance with the user specifications (assumes that member AX has already been initialised!)

Returns
SUCCESSFUL_RETURN
RET_OBTAINING_WORKINGSET_FAILED
RET_INVALID_ARGUMENTS
Parameters
xOptOptimal primal solution vector. If a NULL pointer is passed, all entries are assumed to be zero.
yOptOptimal dual solution vector. If a NULL pointer is passed, all entries are assumed to be zero.
guessedBoundsGuessed working set of bounds for solution (xOpt,yOpt).
guessedConstraintsGuessed working set for solution (xOpt,yOpt).
auxiliaryBoundsInput: Allocated bound object.
Ouput: Working set of constraints for auxiliary QP.
auxiliaryConstraintsInput: Allocated bound object.
Ouput: Working set for auxiliary QP.

Definition at line 3040 of file QProblem.c.

returnValue QProblem_performDriftCorrection ( QProblem _THIS)

Drift correction at end of each active set iteration

Returns
SUCCESSFUL_RETURN

Definition at line 6429 of file QProblem.c.

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 
)

Performs robustified ratio test yield the maximum possible step length along the homotopy path.

Returns
SUCCESSFUL_RETURN
Parameters
nIdxNumber of ratios to be checked.
idxListArray containing the indices of all ratios to be checked.
numArray containing all numerators for performing the ratio test.
denArray containing all denominators for performing the ratio test.
epsNumNumerator tolerance.
epsDenDenominator tolerance.
tOutput: Maximum possible step length along the homotopy path.
BC_idxOutput: Index of blocking constraint.

Definition at line 5027 of file QProblem.c.

returnValue QProblem_performRamping ( QProblem _THIS)

Ramping Strategy to avoid ties. Modifies homotopy start without changing current active set.

Returns
SUCCESSFUL_RETURN

Definition at line 6296 of file QProblem.c.

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 
)

Performs robustified ratio test yield the maximum possible step length along the homotopy path.

Returns
SUCCESSFUL_RETURN
Parameters
nIdxNumber of ratios to be checked.
idxListArray containing the indices of all ratios to be checked.
subjectToBound object corresponding to ratios to be checked.
numArray containing all numerators for performing the ratio test.
denArray containing all denominators for performing the ratio test.
epsNumNumerator tolerance.
epsDenDenominator tolerance.
tOutput: Maximum possible step length along the homotopy path.
BC_idxOutput: Index of blocking constraint.

Definition at line 2133 of file QProblem.c.

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 
)

Performs robustified ratio test yield the maximum possible step length along the homotopy path.

Returns
SUCCESSFUL_RETURN
Parameters
nIdxNumber of ratios to be checked.
idxListArray containing the indices of all ratios to be checked.
subjectToConstraint object corresponding to ratios to be checked.
numArray containing all numerators for performing the ratio test.
denArray containing all denominators for performing the ratio test.
epsNumNumerator tolerance.
epsDenDenominator tolerance.
tOutput: Maximum possible step length along the homotopy path.
BC_idxOutput: Index of blocking constraint.

Definition at line 6379 of file QProblem.c.

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 
)

Determines the maximum possible step length along the homotopy path and performs _THIS step (without changing working set).

Returns
SUCCESSFUL_RETURN
RET_ERROR_IN_CONSTRAINTPRODUCT
RET_QP_INFEASIBLE
Parameters
delta_gStep direction of gradient.
delta_lbAStep direction of lower constraints' bounds.
delta_ubAStep direction of upper constraints' bounds.
delta_lbStep direction of lower bounds.
delta_ubStep direction of upper bounds.
delta_xFXPrimal homotopy step direction of fixed variables.
delta_xFRPrimal homotopy step direction of free variables.
delta_yACDual homotopy step direction of active constraints' multiplier.
delta_yFXDual homotopy step direction of fixed variables' multiplier.
BC_idxOutput: Index of blocking constraint.
BC_statusOutput: Status of blocking constraint.
BC_isBoundOutput: Indicates if blocking constraint is a bound.

Definition at line 5741 of file QProblem.c.

returnValue QProblem_printIteration ( QProblem _THIS,
int  iter,
int  BC_idx,
SubjectToStatus  BC_status,
BooleanType  BC_isBound,
real_t  homotopyLength,
BooleanType  isFirstCall 
)

Prints concise information on the current iteration.

Returns
SUCCESSFUL_RETURN
Parameters
iterNumber of current iteration.
BC_idxIndex of blocking constraint.
BC_statusStatus of blocking constraint.
BC_isBoundIndicates if blocking constraint is a bound.
homotopyLengthCurrent homotopy distance.
isFirstCallIndicating whether this is the first call for current QP.

Definition at line 6844 of file QProblem.c.

returnValue QProblem_printOptions ( QProblem _THIS)

Prints a list of all options and their current values.

Returns
SUCCESSFUL_RETURN

Definition at line 1240 of file QProblem.c.

returnValue QProblem_printProperties ( QProblem _THIS)

Prints concise list of properties of the current QP.

Returns
SUCCESSFUL_RETURN

Definition at line 1249 of file QProblem.c.

returnValue QProblem_regulariseHessian ( QProblem _THIS)

Regularise Hessian matrix by adding a scaled identity matrix to it.

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_ALREADY_REGULARISED

Definition at line 2094 of file QProblem.c.

returnValue QProblem_removeBound ( QProblem _THIS,
int  number,
BooleanType  updateCholesky,
BooleanType  allowFlipping,
BooleanType  ensureNZC 
)

Removes a bounds from active set.

Returns
SUCCESSFUL_RETURN
RET_BOUND_NOT_ACTIVE
RET_HESSIAN_NOT_SPD
RET_REMOVEBOUND_FAILED
Parameters
numberNumber of bound to be removed from active set.
updateCholeskyFlag indicating if Cholesky decomposition shall be updated.
allowFlippingFlag indicating if flipping bounds are allowed.
ensureNZCFlag indicating if non-zero curvature is ensured by exchange rules.

Definition at line 4796 of file QProblem.c.

returnValue QProblem_removeConstraint ( QProblem _THIS,
int  number,
BooleanType  updateCholesky,
BooleanType  allowFlipping,
BooleanType  ensureNZC 
)

Removes a constraint from active set.

Returns
SUCCESSFUL_RETURN
RET_CONSTRAINT_NOT_ACTIVE
RET_REMOVECONSTRAINT_FAILED
RET_HESSIAN_NOT_SPD
Parameters
numberNumber of constraint to be removed from active set.
updateCholeskyFlag indicating if Cholesky decomposition shall be updated.
allowFlippingFlag indicating if flipping bounds are allowed.
ensureNZCFlag indicating if non-zero curvature is ensured by exchange rules.

Definition at line 4565 of file QProblem.c.

returnValue QProblem_reset ( QProblem _THIS)

Clears all data structures of QProblem except for QP data.

Returns
SUCCESSFUL_RETURN
RET_RESET_FAILED

Definition at line 202 of file QProblem.c.

returnValue QProblem_setConstraintProduct ( QProblem _THIS,
ConstraintProduct  _constraintProduct 
)

Defines user-defined routine for calculating the constraint product A*x

Returns
SUCCESSFUL_RETURN

Definition at line 1084 of file QProblem.c.

returnValue QProblem_setInfeasibilityFlag ( QProblem _THIS,
returnValue  returnvalue,
BooleanType  doThrowError 
)

Sets internal infeasibility flag and throws given error in case the far bound strategy is not enabled (as QP might actually not be infeasible in _THIS case).

Returns
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_ENSURELI_FAILED_CYCLING
RET_ENSURELI_FAILED_NOINDEX
Parameters
returnvalueReturnvalue to be tunneled.
doThrowErrorFlag forcing to throw an error.

Definition at line 2048 of file QProblem.c.

returnValue QProblem_setPrintLevel ( QProblem _THIS,
PrintLevel  _printlevel 
)

Changes the print level.

Returns
SUCCESSFUL_RETURN
Parameters
_printLevelNew print level.

Definition at line 1193 of file QProblem.c.

returnValue QProblem_setupAuxiliaryQP ( QProblem _THIS,
Bounds *const  guessedBounds,
Constraints *const  guessedConstraints 
)

Updates QP vectors, working sets and internal data structures in order to start from an optimal solution corresponding to initial guesses of the working set for bounds and constraints.

Returns
SUCCESSFUL_RETURN
RET_SETUP_AUXILIARYQP_FAILED
RET_INVALID_ARGUMENTS
Parameters
guessedBoundsInitial guess for working set of bounds.
guessedConstraintsInitial guess for working set of constraints.

Definition at line 6528 of file QProblem.c.

returnValue QProblem_setupAuxiliaryQPbounds ( QProblem _THIS,
Bounds *const  auxiliaryBounds,
Constraints *const  auxiliaryConstraints,
BooleanType  useRelaxation 
)

Sets up (constraints') bounds of the auxiliary initial QP for given optimal primal/dual solution and given initial working set (assumes that members X, Y and BOUNDS, CONSTRAINTS have already been initialised!).

Returns
SUCCESSFUL_RETURN
RET_UNKNOWN_BUG
Parameters
auxiliaryBoundsWorking set of bounds for auxiliary QP.
auxiliaryConstraintsWorking set of constraints for auxiliary QP.
useRelaxationFlag indicating if inactive (constraints') bounds shall be relaxed.

Definition at line 3489 of file QProblem.c.

returnValue QProblem_setupAuxiliaryQPgradient ( QProblem _THIS)

Sets up gradient of the auxiliary initial QP for given optimal primal/dual solution and given initial working set (assumes that members X, Y and BOUNDS, CONSTRAINTS have already been initialised!).

Returns
SUCCESSFUL_RETURN

Definition at line 3444 of file QProblem.c.

returnValue QProblem_setupAuxiliaryQPsolution ( QProblem _THIS,
const real_t *const  xOpt,
const real_t *const  yOpt 
)

Sets up the optimal primal/dual solution of the auxiliary initial QP.

Returns
SUCCESSFUL_RETURN
Parameters
xOptOptimal primal solution vector. If a NULL pointer is passed, all entries are set to zero.
yOptOptimal dual solution vector. If a NULL pointer is passed, all entries are set to zero.

Definition at line 3386 of file QProblem.c.

returnValue QProblem_setupAuxiliaryWorkingSet ( QProblem _THIS,
Bounds *const  auxiliaryBounds,
Constraints *const  auxiliaryConstraints,
BooleanType  setupAfresh 
)

Sets up bound and constraints data structures according to auxiliaryBounds/Constraints. (If the working set shall be setup afresh, make sure that bounds and constraints data structure have been resetted and the TQ factorisation has been initialised!)

Returns
SUCCESSFUL_RETURN
RET_SETUP_WORKINGSET_FAILED
RET_INVALID_ARGUMENTS
RET_UNKNOWN_BUG
Parameters
auxiliaryBoundsWorking set of bounds for auxiliary QP.
auxiliaryConstraintsWorking set of constraints for auxiliary QP.
setupAfreshFlag indicating if given working set shall be setup afresh or by updating the current one.

Definition at line 3192 of file QProblem.c.

returnValue QProblem_setupInitialCholesky ( QProblem _THIS)

Computes initial Cholesky decomposition of the projected Hessian making use of the function setupCholeskyDecomposition() or setupCholeskyDecompositionProjected().

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_NOT_SPD
RET_INDEXLIST_CORRUPTED

Definition at line 544 of file QProblem.c.

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 
)

Sets up dense internal QP data. If the current Hessian is trivial (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, memory for Hessian is allocated and it is set to the given one.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
RET_UNKNONW_BUG
Parameters
_HHessian matrix.
If Hessian matrix is trivial,a NULL pointer can be passed.
_gGradient vector.
_AConstraint matrix.
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.

Definition at line 6682 of file QProblem.c.

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 
)

Sets up internal QP data by loading it from files. If the current Hessian is trivial (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, memory for Hessian is allocated and it is set to the given one.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
RET_UNKNONW_BUG
Parameters
H_fileName of file where Hessian matrix, of neighbouring QP to be solved, is stored.
If Hessian matrix is trivial,a NULL pointer can be passed.
g_fileName of file where gradient, of neighbouring QP to be solved, is stored.
A_fileName of file where constraint matrix, of neighbouring QP to be solved, is stored.
lb_fileName of file where lower bounds, of neighbouring QP to be solved, is stored.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bounds, of neighbouring QP to be solved, is stored.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bounds, of neighbouring QP to be solved, is stored.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bounds, of neighbouring QP to be solved, is stored.
If no upper constraints' bounds exist, a NULL pointer can be passed.

Definition at line 6718 of file QProblem.c.

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 
)

Setups internal QP data.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
RET_UNKNONW_BUG
Parameters
_HHessian matrix.
If Hessian matrix is trivial,a NULL pointer can be passed.
_gGradient vector.
_AConstraint matrix.
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.

Definition at line 6656 of file QProblem.c.

returnValue QProblem_setupSubjectToType ( QProblem _THIS)

Determines type of existing constraints and bounds (i.e. implicitly fixed, unbounded etc.).

Returns
SUCCESSFUL_RETURN
RET_SETUPSUBJECTTOTYPE_FAILED

Definition at line 2760 of file QProblem.c.

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 
)

Determines type of new constraints and bounds (i.e. implicitly fixed, unbounded etc.).

Returns
SUCCESSFUL_RETURN
RET_SETUPSUBJECTTOTYPE_FAILED
Parameters
lb_newNew lower bounds.
ub_newNew upper bounds.
lbA_newNew lower constraints' bounds.
ubA_newNew upper constraints' bounds.

Definition at line 2769 of file QProblem.c.

returnValue QProblem_setupTQfactorisation ( QProblem _THIS)

Initialises TQ factorisation of A (i.e. A*Q = [0 T]) if NO constraint is active.

Returns
SUCCESSFUL_RETURN
RET_INDEXLIST_CORRUPTED

Definition at line 3011 of file QProblem.c.

BooleanType QProblem_shallRefactorise ( QProblem _THIS,
Bounds *const  guessedBounds,
Constraints *const  guessedConstraints 
)

Determines if it is more efficient to refactorise the matrices when hotstarting or not (i.e. better to update the existing factorisations).

Returns
BT_TRUE iff matrices shall be refactorised afresh
Parameters
guessedBoundsGuessed new working set of bounds.
guessedConstraintsGuessed new working set of constraints.

Definition at line 6617 of file QProblem.c.

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 
)

Solves using the current working set

Returns
SUCCESSFUL_RETURN
RET_STEPDIRECTION_FAILED_TQ
RET_STEPDIRECTION_FAILED_CHOLESKY
RET_INVALID_ARGUMENTS
Parameters
n_rhsNumber of consecutive right hand sides
g_inGradient of neighbouring QP to be solved.
lb_inLower bounds of neighbouring QP to be solved.
If no lower bounds exist, a NULL pointer can be passed.
ub_inUpper bounds of neighbouring QP to be solved.
If no upper bounds exist, a NULL pointer can be passed.
lbA_inLower constraints' bounds of neighbouring QP to be solved.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_inUpper constraints' bounds of neighbouring QP to be solved.
x_outOutput: Primal solution
y_outOutput: Dual solution

Definition at line 910 of file QProblem.c.

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 
)

Solves a QProblem whose QP data is assumed to be stored in the member variables. A guess for its primal/dual optimal solution vectors and the corresponding working sets of bounds and constraints can be provided. Note: This function is internally called by all init functions!

Returns
SUCCESSFUL_RETURN
RET_INIT_FAILED
RET_INIT_FAILED_CHOLESKY
RET_INIT_FAILED_TQ
RET_INIT_FAILED_HOTSTART
RET_INIT_FAILED_INFEASIBILITY
RET_INIT_FAILED_UNBOUNDEDNESS
RET_MAX_NWSR_REACHED
Parameters
xOptOptimal primal solution vector.
yOptOptimal dual solution vector.
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
_RPre-computed (upper triangular) Cholesky factor of Hessian matrix.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).

Definition at line 2232 of file QProblem.c.

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 
)

Solves QProblem using online active set strategy. Note: This function is internally called by all hotstart functions!

Returns
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_SHIFT_DETERMINATION_FAILED
RET_STEPDIRECTION_DETERMINATION_FAILED
RET_STEPLENGTH_DETERMINATION_FAILED
RET_HOMOTOPY_STEP_FAILED
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
Parameters
g_newGradient of neighbouring QP to be solved.
lb_newLower bounds of neighbouring QP to be solved.
If no lower bounds exist, a NULL pointer can be passed.
ub_newUpper bounds of neighbouring QP to be solved.
If no upper bounds exist, a NULL pointer can be passed.
lbA_newLower constraints' bounds of neighbouring QP to be solved.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_newUpper constraints' bounds of neighbouring QP to be solved.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).
nWSRperformedNumber of working set recalculations already performed to solve this QP within previous solveQP() calls. This number is always zero, except for successive calls from solveRegularisedQP() or when using the far bound strategy.
isFirstCallIndicating whether this is the first call for current QP.

Definition at line 2414 of file QProblem.c.

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 
)

Solves QProblem using online active set strategy. Note: This function is internally called by all hotstart functions!

Returns
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_SHIFT_DETERMINATION_FAILED
RET_STEPDIRECTION_DETERMINATION_FAILED
RET_STEPLENGTH_DETERMINATION_FAILED
RET_HOMOTOPY_STEP_FAILED
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
Parameters
g_newGradient of neighbouring QP to be solved.
lb_newLower bounds of neighbouring QP to be solved.
If no lower bounds exist, a NULL pointer can be passed.
ub_newUpper bounds of neighbouring QP to be solved.
If no upper bounds exist, a NULL pointer can be passed.
lbA_newLower constraints' bounds of neighbouring QP to be solved.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_newUpper constraints' bounds of neighbouring QP to be solved.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).
nWSRperformedNumber of working set recalculations already performed to solve this QP within previous solveRegularisedQP() calls. This number is always zero, except for successive calls when using the far bound strategy.
isFirstCallIndicating whether this is the first call for current QP.

Definition at line 2655 of file QProblem.c.

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 
)

...

Parameters
curFarBound...
nRamp...
lb_new...
lb_new_far...
ub_new...
ub_new_far...
lbA_new...
lbA_new_far...
ubA_new...
ubA_new_far...

Definition at line 6185 of file QProblem.c.

returnValue QProblemBCPY_computeCholesky ( QProblem _THIS)

Computes the Cholesky decomposition of the (simply projected) Hessian (i.e. R^T*R = Z^T*H*Z). It only works in the case where Z is a simple projection matrix! Note: If Hessian turns out not to be positive definite, the Hessian type is set to HST_SEMIDEF accordingly.

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_NOT_SPD
RET_INDEXLIST_CORRUPTED

Definition at line 1525 of file QProblem.c.

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 
)

Determines step direction of the shift of the QP data.

Returns
SUCCESSFUL_RETURN
Parameters
g_newNew gradient vector.
lb_newNew lower bounds.
ub_newNew upper bounds.
delta_gOutput: Step direction of gradient vector.
delta_lbOutput: Step direction of lower bounds.
delta_ubOutput: Step direction of upper bounds.
Delta_bB_isZeroOutput: Indicates if active bounds are to be shifted.

Definition at line 1818 of file QProblem.c.

real_t QProblemBCPY_getRelativeHomotopyLength ( QProblem _THIS,
const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new 
)

Compute relative length of homotopy in data space for termination criterion.

Returns
Relative length in data space.
Parameters
g_newFinal gradient.
lb_newFinal lower variable bounds.
ub_newFinal upper variable bounds.

Definition at line 2183 of file QProblem.c.

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 
)

Loads new QP vectors from files (internal members are not affected!).

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
Parameters
g_fileName of file where gradient, of neighbouring QP to be solved, is stored.
lb_fileName of file where lower bounds, of neighbouring QP to be solved, is stored.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bounds, of neighbouring QP to be solved, is stored.
If no upper bounds exist, a NULL pointer can be passed.
g_newOutput: Gradient of neighbouring QP to be solved.
lb_newOutput: Lower bounds of neighbouring QP to be solved
ub_newOutput: Upper bounds of neighbouring QP to be solved

Definition at line 1987 of file QProblem.c.

returnValue QProblemBCPY_obtainAuxiliaryWorkingSet ( QProblem _THIS,
const real_t *const  xOpt,
const real_t *const  yOpt,
Bounds *const  guessedBounds,
Bounds auxiliaryBounds 
)

Obtains the desired working set for the auxiliary initial QP in accordance with the user specifications

Returns
SUCCESSFUL_RETURN
RET_OBTAINING_WORKINGSET_FAILED
RET_INVALID_ARGUMENTS
Parameters
xOptOptimal primal solution vector. If a NULL pointer is passed, all entries are assumed to be zero.
yOptOptimal dual solution vector. If a NULL pointer is passed, all entries are assumed to be zero.
guessedBoundsGuessed working set for solution (xOpt,yOpt).
auxiliaryBoundsInput: Allocated bound object.
Output: Working set for auxiliary QP.

Definition at line 1604 of file QProblem.c.

returnValue QProblemBCPY_setupQPdata ( QProblem _THIS,
real_t *const  _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub 
)

Sets up internal QP data. If the current Hessian is trivial (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, memory for Hessian is allocated and it is set to the given one.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
RET_NO_HESSIAN_SPECIFIED
Parameters
_HHessian matrix.
If Hessian matrix is trivial,a NULL pointer can be passed.
_gGradient vector.
_lbLower bounds (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bounds (on variables).
If no upper bounds exist, a NULL pointer can be passed.

Definition at line 1895 of file QProblem.c.

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 
)

Sets up internal QP data by loading it from files. If the current Hessian is trivial (i.e. HST_ZERO or HST_IDENTITY) but a non-trivial one is given, memory for Hessian is allocated and it is set to the given one.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
RET_NO_HESSIAN_SPECIFIED
Parameters
H_fileName of file where Hessian matrix, of neighbouring QP to be solved, is stored.
If Hessian matrix is trivial,a NULL pointer can be passed.
g_fileName of file where gradient, of neighbouring QP to be solved, is stored.
lb_fileName of file where lower bounds, of neighbouring QP to be solved, is stored.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bounds, of neighbouring QP to be solved, is stored.
If no upper bounds exist, a NULL pointer can be passed.

Definition at line 1919 of file QProblem.c.

returnValue QProblemBCPY_setupQPdataM ( QProblem _THIS,
DenseMatrix _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub 
)

Sets up internal QP data.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
Parameters
_HHessian matrix.
_gGradient vector.
_lbLower bounds (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bounds (on variables).
If no upper bounds exist, a NULL pointer can be passed.

Definition at line 1881 of file QProblem.c.

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 
)

...

Parameters
curFarBound...
nRamp...
lb_new...
lb_new_far...
ub_new...
ub_new_far...

Definition at line 6245 of file QProblem.c.

BEGIN_NAMESPACE_QPOASES void QProblemCON ( QProblem _THIS,
int  _nV,
int  _nC,
HessianType  _hessianType 
)

Constructor which takes the QP dimension and Hessian type information. If the Hessian is the zero (i.e. HST_ZERO) or the identity matrix (i.e. HST_IDENTITY), respectively, no memory is allocated for it and a NULL pointer can be passed for it to the init() functions.

Parameters
_nVNumber of variables.
_nCNumber of constraints.
_hessianTypeType of Hessian matrix.

Definition at line 51 of file QProblem.c.

void QProblemCPY ( QProblem FROM,
QProblem TO 
)

Copies all members from given rhs object.

Returns
SUCCESSFUL_RETURN

Definition at line 132 of file QProblem.c.



acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:21