Classes | Functions
QProblemB.h File Reference
#include <qpOASES_e/Bounds.h>
#include <qpOASES_e/Options.h>
#include <qpOASES_e/Matrices.h>
#include <qpOASES_e/Flipper.h>
Include dependency graph for QProblemB.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  QProblemB
 Implements the online active set strategy for box-constrained QPs. More...
 

Functions

returnValue QProblemB_addBound (QProblemB *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky)
 
static void QProblemB_applyGivens (real_t c, real_t s, real_t nu, real_t xold, real_t yold, real_t *xnew, real_t *ynew)
 
returnValue QProblemB_areBoundsConsistent (QProblemB *_THIS, const real_t *const lb, const real_t *const ub)
 
returnValue QProblemB_backsolveR (QProblemB *_THIS, const real_t *const b, BooleanType transposed, real_t *const a)
 
returnValue QProblemB_backsolveRrem (QProblemB *_THIS, const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a)
 
returnValue QProblemB_changeActiveSet (QProblemB *_THIS, int BC_idx, SubjectToStatus BC_status)
 
returnValue QProblemB_computeCholesky (QProblemB *_THIS)
 
static void QProblemB_computeGivens (real_t xold, real_t yold, real_t *xnew, real_t *ynew, real_t *c, real_t *s)
 
returnValue QProblemB_determineDataShift (QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, real_t *const delta_g, real_t *const delta_lb, real_t *const delta_ub, BooleanType *Delta_bB_isZero)
 
returnValue QProblemB_determineHessianType (QProblemB *_THIS)
 
returnValue QProblemB_determineStepDirection (QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, BooleanType Delta_bB_isZero, real_t *const delta_xFX, real_t *const delta_xFR, real_t *const delta_yFX)
 
static returnValue QProblemB_getBounds (QProblemB *_THIS, Bounds *_bounds)
 
static unsigned int QProblemB_getCount (QProblemB *_THIS)
 
returnValue QProblemB_getDualSolution (QProblemB *_THIS, real_t *const yOpt)
 
static HessianType QProblemB_getHessianType (QProblemB *_THIS)
 
static int QProblemB_getNFR (QProblemB *_THIS)
 
static int QProblemB_getNFV (QProblemB *_THIS)
 
static int QProblemB_getNFX (QProblemB *_THIS)
 
static int QProblemB_getNV (QProblemB *_THIS)
 
int QProblemB_getNZ (QProblemB *_THIS)
 
real_t QProblemB_getObjVal (QProblemB *_THIS)
 
real_t QProblemB_getObjValX (QProblemB *_THIS, const real_t *const _x)
 
static Options QProblemB_getOptions (QProblemB *_THIS)
 
returnValue QProblemB_getPrimalSolution (QProblemB *_THIS, real_t *const xOpt)
 
static PrintLevel QProblemB_getPrintLevel (QProblemB *_THIS)
 
real_t QProblemB_getRelativeHomotopyLength (QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
 
static QProblemStatus QProblemB_getStatus (QProblemB *_THIS)
 
returnValue QProblemB_getWorkingSet (QProblemB *_THIS, real_t *workingSet)
 
returnValue QProblemB_getWorkingSetBounds (QProblemB *_THIS, real_t *workingSetB)
 
returnValue QProblemB_getWorkingSetConstraints (QProblemB *_THIS, real_t *workingSetC)
 
returnValue QProblemB_hotstart (QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime)
 
returnValue QProblemB_hotstartF (QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
 
returnValue QProblemB_hotstartFW (QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
 
returnValue QProblemB_hotstartW (QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, Bounds *const guessedBounds)
 
returnValue QProblemB_init (QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime)
 
returnValue QProblemB_initF (QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime)
 
returnValue QProblemB_initFW (QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const char *const R_file)
 
returnValue QProblemB_initM (QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime)
 
returnValue QProblemB_initMW (QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R)
 
returnValue QProblemB_initW (QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int *nWSR, real_t *const cputime, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R)
 
static BooleanType QProblemB_isBlocking (QProblemB *_THIS, real_t num, real_t den, real_t epsNum, real_t epsDen, real_t *t)
 
BooleanType QProblemB_isCPUtimeLimitExceeded (QProblemB *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
 
static BooleanType QProblemB_isInfeasible (QProblemB *_THIS)
 
static BooleanType QProblemB_isInitialised (QProblemB *_THIS)
 
static BooleanType QProblemB_isSolved (QProblemB *_THIS)
 
static BooleanType QProblemB_isUnbounded (QProblemB *_THIS)
 
returnValue QProblemB_loadQPvectorsFromFile (QProblemB *_THIS, const char *const g_file, const char *const lb_file, const char *const ub_file, real_t *const g_new, real_t *const lb_new, real_t *const ub_new)
 
returnValue QProblemB_obtainAuxiliaryWorkingSet (QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, Bounds *auxiliaryBounds)
 
returnValue QProblemB_performDriftCorrection (QProblemB *_THIS)
 
returnValue QProblemB_performRamping (QProblemB *_THIS)
 
returnValue QProblemB_performRatioTestB (QProblemB *_THIS, int nIdx, const int *const idxList, Bounds *const subjectTo, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t *t, int *BC_idx)
 
returnValue QProblemB_performStep (QProblemB *_THIS, const real_t *const delta_g, const real_t *const delta_lb, const real_t *const delta_ub, const real_t *const delta_xFX, const real_t *const delta_xFR, const real_t *const delta_yFX, int *BC_idx, SubjectToStatus *BC_status)
 
returnValue QProblemB_printIteration (QProblemB *_THIS, int iter, int BC_idx, SubjectToStatus BC_status, real_t homotopyLength, BooleanType isFirstCall)
 
returnValue QProblemB_printOptions (QProblemB *_THIS)
 
returnValue QProblemB_printProperties (QProblemB *_THIS)
 
returnValue QProblemB_regulariseHessian (QProblemB *_THIS)
 
returnValue QProblemB_removeBound (QProblemB *_THIS, int number, BooleanType updateCholesky)
 
returnValue QProblemB_reset (QProblemB *_THIS)
 
static returnValue QProblemB_resetCounter (QProblemB *_THIS)
 
static returnValue QProblemB_setG (QProblemB *_THIS, const real_t *const g_new)
 
static returnValue QProblemB_setH (QProblemB *_THIS, real_t *const H_new)
 
static returnValue QProblemB_setHessianType (QProblemB *_THIS, HessianType _hessianType)
 
static returnValue QProblemB_setHM (QProblemB *_THIS, DenseMatrix *H_new)
 
returnValue QProblemB_setInfeasibilityFlag (QProblemB *_THIS, returnValue returnvalue, BooleanType doThrowError)
 
static returnValue QProblemB_setLB (QProblemB *_THIS, const real_t *const lb_new)
 
static returnValue QProblemB_setLBn (QProblemB *_THIS, int number, real_t value)
 
static returnValue QProblemB_setOptions (QProblemB *_THIS, Options _options)
 
returnValue QProblemB_setPrintLevel (QProblemB *_THIS, PrintLevel _printlevel)
 
static returnValue QProblemB_setUB (QProblemB *_THIS, const real_t *const ub_new)
 
static returnValue QProblemB_setUBn (QProblemB *_THIS, int number, real_t value)
 
returnValue QProblemB_setupAuxiliaryQP (QProblemB *_THIS, Bounds *const guessedBounds)
 
returnValue QProblemB_setupAuxiliaryQPbounds (QProblemB *_THIS, BooleanType useRelaxation)
 
returnValue QProblemB_setupAuxiliaryQPgradient (QProblemB *_THIS)
 
returnValue QProblemB_setupAuxiliaryQPsolution (QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt)
 
returnValue QProblemB_setupAuxiliaryWorkingSet (QProblemB *_THIS, Bounds *const auxiliaryBounds, BooleanType setupAfresh)
 
returnValue QProblemB_setupInitialCholesky (QProblemB *_THIS)
 
returnValue QProblemB_setupQPdata (QProblemB *_THIS, real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
 
returnValue QProblemB_setupQPdataFromFile (QProblemB *_THIS, const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
 
returnValue QProblemB_setupQPdataM (QProblemB *_THIS, DenseMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
 
returnValue QProblemB_setupSubjectToType (QProblemB *_THIS)
 
returnValue QProblemB_setupSubjectToTypeNew (QProblemB *_THIS, const real_t *const lb_new, const real_t *const ub_new)
 
BooleanType QProblemB_shallRefactorise (QProblemB *_THIS, Bounds *const guessedBounds)
 
returnValue QProblemB_solveInitialQP (QProblemB *_THIS, const real_t *const xOpt, const real_t *const yOpt, Bounds *const guessedBounds, const real_t *const _R, int *nWSR, real_t *const cputime)
 
returnValue QProblemB_solveQP (QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)
 
returnValue QProblemB_solveRegularisedQP (QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int *nWSR, real_t *const cputime, int nWSRperformed, BooleanType isFirstCall)
 
returnValue QProblemB_updateFarBounds (QProblemB *_THIS, real_t curFarBound, int nRamp, const real_t *const lb_new, real_t *const lb_new_far, const real_t *const ub_new, real_t *const ub_new_far)
 
static BooleanType QProblemB_usingRegularisation (QProblemB *_THIS)
 
void QProblemBCON (QProblemB *_THIS, int _nV, HessianType _hessianType)
 
void QProblemBCPY (QProblemB *FROM, QProblemB *TO)
 

Detailed Description

Author
Hans Joachim Ferreau, Andreas Potschka, Christian Kirches
Version
3.1embedded
Date
2007-2015

Declaration of the QProblemB class which is able to use the newly developed online active set strategy for parametric quadratic programming for problems with (simple) bounds only.

Definition in file QProblemB.h.

Function Documentation

returnValue QProblemB_addBound ( QProblemB _THIS,
int  number,
SubjectToStatus  B_status,
BooleanType  updateCholesky 
)

Adds a bound to active set (specialised version for the case where no constraints exist).

Returns
SUCCESSFUL_RETURN
RET_ADDBOUND_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.

Definition at line 3342 of file QProblemB.c.

static void QProblemB_applyGivens ( real_t  c,
real_t  s,
real_t  nu,
real_t  xold,
real_t  yold,
real_t xnew,
real_t ynew 
)
inlinestatic

Applies Givens matrix determined by c and s (cf. computeGivens).

Returns
SUCCESSFUL_RETURN
Parameters
cCosine entry of Givens matrix.
sSine entry of Givens matrix.
nuFurther factor: s/(1+c).
xoldMatrix entry to be transformed corresponding to the normalised entry of the original matrix.
yoldMatrix entry to be transformed corresponding to the annihilated entry of the original matrix.
xnewOutput: Transformed matrix entry corresponding to the normalised entry of the original matrix.
ynewOutput: Transformed matrix entry corresponding to the annihilated entry of the original matrix.

Definition at line 1541 of file QProblemB.h.

returnValue QProblemB_areBoundsConsistent ( QProblemB _THIS,
const real_t *const  lb,
const real_t *const  ub 
)

Decides if lower bounds are smaller than upper bounds

Returns
SUCCESSFUL_RETURN
RET_QP_INFEASIBLE
Parameters
lbVector of lower bounds
ubVector of upper bounds

Definition at line 1863 of file QProblemB.c.

returnValue QProblemB_backsolveR ( QProblemB _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 1547 of file QProblemB.c.

returnValue QProblemB_backsolveRrem ( QProblemB _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 1559 of file QProblemB.c.

returnValue QProblemB_changeActiveSet ( QProblemB _THIS,
int  BC_idx,
SubjectToStatus  BC_status 
)

Updates 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.

Definition at line 3212 of file QProblemB.c.

returnValue QProblemB_computeCholesky ( QProblemB _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 1324 of file QProblemB.c.

static void QProblemB_computeGivens ( real_t  xold,
real_t  yold,
real_t xnew,
real_t ynew,
real_t c,
real_t s 
)
inlinestatic

Computes parameters for the Givens matrix G for which [x,y]*G = [z,0]

Returns
SUCCESSFUL_RETURN
Parameters
xoldMatrix entry to be normalised.
yoldMatrix entry to be annihilated.
xnewOutput: Normalised matrix entry.
ynewOutput: Annihilated matrix entry.
cOutput: Cosine entry of Givens matrix.
sOutput: Sine entry of Givens matrix.

Definition at line 1503 of file QProblemB.h.

returnValue QProblemB_determineDataShift ( QProblemB _THIS,
const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
real_t *const  delta_g,
real_t *const  delta_lb,
real_t *const  delta_ub,
BooleanType Delta_bB_isZero 
)

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 1617 of file QProblemB.c.

returnValue QProblemB_determineHessianType ( QProblemB _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 1135 of file QProblemB.c.

returnValue QProblemB_determineStepDirection ( QProblemB _THIS,
const real_t *const  delta_g,
const real_t *const  delta_lb,
const real_t *const  delta_ub,
BooleanType  Delta_bB_isZero,
real_t *const  delta_xFX,
real_t *const  delta_xFR,
real_t *const  delta_yFX 
)

Determines step direction of the homotopy path.

Returns
SUCCESSFUL_RETURN
RET_STEPDIRECTION_FAILED_CHOLESKY
Parameters
delta_gStep direction of gradient vector.
delta_lbStep direction of lower bounds.
delta_ubStep direction of upper bounds.
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_yFXOutput: Dual homotopy step direction of fixed variables' multiplier.

Definition at line 2900 of file QProblemB.c.

static returnValue QProblemB_getBounds ( QProblemB _THIS,
Bounds _bounds 
)
inlinestatic

Returns current bounds object of the QP (deep copy).

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
Parameters
_boundsOutput: Bounds object.

Definition at line 1156 of file QProblemB.h.

static unsigned int QProblemB_getCount ( QProblemB _THIS)
inlinestatic

Returns the current number of QP problems solved.

Returns
Number of QP problems solved.

Definition at line 1325 of file QProblemB.h.

returnValue QProblemB_getDualSolution ( QProblemB _THIS,
real_t *const  yOpt 
)

Returns the dual solution vector.

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

Definition at line 905 of file QProblemB.c.

static HessianType QProblemB_getHessianType ( QProblemB _THIS)
inlinestatic

Returns Hessian type flag (type is not determined due to _THIS call!).

Returns
Hessian type.

Definition at line 1259 of file QProblemB.h.

static int QProblemB_getNFR ( QProblemB _THIS)
inlinestatic

Returns the number of free variables.

Returns
Number of free variables.

Definition at line 1181 of file QProblemB.h.

static int QProblemB_getNFV ( QProblemB _THIS)
inlinestatic

Returns the number of implicitly fixed variables.

Returns
Number of implicitly fixed variables.

Definition at line 1199 of file QProblemB.h.

static int QProblemB_getNFX ( QProblemB _THIS)
inlinestatic

Returns the number of fixed variables.

Returns
Number of fixed variables.

Definition at line 1190 of file QProblemB.h.

static int QProblemB_getNV ( QProblemB _THIS)
inlinestatic

Returns the number of variables.

Returns
Number of variables.

Definition at line 1172 of file QProblemB.h.

int QProblemB_getNZ ( QProblemB _THIS)

Returns the dimension of null space.

Returns
Dimension of null space.

Definition at line 797 of file QProblemB.c.

real_t QProblemB_getObjVal ( QProblemB _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 807 of file QProblemB.c.

real_t QProblemB_getObjValX ( QProblemB _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 831 of file QProblemB.c.

static Options QProblemB_getOptions ( QProblemB _THIS)
inlinestatic

Returns current options struct.

Returns
Current options struct.

Definition at line 1290 of file QProblemB.h.

returnValue QProblemB_getPrimalSolution ( QProblemB _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 880 of file QProblemB.c.

static PrintLevel QProblemB_getPrintLevel ( QProblemB _THIS)
inlinestatic

Returns the print level.

Returns
Print level.

Definition at line 1315 of file QProblemB.h.

real_t QProblemB_getRelativeHomotopyLength ( QProblemB _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 2001 of file QProblemB.c.

static QProblemStatus QProblemB_getStatus ( QProblemB _THIS)
inlinestatic

Returns status of the solution process.

Returns
Status of solution process.

Definition at line 1208 of file QProblemB.h.

returnValue QProblemB_getWorkingSet ( QProblemB _THIS,
real_t workingSet 
)

Writes a vector with the state of the working set

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

Definition at line 754 of file QProblemB.c.

returnValue QProblemB_getWorkingSetBounds ( QProblemB _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 763 of file QProblemB.c.

returnValue QProblemB_getWorkingSetConstraints ( QProblemB _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 784 of file QProblemB.c.

returnValue QProblemB_hotstart ( QProblemB _THIS,
const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
int *  nWSR,
real_t *const  cputime 
)

Solves an initialised QP sequence using the online active set strategy. By default, 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.
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 471 of file QProblemB.c.

returnValue QProblemB_hotstartF ( QProblemB _THIS,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
int *  nWSR,
real_t *const  cputime 
)

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.
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 615 of file QProblemB.c.

returnValue QProblemB_hotstartFW ( QProblemB _THIS,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
int *  nWSR,
real_t *const  cputime,
Bounds *const  guessedBounds 
)

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_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
RET_SETUP_AUXILIARYQP_FAILED
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.
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 is kept!)

Definition at line 709 of file QProblemB.c.

returnValue QProblemB_hotstartW ( QProblemB _THIS,
const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
int *  nWSR,
real_t *const  cputime,
Bounds *const  guessedBounds 
)

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.
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 is kept!)

Definition at line 656 of file QProblemB.c.

returnValue QProblemB_init ( QProblemB _THIS,
real_t *const  _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub,
int *  nWSR,
real_t *const  cputime 
)

Initialises a simply bounded 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_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.
_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.
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 219 of file QProblemB.c.

returnValue QProblemB_initF ( QProblemB _THIS,
const char *const  H_file,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
int *  nWSR,
real_t *const  cputime 
)

Initialises a simply bounded QP problem with given QP data to be read from files and solves 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_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.
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.
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 246 of file QProblemB.c.

returnValue QProblemB_initFW ( QProblemB _THIS,
const char *const  H_file,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
int *  nWSR,
real_t *const  cputime,
const real_t *const  xOpt,
const real_t *const  yOpt,
Bounds *const  guessedBounds,
const char *const  R_file 
)

Initialises a simply bounded QP problem with given QP data to be read from files and solves it using at most nWSR iterations. Depending on the parameter constellation it:

  1. 0, 0, 0 : starts with xOpt = 0, yOpt = 0 and gB empty (or all implicit equality bounds),
  2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB by "clipping",
  3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB from yOpt != 0,
  4. 0, 0, gB: starts with xOpt = 0, yOpt = 0 and gB,
  5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB from yOpt != 0,
  6. xOpt, 0, gB: starts with xOpt, yOpt = 0 and gB,
  7. xOpt, yOpt, gB: starts with xOpt, yOpt and gB (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_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.
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.
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. A NULL pointer can be passed.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector. A NULL pointer can be passed.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, all bounds are assumed inactive!)
R_fileName of the file where a pre-computed (upper triangular) Cholesky factor of the Hessian matrix is stored.
(If a null pointer is passed, Cholesky decomposition is computed internally!)

Definition at line 371 of file QProblemB.c.

returnValue QProblemB_initM ( QProblemB _THIS,
DenseMatrix _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub,
int *  nWSR,
real_t *const  cputime 
)

Initialises a simply bounded 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_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.
_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.
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 192 of file QProblemB.c.

returnValue QProblemB_initMW ( QProblemB _THIS,
DenseMatrix _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub,
int *  nWSR,
real_t *const  cputime,
const real_t *const  xOpt,
const real_t *const  yOpt,
Bounds *const  guessedBounds,
const real_t *const  _R 
)

Initialises a simply bounded 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 empty (or all implicit equality bounds),
  2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB by "clipping",
  3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB from yOpt != 0,
  4. 0, 0, gB: starts with xOpt = 0, yOpt = 0 and gB,
  5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB from yOpt != 0,
  6. xOpt, 0, gB: starts with xOpt, yOpt = 0 and gB,
  7. xOpt, yOpt, gB: starts with xOpt, yOpt and gB (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_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.
_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.
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. A NULL pointer can be passed.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector. A NULL pointer can be passed.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, all bounds are assumed inactive!)
_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 273 of file QProblemB.c.

returnValue QProblemB_initW ( QProblemB _THIS,
real_t *const  _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub,
int *  nWSR,
real_t *const  cputime,
const real_t *const  xOpt,
const real_t *const  yOpt,
Bounds *const  guessedBounds,
const real_t *const  _R 
)

Initialises a simply bounded 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 empty (or all implicit equality bounds),
  2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB by "clipping",
  3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB from yOpt != 0,
  4. 0, 0, gB: starts with xOpt = 0, yOpt = 0 and gB,
  5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB from yOpt != 0,
  6. xOpt, 0, gB: starts with xOpt, yOpt = 0 and gB,
  7. xOpt, yOpt, gB: starts with xOpt, yOpt and gB (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_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.
_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.
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. A NULL pointer can be passed.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector. A NULL pointer can be passed.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, all bounds are assumed inactive!)
_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 322 of file QProblemB.c.

static BooleanType QProblemB_isBlocking ( QProblemB _THIS,
real_t  num,
real_t  den,
real_t  epsNum,
real_t  epsDen,
real_t t 
)
inlinestatic

Checks whether given ratio is blocking, i.e. limits the maximum step length along the homotopy path to a value lower than given one.

Returns
SUCCESSFUL_RETURN
Parameters
numNumerator for performing the ratio test.
denDenominator for performing the ratio test.
epsNumNumerator tolerance.
epsDenDenominator tolerance.
tInput: Current maximum step length along the homotopy path, Output: Updated maximum possible step length along the homotopy path.

Definition at line 1568 of file QProblemB.h.

BooleanType QProblemB_isCPUtimeLimitExceeded ( QProblemB _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 1882 of file QProblemB.c.

static BooleanType QProblemB_isInfeasible ( QProblemB _THIS)
inlinestatic

Returns if the QP is infeasible.

Returns
BT_TRUE: QP infeasible
BT_FALSE: QP feasible (or not known to be infeasible!)

Definition at line 1241 of file QProblemB.h.

static BooleanType QProblemB_isInitialised ( QProblemB _THIS)
inlinestatic

Returns if the QProblem object is initialised.

Returns
BT_TRUE: QProblemB initialised
BT_FALSE: QProblemB not initialised

Definition at line 1217 of file QProblemB.h.

static BooleanType QProblemB_isSolved ( QProblemB _THIS)
inlinestatic

Returns if the QP has been solved.

Returns
BT_TRUE: QProblemB solved
BT_FALSE: QProblemB not solved

Definition at line 1229 of file QProblemB.h.

static BooleanType QProblemB_isUnbounded ( QProblemB _THIS)
inlinestatic

Returns if the QP is unbounded.

Returns
BT_TRUE: QP unbounded
BT_FALSE: QP unbounded (or not known to be unbounded!)

Definition at line 1250 of file QProblemB.h.

returnValue QProblemB_loadQPvectorsFromFile ( QProblemB _THIS,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
real_t *const  g_new,
real_t *const  lb_new,
real_t *const  ub_new 
)

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 1786 of file QProblemB.c.

returnValue QProblemB_obtainAuxiliaryWorkingSet ( QProblemB _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.
Ouput: Working set for auxiliary QP.

Definition at line 1403 of file QProblemB.c.

returnValue QProblemB_performDriftCorrection ( QProblemB _THIS)

Drift correction at end of each active set iteration

Returns
SUCCESSFUL_RETURN

Definition at line 3263 of file QProblemB.c.

returnValue QProblemB_performRamping ( QProblemB _THIS)

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

Returns
SUCCESSFUL_RETURN

Definition at line 2101 of file QProblemB.c.

returnValue QProblemB_performRatioTestB ( QProblemB _THIS,
int  nIdx,
const int *const  idxList,
Bounds *const  subjectTo,
const real_t *const  num,
const real_t *const  den,
real_t  epsNum,
real_t  epsDen,
real_t t,
int *  BC_idx 
)

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 1951 of file QProblemB.c.

returnValue QProblemB_performStep ( QProblemB _THIS,
const real_t *const  delta_g,
const real_t *const  delta_lb,
const real_t *const  delta_ub,
const real_t *const  delta_xFX,
const real_t *const  delta_xFR,
const real_t *const  delta_yFX,
int *  BC_idx,
SubjectToStatus BC_status 
)

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

Returns
SUCCESSFUL_RETURN
RET_QP_INFEASIBLE
Parameters
delta_gStep direction of gradient.
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_yFXDual homotopy step direction of fixed variables' multiplier.
BC_idxOutput: Index of blocking constraint.
BC_statusOutput: Status of blocking constraint.

Definition at line 3069 of file QProblemB.c.

returnValue QProblemB_printIteration ( QProblemB _THIS,
int  iter,
int  BC_idx,
SubjectToStatus  BC_status,
real_t  homotopyLength,
BooleanType  isFirstCall 
)

Prints concise information on the current iteration.

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

Definition at line 3544 of file QProblemB.c.

returnValue QProblemB_printOptions ( QProblemB _THIS)

Prints a list of all options and their current values.

Returns
SUCCESSFUL_RETURN

Definition at line 1118 of file QProblemB.c.

returnValue QProblemB_printProperties ( QProblemB _THIS)

Prints concise list of properties of the current QP.

Returns
SUCCESSFUL_RETURN

Definition at line 981 of file QProblemB.c.

returnValue QProblemB_regulariseHessian ( QProblemB _THIS)

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

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_ALREADY_REGULARISED

Definition at line 1912 of file QProblemB.c.

returnValue QProblemB_removeBound ( QProblemB _THIS,
int  number,
BooleanType  updateCholesky 
)

Removes a bounds from active set (specialised version for the case where no constraints exist).

Returns
SUCCESSFUL_RETURN
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.

Definition at line 3412 of file QProblemB.c.

returnValue QProblemB_reset ( QProblemB _THIS)

Clears all data structures of QProblemB except for QP data.

Returns
SUCCESSFUL_RETURN
RET_RESET_FAILED

Definition at line 153 of file QProblemB.c.

static returnValue QProblemB_resetCounter ( QProblemB _THIS)
inlinestatic

Resets QP problem counter (to zero).

Returns
SUCCESSFUL_RETURN.

Definition at line 1334 of file QProblemB.h.

static returnValue QProblemB_setG ( QProblemB _THIS,
const real_t *const  g_new 
)
inlinestatic

Changes gradient vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
Parameters
g_newNew gradient vector (with correct dimension!).

Definition at line 1387 of file QProblemB.h.

static returnValue QProblemB_setH ( QProblemB _THIS,
real_t *const  H_new 
)
inlinestatic

Sets dense Hessian matrix of the QP. If a null pointer is passed and a) hessianType is HST_IDENTITY, nothing is done, b) hessianType is not HST_IDENTITY, Hessian matrix is set to zero.

Returns
SUCCESSFUL_RETURN
Parameters
H_newNew dense Hessian matrix (with correct dimension!).

Definition at line 1362 of file QProblemB.h.

static returnValue QProblemB_setHessianType ( QProblemB _THIS,
HessianType  _hessianType 
)
inlinestatic

Changes the print level.

Returns
SUCCESSFUL_RETURN
Parameters
_hessianTypeNew Hessian type.

Definition at line 1268 of file QProblemB.h.

static returnValue QProblemB_setHM ( QProblemB _THIS,
DenseMatrix H_new 
)
inlinestatic

Sets Hessian matrix of the QP.

Returns
SUCCESSFUL_RETURN
Parameters
H_newNew Hessian matrix.

Definition at line 1350 of file QProblemB.h.

returnValue QProblemB_setInfeasibilityFlag ( QProblemB _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 1847 of file QProblemB.c.

static returnValue QProblemB_setLB ( QProblemB _THIS,
const real_t *const  lb_new 
)
inlinestatic

Changes lower bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
Parameters
lb_newNew lower bound vector (with correct dimension!).

Definition at line 1406 of file QProblemB.h.

static returnValue QProblemB_setLBn ( QProblemB _THIS,
int  number,
real_t  value 
)
inlinestatic

Changes single entry of lower bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
RET_INDEX_OUT_OF_BOUNDS
Parameters
numberNumber of entry to be changed.
valueNew value for entry of lower bound vector.

Definition at line 1432 of file QProblemB.h.

static returnValue QProblemB_setOptions ( QProblemB _THIS,
Options  _options 
)
inlinestatic

Overrides current options with given ones.

Returns
SUCCESSFUL_RETURN
Parameters
_optionsNew options.

Definition at line 1299 of file QProblemB.h.

returnValue QProblemB_setPrintLevel ( QProblemB _THIS,
PrintLevel  _printlevel 
)

Changes the print level.

Returns
SUCCESSFUL_RETURN
Parameters
_printlevelNew print level.

Definition at line 930 of file QProblemB.c.

static returnValue QProblemB_setUB ( QProblemB _THIS,
const real_t *const  ub_new 
)
inlinestatic

Changes upper bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
Parameters
ub_newNew upper bound vector (with correct dimension!).

Definition at line 1454 of file QProblemB.h.

static returnValue QProblemB_setUBn ( QProblemB _THIS,
int  number,
real_t  value 
)
inlinestatic

Changes single entry of upper bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
RET_INDEX_OUT_OF_BOUNDS
Parameters
numberNumber of entry to be changed.
valueNew value for entry of upper bound vector.

Definition at line 1480 of file QProblemB.h.

returnValue QProblemB_setupAuxiliaryQP ( QProblemB _THIS,
Bounds *const  guessedBounds 
)

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

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

Definition at line 2838 of file QProblemB.c.

returnValue QProblemB_setupAuxiliaryQPbounds ( QProblemB _THIS,
BooleanType  useRelaxation 
)

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

Returns
SUCCESSFUL_RETURN
RET_UNKNOWN_BUG
Parameters
useRelaxationFlag indicating if inactive bounds shall be relaxed.

Definition at line 2770 of file QProblemB.c.

returnValue QProblemB_setupAuxiliaryQPgradient ( QProblemB _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 have already been (ialised!).

Returns
SUCCESSFUL_RETURN

Definition at line 2730 of file QProblemB.c.

returnValue QProblemB_setupAuxiliaryQPsolution ( QProblemB _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 2689 of file QProblemB.c.

returnValue QProblemB_setupAuxiliaryWorkingSet ( QProblemB _THIS,
Bounds *const  auxiliaryBounds,
BooleanType  setupAfresh 
)

Sets up bound data structure according to auxiliaryBounds. (If the working set shall be setup afresh, make sure that bounds data structure has been resetted!)

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

Definition at line 2620 of file QProblemB.c.

returnValue QProblemB_setupInitialCholesky ( QProblemB _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 435 of file QProblemB.c.

returnValue QProblemB_setupQPdata ( QProblemB _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 1694 of file QProblemB.c.

returnValue QProblemB_setupQPdataFromFile ( QProblemB _THIS,
const char *const  H_file,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file 
)

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 1718 of file QProblemB.c.

returnValue QProblemB_setupQPdataM ( QProblemB _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 1680 of file QProblemB.c.

returnValue QProblemB_setupSubjectToType ( QProblemB _THIS)

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

Returns
SUCCESSFUL_RETURN
RET_SETUPSUBJECTTOTYPE_FAILED

Definition at line 1239 of file QProblemB.c.

returnValue QProblemB_setupSubjectToTypeNew ( QProblemB _THIS,
const real_t *const  lb_new,
const real_t *const  ub_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.

Definition at line 1248 of file QProblemB.c.

BooleanType QProblemB_shallRefactorise ( QProblemB _THIS,
Bounds *const  guessedBounds 
)

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.

Definition at line 3314 of file QProblemB.c.

returnValue QProblemB_solveInitialQP ( QProblemB _THIS,
const real_t *const  xOpt,
const real_t *const  yOpt,
Bounds *const  guessedBounds,
const real_t *const  _R,
int *  nWSR,
real_t *const  cputime 
)

Solves a QProblemB whose QP data is assumed to be stored in the member variables. A guess for its primal/dual optimal solution vectors and the corresponding optimal working set 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_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).
_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 2145 of file QProblemB.c.

returnValue QProblemB_solveQP ( QProblemB _THIS,
const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
int *  nWSR,
real_t *const  cputime,
int  nWSRperformed,
BooleanType  isFirstCall 
)

Solves an initialised QProblemB 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.
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 2289 of file QProblemB.c.

returnValue QProblemB_solveRegularisedQP ( QProblemB _THIS,
const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
int *  nWSR,
real_t *const  cputime,
int  nWSRperformed,
BooleanType  isFirstCall 
)

Solves an initialised QProblemB 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.
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 2515 of file QProblemB.c.

returnValue QProblemB_updateFarBounds ( QProblemB _THIS,
real_t  curFarBound,
int  nRamp,
const real_t *const  lb_new,
real_t *const  lb_new_far,
const real_t *const  ub_new,
real_t *const  ub_new_far 
)

...

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

Definition at line 2049 of file QProblemB.c.

static BooleanType QProblemB_usingRegularisation ( QProblemB _THIS)
inlinestatic

Returns if the QP has been internally regularised.

Returns
BT_TRUE: Hessian is internally regularised for QP solution
BT_FALSE: No internal Hessian regularisation is used for QP solution

Definition at line 1278 of file QProblemB.h.

void QProblemBCON ( QProblemB _THIS,
int  _nV,
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.
_hessianTypeType of Hessian matrix.

Definition at line 45 of file QProblemB.c.

void QProblemBCPY ( QProblemB FROM,
QProblemB TO 
)

Definition at line 107 of file QProblemB.c.



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