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

Go to the source code of this file.

Functions

returnValue QProblemB_addBound (QProblemB *_THIS, int number, SubjectToStatus B_status, BooleanType updateCholesky)
 
returnValue QProblemB_areBoundsConsistent (QProblemB *_THIS, const real_t *const lb_new, const real_t *const ub_new)
 
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)
 
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)
 
returnValue QProblemB_getDualSolution (QProblemB *_THIS, real_t *const yOpt)
 
int QProblemB_getNZ (QProblemB *_THIS)
 
real_t QProblemB_getObjVal (QProblemB *_THIS)
 
real_t QProblemB_getObjValX (QProblemB *_THIS, const real_t *const _x)
 
returnValue QProblemB_getPrimalSolution (QProblemB *_THIS, real_t *const xOpt)
 
real_t QProblemB_getRelativeHomotopyLength (QProblemB *_THIS, const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
 
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)
 
BooleanType QProblemB_isCPUtimeLimitExceeded (QProblemB *_THIS, const real_t *const cputime, real_t starttime, int nWSR)
 
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)
 
returnValue QProblemB_setInfeasibilityFlag (QProblemB *_THIS, returnValue returnvalue, BooleanType doThrowError)
 
returnValue QProblemB_setPrintLevel (QProblemB *_THIS, PrintLevel _printLevel)
 
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)
 
BEGIN_NAMESPACE_QPOASES 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

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

Definition in file QProblemB.c.

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.

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
lb_newVector of lower bounds
ub_newVector 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

BEGIN_NAMESPACE_QPOASES 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