#include <qpOASES_e/Bounds.h>
#include <qpOASES_e/Options.h>
#include <qpOASES_e/Matrices.h>
#include <qpOASES_e/Flipper.h>
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) |
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.
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).
number | Number of bound to be added to active set. |
B_status | Status of new active bound. |
updateCholesky | Flag indicating if Cholesky decomposition shall be updated. |
Definition at line 3342 of file QProblemB.c.
|
inlinestatic |
Applies Givens matrix determined by c and s (cf. computeGivens).
c | Cosine entry of Givens matrix. |
s | Sine entry of Givens matrix. |
nu | Further factor: s/(1+c). |
xold | Matrix entry to be transformed corresponding to the normalised entry of the original matrix. |
yold | Matrix entry to be transformed corresponding to the annihilated entry of the original matrix. |
xnew | Output: Transformed matrix entry corresponding to the normalised entry of the original matrix. |
ynew | Output: 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
lb | Vector of lower bounds |
ub | Vector 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.
b | Right hand side vector. |
transposed | Indicates if the transposed system shall be solved. |
a | Output: 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()".
b | Right hand side vector. |
transposed | Indicates if the transposed system shall be solved. |
removingBound | Indicates if function is called from "removeBound()". |
a | Output: Solution vector |
Definition at line 1559 of file QProblemB.c.
returnValue QProblemB_changeActiveSet | ( | QProblemB * | _THIS, |
int | BC_idx, | ||
SubjectToStatus | BC_status | ||
) |
Updates active set.
BC_idx | Index of blocking constraint. |
BC_status | Status 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.
Definition at line 1324 of file QProblemB.c.
|
inlinestatic |
Computes parameters for the Givens matrix G for which [x,y]*G = [z,0]
xold | Matrix entry to be normalised. |
yold | Matrix entry to be annihilated. |
xnew | Output: Normalised matrix entry. |
ynew | Output: Annihilated matrix entry. |
c | Output: Cosine entry of Givens matrix. |
s | Output: 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.
g_new | New gradient vector. |
lb_new | New lower bounds. |
ub_new | New upper bounds. |
delta_g | Output: Step direction of gradient vector. |
delta_lb | Output: Step direction of lower bounds. |
delta_ub | Output: Step direction of upper bounds. |
Delta_bB_isZero | Output: 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.
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.
delta_g | Step direction of gradient vector. |
delta_lb | Step direction of lower bounds. |
delta_ub | Step direction of upper bounds. |
Delta_bB_isZero | Indicates if active bounds are to be shifted. |
delta_xFX | Output: Primal homotopy step direction of fixed variables. |
delta_xFR | Output: Primal homotopy step direction of free variables. |
delta_yFX | Output: Dual homotopy step direction of fixed variables' multiplier. |
Definition at line 2900 of file QProblemB.c.
|
inlinestatic |
Returns current bounds object of the QP (deep copy).
Definition at line 1156 of file QProblemB.h.
|
inlinestatic |
Returns the current 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.
yOpt | Output: Dual solution vector (if QP has been solved). |
Definition at line 905 of file QProblemB.c.
|
inlinestatic |
Returns Hessian type flag (type is not determined due to _THIS call!).
Definition at line 1259 of file QProblemB.h.
|
inlinestatic |
Returns the number of free variables.
Definition at line 1181 of file QProblemB.h.
|
inlinestatic |
Returns the number of implicitly fixed variables.
Definition at line 1199 of file QProblemB.h.
|
inlinestatic |
Returns the number of fixed variables.
Definition at line 1190 of file QProblemB.h.
|
inlinestatic |
Returns the number of variables.
Definition at line 1172 of file QProblemB.h.
int QProblemB_getNZ | ( | QProblemB * | _THIS | ) |
Returns the dimension of null space.
Definition at line 797 of file QProblemB.c.
Returns the optimal objective function value.
Definition at line 807 of file QProblemB.c.
Returns the objective function value at an arbitrary point x.
_x | Point at which the objective function shall be evaluated. |
Definition at line 831 of file QProblemB.c.
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.
xOpt | Output: Primal solution vector (if QP has been solved). |
Definition at line 880 of file QProblemB.c.
|
inlinestatic |
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.
g_new | Final gradient. |
lb_new | Final lower variable bounds. |
ub_new | Final upper variable bounds. |
Definition at line 2001 of file QProblemB.c.
|
inlinestatic |
Returns status of the 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
workingSet | Output: 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
workingSetB | Output: 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
workingSetC | Output: 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!
g_new | Gradient of neighbouring QP to be solved. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: 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!
g_file | Name of file where gradient, of neighbouring QP to be solved, is stored. |
lb_file | Name 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_file | Name of file where upper bounds, of neighbouring QP to be solved, is stored. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: 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!
g_file | Name of file where gradient, of neighbouring QP to be solved, is stored. |
lb_file | Name 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_file | Name of file where upper bounds, of neighbouring QP to be solved, is stored. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time spent for QP solution (or to perform nWSR iterations). |
guessedBounds | Optimal 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!
g_new | Gradient of neighbouring QP to be solved. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time spent for QP solution (or to perform nWSR iterations). |
guessedBounds | Optimal 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
_H | Hessian matrix. If Hessian matrix is trivial, a NULL pointer can be passed. |
_g | Gradient vector. |
_lb | Lower bounds (on variables). If no lower bounds exist, a NULL pointer can be passed. |
_ub | Upper bounds (on variables). If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations. |
cputime | Input: 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
H_file | Name of file where Hessian matrix is stored. If Hessian matrix is trivial, a NULL pointer can be passed. |
g_file | Name of file where gradient vector is stored. |
lb_file | Name of file where lower bound vector. If no lower bounds exist, a NULL pointer can be passed. |
ub_file | Name of file where upper bound vector. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations. |
cputime | Input: 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:
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
H_file | Name of file where Hessian matrix is stored. If Hessian matrix is trivial, a NULL pointer can be passed. |
g_file | Name of file where gradient vector is stored. |
lb_file | Name of file where lower bound vector. If no lower bounds exist, a NULL pointer can be passed. |
ub_file | Name of file where upper bound vector. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP initialisation. Output: CPU time spent for QP initialisation. |
xOpt | Optimal primal solution vector. A NULL pointer can be passed. (If a null pointer is passed, the old primal solution is kept!) |
yOpt | Optimal dual solution vector. A NULL pointer can be passed. (If a null pointer is passed, the old dual solution is kept!) |
guessedBounds | Optimal working set of bounds for solution (xOpt,yOpt). (If a null pointer is passed, all bounds are assumed inactive!) |
R_file | Name 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
_H | Hessian matrix. |
_g | Gradient vector. |
_lb | Lower bounds (on variables). If no lower bounds exist, a NULL pointer can be passed. |
_ub | Upper bounds (on variables). If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations. |
cputime | Input: 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:
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
_H | Hessian matrix. |
_g | Gradient vector. |
_lb | Lower bounds (on variables). If no lower bounds exist, a NULL pointer can be passed. |
_ub | Upper bounds (on variables). If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP initialisation. Output: CPU time spent for QP initialisation. |
xOpt | Optimal primal solution vector. A NULL pointer can be passed. (If a null pointer is passed, the old primal solution is kept!) |
yOpt | Optimal dual solution vector. A NULL pointer can be passed. (If a null pointer is passed, the old dual solution is kept!) |
guessedBounds | Optimal working set of bounds for solution (xOpt,yOpt). (If a null pointer is passed, all bounds are assumed inactive!) |
_R | Pre-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:
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
_H | Hessian matrix. If Hessian matrix is trivial, a NULL pointer can be passed. |
_g | Gradient vector. |
_lb | Lower bounds (on variables). If no lower bounds exist, a NULL pointer can be passed. |
_ub | Upper bounds (on variables). If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP initialisation. Output: CPU time spent for QP initialisation. |
xOpt | Optimal primal solution vector. A NULL pointer can be passed. (If a null pointer is passed, the old primal solution is kept!) |
yOpt | Optimal dual solution vector. A NULL pointer can be passed. (If a null pointer is passed, the old dual solution is kept!) |
guessedBounds | Optimal working set of bounds for solution (xOpt,yOpt). (If a null pointer is passed, all bounds are assumed inactive!) |
_R | Pre-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.
|
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.
num | Numerator for performing the ratio test. |
den | Denominator for performing the ratio test. |
epsNum | Numerator tolerance. |
epsDen | Denominator tolerance. |
t | Input: 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.
cputime | Maximum CPU time allowed for QP solution. |
starttime | Start time of current QP solution. |
nWSR | Number of working set recalculations performed so far. |
Definition at line 1882 of file QProblemB.c.
|
inlinestatic |
Returns if the QP is infeasible.
Definition at line 1241 of file QProblemB.h.
|
inlinestatic |
Returns if the QProblem object is initialised.
Definition at line 1217 of file QProblemB.h.
|
inlinestatic |
Returns if the QP has been solved.
Definition at line 1229 of file QProblemB.h.
|
inlinestatic |
Returns if the QP is 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!).
g_file | Name of file where gradient, of neighbouring QP to be solved, is stored. |
lb_file | Name 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_file | Name 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_new | Output: Gradient of neighbouring QP to be solved. |
lb_new | Output: Lower bounds of neighbouring QP to be solved |
ub_new | Output: 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
xOpt | Optimal primal solution vector. If a NULL pointer is passed, all entries are assumed to be zero. |
yOpt | Optimal dual solution vector. If a NULL pointer is passed, all entries are assumed to be zero. |
guessedBounds | Guessed working set for solution (xOpt,yOpt). |
auxiliaryBounds | Input: 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
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.
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.
nIdx | Number of ratios to be checked. |
idxList | Array containing the indices of all ratios to be checked. |
subjectTo | Bound object corresponding to ratios to be checked. |
num | Array containing all numerators for performing the ratio test. |
den | Array containing all denominators for performing the ratio test. |
epsNum | Numerator tolerance. |
epsDen | Denominator tolerance. |
t | Output: Maximum possible step length along the homotopy path. |
BC_idx | Output: 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).
delta_g | Step direction of gradient. |
delta_lb | Step direction of lower bounds. |
delta_ub | Step direction of upper bounds. |
delta_xFX | Primal homotopy step direction of fixed variables. |
delta_xFR | Primal homotopy step direction of free variables. |
delta_yFX | Dual homotopy step direction of fixed variables' multiplier. |
BC_idx | Output: Index of blocking constraint. |
BC_status | Output: 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.
iter | Number of current iteration. |
BC_idx | Index of blocking bound. |
BC_status | Status of blocking bound. |
homotopyLength | Current homotopy distance. |
isFirstCall | Indicating 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.
Definition at line 1118 of file QProblemB.c.
returnValue QProblemB_printProperties | ( | QProblemB * | _THIS | ) |
Prints concise list of properties of the current QP.
Definition at line 981 of file QProblemB.c.
returnValue QProblemB_regulariseHessian | ( | QProblemB * | _THIS | ) |
Regularise Hessian matrix by adding a scaled identity matrix to it.
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).
number | Number of bound to be removed from active set. |
updateCholesky | Flag 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.
Definition at line 153 of file QProblemB.c.
|
inlinestatic |
Resets QP problem counter (to zero).
Definition at line 1334 of file QProblemB.h.
|
inlinestatic |
Changes gradient vector of the QP.
g_new | New gradient vector (with correct dimension!). |
Definition at line 1387 of file QProblemB.h.
|
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.
H_new | New dense Hessian matrix (with correct dimension!). |
Definition at line 1362 of file QProblemB.h.
|
inlinestatic |
Changes the print level.
_hessianType | New Hessian type. |
Definition at line 1268 of file QProblemB.h.
|
inlinestatic |
Sets Hessian matrix of the QP.
H_new | New 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).
returnvalue | Returnvalue to be tunneled. |
doThrowError | Flag forcing to throw an error. |
Definition at line 1847 of file QProblemB.c.
|
inlinestatic |
Changes lower bound vector of the QP.
lb_new | New lower bound vector (with correct dimension!). |
Definition at line 1406 of file QProblemB.h.
|
inlinestatic |
Changes single entry of lower bound vector of the QP.
number | Number of entry to be changed. |
value | New value for entry of lower bound vector. |
Definition at line 1432 of file QProblemB.h.
|
inlinestatic |
Overrides current options with given ones.
_options | New options. |
Definition at line 1299 of file QProblemB.h.
returnValue QProblemB_setPrintLevel | ( | QProblemB * | _THIS, |
PrintLevel | _printlevel | ||
) |
Changes the print level.
_printlevel | New print level. |
Definition at line 930 of file QProblemB.c.
|
inlinestatic |
Changes upper bound vector of the QP.
ub_new | New upper bound vector (with correct dimension!). |
Definition at line 1454 of file QProblemB.h.
|
inlinestatic |
Changes single entry of upper bound vector of the QP.
number | Number of entry to be changed. |
value | New 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
guessedBounds | Initial 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!).
useRelaxation | Flag 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!).
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.
xOpt | Optimal primal solution vector. If a NULL pointer is passed, all entries are set to zero. |
yOpt | Optimal 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!)
auxiliaryBounds | Working set for auxiliary QP. |
setupAfresh | Flag 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().
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.
_H | Hessian matrix. If Hessian matrix is trivial,a NULL pointer can be passed. |
_g | Gradient vector. |
_lb | Lower bounds (on variables). If no lower bounds exist, a NULL pointer can be passed. |
_ub | Upper 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.
H_file | Name 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_file | Name of file where gradient, of neighbouring QP to be solved, is stored. |
lb_file | Name 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_file | Name 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.
_H | Hessian matrix. |
_g | Gradient vector. |
_lb | Lower bounds (on variables). If no lower bounds exist, a NULL pointer can be passed. |
_ub | Upper 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.).
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.).
lb_new | New lower bounds. |
ub_new | New 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).
guessedBounds | Guessed 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!
xOpt | Optimal primal solution vector. |
yOpt | Optimal dual solution vector. |
guessedBounds | Optimal working set of bounds for solution (xOpt,yOpt). |
_R | Pre-computed (upper triangular) Cholesky factor of Hessian matrix. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: 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!
g_new | Gradient of neighbouring QP to be solved. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time spent for QP solution (or to perform nWSR iterations). |
nWSRperformed | Number 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. |
isFirstCall | Indicating 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!
g_new | Gradient of neighbouring QP to be solved. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time spent for QP solution (or to perform nWSR iterations). |
nWSRperformed | Number 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. |
isFirstCall | Indicating 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 | ||
) |
...
curFarBound | ... |
nRamp | ... |
lb_new | ... |
lb_new_far | ... |
ub_new | ... |
ub_new_far | ... |
Definition at line 2049 of file QProblemB.c.
|
inlinestatic |
Returns if the QP has been internally regularised.
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.
_nV | Number of variables. |
_hessianType | Type of Hessian matrix. |
Definition at line 45 of file QProblemB.c.
Definition at line 107 of file QProblemB.c.