qpOASES  3.2.1
An Implementation of the Online Active Set Strategy
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QProblem Class Reference

Implements the online active set strategy for QPs with general constraints. More...

#include <QProblem.hpp>

Inheritance diagram for QProblem:
QProblemB SQProblem SQProblemSchur

Public Member Functions

 QProblem ()
 
 QProblem (int_t _nV, int_t _nC, HessianType _hessianType=HST_UNKNOWN, BooleanType allocDenseMats=BT_TRUE)
 
 QProblem (const QProblem &rhs)
 
virtual ~QProblem ()
 
virtual QProblemoperator= (const QProblem &rhs)
 
virtual returnValue reset ()
 
returnValue init (SymmetricMatrix *_H, const real_t *const _g, Matrix *_A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA, int_t &nWSR, real_t *const cputime=0, const real_t *const xOpt=0, const real_t *const yOpt=0, const Bounds *const guessedBounds=0, const Constraints *const guessedConstraints=0, const real_t *const _R=0)
 
returnValue init (const real_t *const _H, const real_t *const _g, const real_t *const _A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA, int_t &nWSR, real_t *const cputime=0, const real_t *const xOpt=0, const real_t *const yOpt=0, const Bounds *const guessedBounds=0, const Constraints *const guessedConstraints=0, const real_t *const _R=0)
 
returnValue init (const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int_t &nWSR, real_t *const cputime=0, const real_t *const xOpt=0, const real_t *const yOpt=0, const Bounds *const guessedBounds=0, const Constraints *const guessedConstraints=0, const char *const R_file=0)
 
returnValue hotstart (const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new, int_t &nWSR, real_t *const cputime=0, const Bounds *const guessedBounds=0, const Constraints *const guessedConstraints=0)
 
returnValue hotstart (const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int_t &nWSR, real_t *const cputime=0, const Bounds *const guessedBounds=0, const Constraints *const guessedConstraints=0)
 
returnValue solveCurrentEQP (const int_t n_rhs, const real_t *g_in, const real_t *lb_in, const real_t *ub_in, const real_t *lbA_in, const real_t *ubA_in, real_t *x_out, real_t *y_out)
 
virtual returnValue getWorkingSet (real_t *workingSet)
 
virtual returnValue getWorkingSetBounds (real_t *workingSetB)
 
virtual returnValue getWorkingSetConstraints (real_t *workingSetC)
 
returnValue getConstraints (Constraints &_constraints) const
 
int_t getNC () const
 
int_t getNEC () const
 
int_t getNAC () const
 
int_t getNIAC () const
 
virtual int_t getNZ () const
 
virtual returnValue getDualSolution (real_t *const yOpt) const
 
returnValue setConstraintProduct (ConstraintProduct *const _constraintProduct)
 
virtual returnValue printProperties ()
 
returnValue getFreeVariablesFlags (BooleanType *varIsFree)
 
returnValue writeQpDataIntoMatFile (const char *const filename) const
 
returnValue writeQpWorkspaceIntoMatFile (const char *const filename)
 
returnValue init (SymmetricMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int_t &nWSR, real_t *const cputime=0, const real_t *const xOpt=0, const real_t *const yOpt=0, const Bounds *const guessedBounds=0, const real_t *const _R=0)
 
returnValue init (const real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub, int_t &nWSR, real_t *const cputime=0, const real_t *const xOpt=0, const real_t *const yOpt=0, const Bounds *const guessedBounds=0, const real_t *const _R=0)
 
returnValue init (const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file, int_t &nWSR, real_t *const cputime=0, const real_t *const xOpt=0, const real_t *const yOpt=0, const Bounds *const guessedBounds=0, const char *const R_file=0)
 
returnValue hotstart (const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, int_t &nWSR, real_t *const cputime=0, const Bounds *const guessedBounds=0)
 
returnValue hotstart (const char *const g_file, const char *const lb_file, const char *const ub_file, int_t &nWSR, real_t *const cputime=0, const Bounds *const guessedBounds=0)
 
returnValue getBounds (Bounds &_bounds) const
 
int_t getNV () const
 
int_t getNFR () const
 
int_t getNFX () const
 
int_t getNFV () const
 
real_t getObjVal () const
 
real_t getObjVal (const real_t *const _x) const
 
returnValue getPrimalSolution (real_t *const xOpt) const
 
QProblemStatus getStatus () const
 
BooleanType isInitialised () const
 
BooleanType isSolved () const
 
BooleanType isInfeasible () const
 
BooleanType isUnbounded () const
 
HessianType getHessianType () const
 
returnValue setHessianType (HessianType _hessianType)
 
BooleanType usingRegularisation () const
 
Options getOptions () const
 
returnValue setOptions (const Options &_options)
 
PrintLevel getPrintLevel () const
 
returnValue setPrintLevel (PrintLevel _printlevel)
 
uint_t getCount () const
 
returnValue resetCounter ()
 
returnValue printOptions () const
 

Protected Member Functions

returnValue clear ()
 
returnValue copy (const QProblem &rhs)
 
returnValue solveInitialQP (const real_t *const xOpt, const real_t *const yOpt, const Bounds *const guessedBounds, const Constraints *const guessedConstraints, const real_t *const _R, int_t &nWSR, real_t *const cputime)
 
returnValue solveQP (const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new, int_t &nWSR, real_t *const cputime, int_t nWSRperformed=0, BooleanType isFirstCall=BT_TRUE)
 
returnValue solveRegularisedQP (const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new, int_t &nWSR, real_t *const cputime, int_t nWSRperformed=0, BooleanType isFirstCall=BT_TRUE)
 
virtual returnValue updateActivitiesForHotstart (const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new)
 
virtual returnValue setupSubjectToType ()
 
virtual returnValue setupSubjectToType (const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new)
 
virtual returnValue computeProjectedCholesky ()
 
virtual returnValue setupInitialCholesky ()
 
virtual returnValue setupTQfactorisation ()
 
returnValue obtainAuxiliaryWorkingSet (const real_t *const xOpt, const real_t *const yOpt, const Bounds *const guessedBounds, const Constraints *const guessedConstraints, Bounds *auxiliaryBounds, Constraints *auxiliaryConstraints) const
 
virtual returnValue setupAuxiliaryWorkingSet (const Bounds *const auxiliaryBounds, const Constraints *const auxiliaryConstraints, BooleanType setupAfresh)
 
returnValue setupAuxiliaryQPsolution (const real_t *const xOpt, const real_t *const yOpt)
 
returnValue setupAuxiliaryQPgradient ()
 
returnValue setupAuxiliaryQPbounds (const Bounds *const auxiliaryBounds, const Constraints *const auxiliaryConstraints, BooleanType useRelaxation)
 
virtual returnValue addConstraint (int_t number, SubjectToStatus C_status, BooleanType updateCholesky, BooleanType ensureLI=BT_TRUE)
 
virtual returnValue addConstraint_checkLI (int_t number)
 
virtual returnValue addConstraint_ensureLI (int_t number, SubjectToStatus C_status)
 
virtual returnValue addBound (int_t number, SubjectToStatus B_status, BooleanType updateCholesky, BooleanType ensureLI=BT_TRUE)
 
virtual returnValue addBound_checkLI (int_t number)
 
virtual returnValue addBound_ensureLI (int_t number, SubjectToStatus B_status)
 
virtual returnValue removeConstraint (int_t number, BooleanType updateCholesky, BooleanType allowFlipping=BT_FALSE, BooleanType ensureNZC=BT_FALSE)
 
virtual returnValue removeBound (int_t number, BooleanType updateCholesky, BooleanType allowFlipping=BT_FALSE, BooleanType ensureNZC=BT_FALSE)
 
returnValue performPlainRatioTest (int_t nIdx, const int_t *const idxList, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t &t, int_t &BC_idx) const
 
returnValue ensureNonzeroCurvature (BooleanType removeBoundNotConstraint, int_t remIdx, BooleanType &exchangeHappened, BooleanType &addBoundNotConstraint, int_t &addIdx, SubjectToStatus &addStatus)
 
virtual returnValue backsolveT (const real_t *const b, BooleanType transposed, real_t *const a) const
 
returnValue determineDataShift (const real_t *const g_new, const real_t *const lbA_new, const real_t *const ubA_new, const real_t *const lb_new, const real_t *const ub_new, real_t *const delta_g, real_t *const delta_lbA, real_t *const delta_ubA, real_t *const delta_lb, real_t *const delta_ub, BooleanType &Delta_bC_isZero, BooleanType &Delta_bB_isZero)
 
virtual returnValue determineStepDirection (const real_t *const delta_g, const real_t *const delta_lbA, const real_t *const delta_ubA, const real_t *const delta_lb, const real_t *const delta_ub, BooleanType Delta_bC_isZero, BooleanType Delta_bB_isZero, real_t *const delta_xFX, real_t *const delta_xFR, real_t *const delta_yAC, real_t *const delta_yFX)
 
returnValue performStep (const real_t *const delta_g, const real_t *const delta_lbA, const real_t *const delta_ubA, const real_t *const delta_lb, const real_t *const delta_ub, const real_t *const delta_xFX, const real_t *const delta_xFR, const real_t *const delta_yAC, const real_t *const delta_yFX, int_t &BC_idx, SubjectToStatus &BC_status, BooleanType &BC_isBound)
 
returnValue changeActiveSet (int_t BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound)
 
real_t getRelativeHomotopyLength (const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new)
 
virtual returnValue performRamping ()
 
returnValue updateFarBounds (real_t curFarBound, int_t nRamp, const real_t *const lb_new, real_t *const lb_new_far, const real_t *const ub_new, real_t *const ub_new_far, const real_t *const lbA_new, real_t *const lbA_new_far, const real_t *const ubA_new, real_t *const ubA_new_far) const
 
virtual returnValue performDriftCorrection ()
 
virtual returnValue setupAuxiliaryQP (const Bounds *const guessedBounds, const Constraints *const guessedConstraints)
 
BooleanType shallRefactorise (const Bounds *const guessedBounds, const Constraints *const guessedConstraints) const
 
returnValue setupQPdata (SymmetricMatrix *_H, const real_t *const _g, Matrix *_A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA)
 
returnValue setupQPdata (const real_t *const _H, const real_t *const _g, const real_t *const _A, const real_t *const _lb, const real_t *const _ub, const real_t *const _lbA, const real_t *const _ubA)
 
returnValue setupQPdataFromFile (const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file)
 
returnValue loadQPvectorsFromFile (const char *const g_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, real_t *const g_new, real_t *const lb_new, real_t *const ub_new, real_t *const lbA_new, real_t *const ubA_new) const
 
returnValue printIteration (int_t iter, int_t BC_idx, SubjectToStatus BC_status, BooleanType BC_isBound, real_t homotopyLength, BooleanType isFirstCall=BT_TRUE)
 
returnValue setA (Matrix *A_new)
 
returnValue setA (const real_t *const A_new)
 
returnValue setLBA (const real_t *const lbA_new)
 
returnValue setLBA (int_t number, real_t value)
 
returnValue setUBA (const real_t *const ubA_new)
 
returnValue setUBA (int_t number, real_t value)
 
returnValue dropInfeasibles (int_t BC_number, SubjectToStatus BC_status, BooleanType BC_isBound, real_t *xiB, real_t *xiC)
 
returnValue areBoundsConsistent (const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA) const
 
virtual returnValue setupSubjectToType ()
 
virtual returnValue setupSubjectToType (const real_t *const lb_new, const real_t *const ub_new)
 
virtual returnValue setupAuxiliaryQP (const Bounds *const guessedBounds)
 
returnValue copy (const QProblemB &rhs)
 
returnValue determineHessianType ()
 
virtual returnValue setupSubjectToType (const real_t *const lb_new, const real_t *const ub_new)
 
virtual returnValue computeCholesky ()
 
returnValue obtainAuxiliaryWorkingSet (const real_t *const xOpt, const real_t *const yOpt, const Bounds *const guessedBounds, Bounds *auxiliaryBounds) const
 
returnValue areBoundsConsistent (const real_t *const lb, const real_t *const ub) const
 
virtual returnValue backsolveR (const real_t *const b, BooleanType transposed, real_t *const a) const
 
virtual returnValue backsolveR (const real_t *const b, BooleanType transposed, BooleanType removingBound, real_t *const a) const
 
returnValue determineDataShift (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 setupQPdata (SymmetricMatrix *_H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
 
returnValue setupQPdata (const real_t *const _H, const real_t *const _g, const real_t *const _lb, const real_t *const _ub)
 
returnValue setupQPdataFromFile (const char *const H_file, const char *const g_file, const char *const lb_file, const char *const ub_file)
 
returnValue loadQPvectorsFromFile (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) const
 
returnValue setInfeasibilityFlag (returnValue returnvalue, BooleanType doThrowError=BT_FALSE)
 
BooleanType isCPUtimeLimitExceeded (const real_t *const cputime, real_t starttime, int_t nWSR) const
 
returnValue regulariseHessian ()
 
returnValue setH (SymmetricMatrix *H_new)
 
returnValue setH (const real_t *const H_new)
 
returnValue setG (const real_t *const g_new)
 
returnValue setLB (const real_t *const lb_new)
 
returnValue setLB (int_t number, real_t value)
 
returnValue setUB (const real_t *const ub_new)
 
returnValue setUB (int_t number, real_t value)
 
void computeGivens (real_t xold, real_t yold, real_t &xnew, real_t &ynew, real_t &c, real_t &s) const
 
void applyGivens (real_t c, real_t s, real_t nu, real_t xold, real_t yold, real_t &xnew, real_t &ynew) const
 
real_t getRelativeHomotopyLength (const real_t *const g_new, const real_t *const lb_new, const real_t *const ub_new)
 
returnValue updateFarBounds (real_t curFarBound, int_t nRamp, const real_t *const lb_new, real_t *const lb_new_far, const real_t *const ub_new, real_t *const ub_new_far) const
 
returnValue performRatioTest (int_t nIdx, const int_t *const idxList, const SubjectTo *const subjectTo, const real_t *const num, const real_t *const den, real_t epsNum, real_t epsDen, real_t &t, int_t &BC_idx) const
 
BooleanType isBlocking (real_t num, real_t den, real_t epsNum, real_t epsDen, real_t &t) const
 
SymSparseMatcreateDiagSparseMat (int_t n, real_t diagVal=1.0)
 
virtual returnValue setupAuxiliaryQP (const Bounds *const guessedBounds)
 

Protected Attributes

BooleanType freeConstraintMatrix
 
MatrixA
 
real_tlbA
 
real_tubA
 
Constraints constraints
 
real_tT
 
real_tQ
 
int_t sizeT
 
real_tAx
 
real_tAx_l
 
real_tAx_u
 
ConstraintProductconstraintProduct
 
real_ttempA
 
real_ttempB
 
real_tZFR_delta_xFRz
 
real_tdelta_xFRy
 
real_tdelta_xFRz
 
real_tdelta_yAC_TMP
 
real_ttempC
 
BooleanType freeHessian
 
SymmetricMatrixH
 
real_tg
 
real_tlb
 
real_tub
 
Bounds bounds
 
real_tR
 
BooleanType haveCholesky
 
real_tx
 
real_ty
 
real_t tau
 
QProblemStatus status
 
BooleanType infeasible
 
BooleanType unbounded
 
HessianType hessianType
 
real_t regVal
 
uint_t count
 
real_tdelta_xFR_TMP
 
real_t ramp0
 
real_t ramp1
 
int_t rampOffset
 
Options options
 
Flipper flipper
 
TabularOutput tabularOutput
 

Friends

class SolutionAnalysis
 

Detailed Description

A class for setting up and solving quadratic programs. The main feature is the possibily to use the newly developed online active set strategy for parametric quadratic programming.

Author
Hans Joachim Ferreau, Andreas Potschka, Christian Kirches
Version
3.2
Date
2007-2017

Constructor & Destructor Documentation

◆ QProblem() [1/3]

BEGIN_NAMESPACE_QPOASES QProblem::QProblem ( )

◆ QProblem() [2/3]

QProblem::QProblem ( int_t  _nV,
int_t  _nC,
HessianType  _hessianType = HST_UNKNOWN,
BooleanType  allocDenseMats = BT_TRUE 
)

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

Parameters
_nVNumber of variables.
_nCNumber of constraints.
_hessianTypeType of Hessian matrix.
allocDenseMatsEnable allocation of dense matrices.

References A, Ax, Ax_l, Ax_u, BT_FALSE, BT_TRUE, constraintProduct, constraints, delta_xFRy, delta_xFRz, delta_yAC_TMP, QProblemB::flipper, freeConstraintMatrix, getMin(), Constraints::init(), Flipper::init(), lbA, Q, real_t, RET_INVALID_ARGUMENTS, sizeT, T, tempA, tempB, tempC, THROWERROR, ubA, QProblemB::y, and ZFR_delta_xFRz.

◆ QProblem() [3/3]

QProblem::QProblem ( const QProblem rhs)

Copy constructor (deep copy).

Parameters
rhsRhs object.

References A, BT_FALSE, copy(), and freeConstraintMatrix.

◆ ~QProblem()

QProblem::~QProblem ( )
virtual

Destructor.

References clear().

Member Function Documentation

◆ addBound()

returnValue QProblem::addBound ( int_t  number,
SubjectToStatus  B_status,
BooleanType  updateCholesky,
BooleanType  ensureLI = BT_TRUE 
)
protectedvirtual

◆ addBound_checkLI()

returnValue QProblem::addBound_checkLI ( int_t  number)
protectedvirtual

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

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

Reimplemented in SQProblemSchur.

References BT_FALSE, determineStepDirection(), Options::enableFullLITests, Options::epsLITests, getAbs(), getNAC(), getNC(), QProblemB::getNFR(), QProblemB::getNFX(), QProblemB::getNV(), getNZ(), QProblemB::options, QQ, real_t, RET_LINEARLY_DEPENDENT, RET_LINEARLY_INDEPENDENT, SUCCESSFUL_RETURN, and THROWINFO.

Referenced by addBound_ensureLI(), setupAuxiliaryWorkingSet(), and updateActivitiesForHotstart().

◆ addBound_ensureLI()

returnValue QProblem::addBound_ensureLI ( int_t  number,
SubjectToStatus  B_status 
)
protectedvirtual

◆ addConstraint()

returnValue QProblem::addConstraint ( int_t  number,
SubjectToStatus  C_status,
BooleanType  updateCholesky,
BooleanType  ensureLI = BT_TRUE 
)
protectedvirtual

◆ addConstraint_checkLI()

returnValue QProblem::addConstraint_checkLI ( int_t  number)
protectedvirtual

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

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

Reimplemented in SQProblemSchur.

References A, QProblemB::bounds, BT_FALSE, constraints, determineStepDirection(), Options::enableFullLITests, Options::epsLITests, getAbs(), Constraints::getActive(), Bounds::getFixed(), Bounds::getFree(), Constraints::getInactive(), getNAC(), getNC(), QProblemB::getNFR(), QProblemB::getNFX(), Indexlist::getNumberArray(), QProblemB::getNV(), getNZ(), Matrix::getRow(), QProblemB::options, QQ, real_t, RET_LINEARLY_DEPENDENT, RET_LINEARLY_INDEPENDENT, SUCCESSFUL_RETURN, and THROWINFO.

Referenced by addConstraint_ensureLI(), and setupAuxiliaryWorkingSet().

◆ addConstraint_ensureLI()

returnValue QProblem::addConstraint_ensureLI ( int_t  number,
SubjectToStatus  C_status 
)
protectedvirtual

◆ applyGivens()

void QProblemB::applyGivens ( real_t  c,
real_t  s,
real_t  nu,
real_t  xold,
real_t  yold,
real_t xnew,
real_t ynew 
) const
inlineprotectedinherited

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

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

Referenced by addBound(), QProblemB::addBound(), addConstraint(), SQProblemSchur::calcDetSchur(), removeBound(), removeConstraint(), and SQProblemSchur::updateSchurQR().

◆ areBoundsConsistent() [1/2]

returnValue QProblemB::areBoundsConsistent ( const real_t *const  lb,
const real_t *const  ub 
) const
protectedinherited

Decides if lower bounds are smaller than upper bounds

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

References EPS, QProblemB::getNV(), RET_QP_INFEASIBLE, and SUCCESSFUL_RETURN.

Referenced by areBoundsConsistent(), and QProblemB::hotstart().

◆ areBoundsConsistent() [2/2]

returnValue QProblem::areBoundsConsistent ( const real_t *const  lb,
const real_t *const  ub,
const real_t *const  lbA,
const real_t *const  ubA 
) const
protected

Decides if lower bounds are smaller than upper bounds

Returns
SUCCESSFUL_RETURN
RET_QP_INFEASIBLE
Parameters
lbVector of lower bounds
ubVector of upper bounds
lbAVector of lower constraints
ubAVector of upper constraints

References QProblemB::areBoundsConsistent(), EPS, getNC(), RET_QP_INFEASIBLE, and SUCCESSFUL_RETURN.

Referenced by hotstart().

◆ backsolveR() [1/2]

returnValue QProblemB::backsolveR ( const real_t *const  b,
BooleanType  transposed,
real_t *const  a 
) const
protectedvirtualinherited

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

Reimplemented in SQProblemSchur.

References BT_FALSE.

Referenced by determineStepDirection(), QProblemB::determineStepDirection(), removeBound(), QProblemB::removeBound(), and removeConstraint().

◆ backsolveR() [2/2]

returnValue QProblemB::backsolveR ( const real_t *const  b,
BooleanType  transposed,
BooleanType  removingBound,
real_t *const  a 
) const
protectedvirtualinherited

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

Reimplemented in SQProblemSchur.

References BT_FALSE, BT_TRUE, getAbs(), QProblemB::getNV(), QProblemB::getNZ(), real_t, RET_DIV_BY_ZERO, RR, SUCCESSFUL_RETURN, THROWERROR, and ZERO.

◆ backsolveT()

returnValue QProblem::backsolveT ( const real_t *const  b,
BooleanType  transposed,
real_t *const  a 
) const
protectedvirtual

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

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

Reimplemented in SQProblemSchur.

References BT_FALSE, EPS, getAbs(), getNAC(), real_t, RET_DIV_BY_ZERO, sizeT, SUCCESSFUL_RETURN, THROWERROR, and TT.

Referenced by addBound_ensureLI(), addConstraint_ensureLI(), and determineStepDirection().

◆ changeActiveSet()

returnValue QProblem::changeActiveSet ( int_t  BC_idx,
SubjectToStatus  BC_status,
BooleanType  BC_isBound 
)
protected

Updates the active set.

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

References __FILE__, __FUNC__, __LINE__, addBound(), addConstraint(), BT_TRUE, Options::enableNZCTests, getGlobalMessageHandler(), QProblemB::getNV(), MAX_STRING_LENGTH, QProblemB::options, removeBound(), removeConstraint(), RET_ADD_TO_ACTIVESET, RET_ADD_TO_ACTIVESET_FAILED, RET_ADDBOUND_FAILED_INFEASIBILITY, RET_ADDCONSTRAINT_FAILED_INFEASIBILITY, RET_REMOVE_FROM_ACTIVESET, RET_REMOVE_FROM_ACTIVESET_FAILED, ST_INACTIVE, ST_LOWER, ST_UNDEFINED, SUCCESSFUL_RETURN, THROWERROR, MessageHandling::throwInfo(), VS_VISIBLE, and QProblemB::y.

Referenced by solveQP().

◆ clear()

returnValue QProblem::clear ( )
protected

Frees all allocated memory.

Returns
SUCCESSFUL_RETURN

References A, Ax, Ax_l, Ax_u, BT_TRUE, delta_xFRy, delta_xFRz, delta_yAC_TMP, freeConstraintMatrix, lbA, Q, SUCCESSFUL_RETURN, T, tempA, tempB, tempC, ubA, and ZFR_delta_xFRz.

Referenced by operator=(), and ~QProblem().

◆ computeCholesky()

returnValue QProblemB::computeCholesky ( )
protectedvirtualinherited

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

References QProblemB::bounds, BT_TRUE, Matrix::getCol(), Bounds::getFree(), QProblemB::getNFR(), Indexlist::getNumberArray(), QProblemB::getNV(), getSqrt(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_ZERO, QProblemB::R, QProblemB::regVal, RET_CHOLESKY_OF_ZERO_HESSIAN, RR, THROWERROR, and QProblemB::usingRegularisation().

Referenced by computeProjectedCholesky(), QProblemB::setupAuxiliaryQP(), QProblemB::setupInitialCholesky(), and QProblemB::solveQP().

◆ computeGivens()

void QProblemB::computeGivens ( real_t  xold,
real_t  yold,
real_t xnew,
real_t ynew,
real_t c,
real_t s 
) const
inlineprotectedinherited

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

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

References BT_TRUE, getAbs(), getSqrt(), isZero(), and real_t.

Referenced by addBound(), QProblemB::addBound(), addConstraint(), SQProblemSchur::calcDetSchur(), removeBound(), removeConstraint(), and SQProblemSchur::updateSchurQR().

◆ computeProjectedCholesky()

returnValue QProblem::computeProjectedCholesky ( )
protectedvirtual

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

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_NOT_SPD
RET_INDEXLIST_CORRUPTED

Reimplemented in SQProblemSchur.

References SymmetricMatrix::bilinear(), SymSparseMat::bilinear(), QProblemB::bounds, BT_TRUE, QProblemB::computeCholesky(), constraints, QProblemB::createDiagSparseMat(), Constraints::getActive(), Matrix::getCol(), Bounds::getFree(), getNAC(), QProblemB::getNFR(), QProblemB::getNFX(), Indexlist::getNumberArray(), QProblemB::getNV(), getNZ(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_ZERO, Q, QQ, QProblemB::R, QProblemB::regVal, RET_UNKNOWN_BUG, SUCCESSFUL_RETURN, THROWERROR, and QProblemB::usingRegularisation().

Referenced by setupAuxiliaryQP(), setupInitialCholesky(), SQProblem::setupNewAuxiliaryQP(), and solveQP().

◆ copy() [1/2]

returnValue QProblem::copy ( const QProblem rhs)
protected

Copies all members from given rhs object.

Returns
SUCCESSFUL_RETURN
Parameters
rhsRhs object.

Referenced by operator=(), and QProblem().

◆ copy() [2/2]

returnValue QProblemB::copy ( const QProblemB rhs)
protectedinherited

Copies all members from given rhs object.

Returns
SUCCESSFUL_RETURN
Parameters
rhsRhs object.

Referenced by QProblemB::operator=(), and QProblemB::QProblemB().

◆ createDiagSparseMat()

SymSparseMat * QProblemB::createDiagSparseMat ( int_t  n,
real_t  diagVal = 1.0 
)
protectedinherited

Creates a sparse diagonal (square-)matrix which is a given multiple of the identity matrix.

Returns
Diagonal matrix
Parameters
nRow/column dimension of matrix to be created.
diagValValue of all diagonal entries.

References SparseMatrix::createDiagInfo(), Matrix::doFreeMemory(), and real_t.

Referenced by computeProjectedCholesky().

◆ determineDataShift() [1/2]

returnValue QProblemB::determineDataShift ( 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 
)
protectedinherited

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.

References QProblemB::bounds, BT_FALSE, BT_TRUE, EPS, QProblemB::g, getAbs(), Bounds::getFixed(), QProblemB::getNFX(), Indexlist::getNumberArray(), QProblemB::getNV(), INFTY, QProblemB::lb, SUCCESSFUL_RETURN, and QProblemB::ub.

Referenced by determineDataShift(), and QProblemB::solveQP().

◆ determineDataShift() [2/2]

returnValue QProblem::determineDataShift ( const real_t *const  g_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
real_t *const  delta_g,
real_t *const  delta_lbA,
real_t *const  delta_ubA,
real_t *const  delta_lb,
real_t *const  delta_ub,
BooleanType Delta_bC_isZero,
BooleanType Delta_bB_isZero 
)
protected

Determines step direction of the shift of the QP data.

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

References QProblemB::bounds, BT_FALSE, BT_TRUE, constraints, QProblemB::determineDataShift(), EPS, getAbs(), Constraints::getActive(), Bounds::getFixed(), getNAC(), getNC(), Indexlist::getNumberArray(), INFTY, lbA, SUCCESSFUL_RETURN, and ubA.

Referenced by solveQP().

◆ determineHessianType()

returnValue QProblemB::determineHessianType ( )
protectedinherited

◆ determineStepDirection()

returnValue QProblem::determineStepDirection ( const real_t *const  delta_g,
const real_t *const  delta_lbA,
const real_t *const  delta_ubA,
const real_t *const  delta_lb,
const real_t *const  delta_ub,
BooleanType  Delta_bC_isZero,
BooleanType  Delta_bB_isZero,
real_t *const  delta_xFX,
real_t *const  delta_xFR,
real_t *const  delta_yAC,
real_t *const  delta_yFX 
)
protectedvirtual

Determines step direction of the homotopy path.

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

Reimplemented in SQProblemSchur.

References A, QProblemB::backsolveR(), backsolveT(), QProblemB::bounds, BT_FALSE, BT_TRUE, constraints, QProblemB::delta_xFR_TMP, delta_xFRy, delta_xFRz, delta_yAC_TMP, Options::epsIterRef, getAbs(), Constraints::getActive(), Bounds::getFixed(), Bounds::getFree(), getNAC(), QProblemB::getNFR(), QProblemB::getNFX(), Indexlist::getNumberArray(), QProblemB::getNV(), getNZ(), SubjectTo::getStatus(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_ZERO, Options::numRefinementSteps, QProblemB::options, QQ, real_t, QProblemB::regVal, RET_STEPDIRECTION_FAILED_CHOLESKY, RET_STEPDIRECTION_FAILED_TQ, RET_UNKNOWN_BUG, ST_LOWER, SUCCESSFUL_RETURN, tempA, tempB, THROWERROR, Matrix::times(), Matrix::transTimes(), QProblemB::usingRegularisation(), and ZFR_delta_xFRz.

Referenced by addBound_checkLI(), addConstraint_checkLI(), ensureNonzeroCurvature(), SolutionAnalysis::getVarianceCovariance(), solveCurrentEQP(), and solveQP().

◆ dropInfeasibles()

returnValue QProblem::dropInfeasibles ( int_t  BC_number,
SubjectToStatus  BC_status,
BooleanType  BC_isBound,
real_t xiB,
real_t xiC 
)
protected

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

Returns
SUCCESSFUL_RETURN
Parameters
BC_numberNumber of the bound or constraint to be added.
BC_statusNew status of the bound or constraint to be added.
BC_isBoundWhether a bound or a constraint is to be added.
xiB(not yet documented)
xiC(not yet documented)

References QProblemB::bounds, BT_FALSE, BT_TRUE, constraints, Options::dropBoundPriority, Options::dropEqConPriority, Options::dropIneqConPriority, Options::epsDen, getAbs(), Constraints::getActive(), Bounds::getFixed(), getNAC(), QProblemB::getNFX(), Indexlist::getNumberArray(), SubjectTo::getStatus(), SubjectTo::getType(), QProblemB::options, removeBound(), removeConstraint(), RET_ENSURELI_DROPPED, SubjectTo::setStatus(), ST_BOUNDED, ST_EQUALITY, ST_INFEASIBLE_LOWER, ST_INFEASIBLE_UPPER, ST_LOWER, and SUCCESSFUL_RETURN.

Referenced by SQProblemSchur::addBound_ensureLI(), addBound_ensureLI(), SQProblemSchur::addConstraint_ensureLI(), and addConstraint_ensureLI().

◆ ensureNonzeroCurvature()

returnValue QProblem::ensureNonzeroCurvature ( BooleanType  removeBoundNotConstraint,
int_t  remIdx,
BooleanType exchangeHappened,
BooleanType addBoundNotConstraint,
int_t addIdx,
SubjectToStatus addStatus 
)
protected

Ensure non-zero curvature by primal jump.

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

References A, Ax, Ax_l, Ax_u, QProblemB::bounds, BT_FALSE, BT_TRUE, constraints, determineStepDirection(), Options::epsDen, Options::epsNum, Options::epsNZCTests, getAbs(), Constraints::getActive(), Bounds::getFixed(), Bounds::getFree(), Constraints::getInactive(), getMax(), getNAC(), getNC(), QProblemB::getNFR(), QProblemB::getNFX(), getNIAC(), Indexlist::getNumberArray(), QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::lb, lbA, Options::maxPrimalJump, QProblemB::options, performPlainRatioTest(), real_t, RET_HOTSTART_STOPPED_UNBOUNDEDNESS, ST_INACTIVE, ST_LOWER, ST_UPPER, SUCCESSFUL_RETURN, Matrix::times(), QProblemB::ub, ubA, QProblemB::unbounded, and QProblemB::x.

Referenced by SQProblemSchur::removeBound(), removeBound(), SQProblemSchur::removeConstraint(), and removeConstraint().

◆ getBounds()

BEGIN_NAMESPACE_QPOASES returnValue QProblemB::getBounds ( Bounds _bounds) const
inlineinherited

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

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
Parameters
_boundsOutput: Bounds object.

References QProblemB::bounds, QProblemB::getNV(), RET_QPOBJECT_NOT_SETUP, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by SolutionAnalysis::checkCurvatureOnStronglyActiveConstraints().

◆ getConstraints()

BEGIN_NAMESPACE_QPOASES returnValue QProblem::getConstraints ( Constraints _constraints) const
inline

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

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
Parameters
_constraintsOutput: Constraints object.

References constraints, QProblemB::getNV(), RET_QPOBJECT_NOT_SETUP, SUCCESSFUL_RETURN, and THROWERROR.

◆ getCount()

uint_t QProblemB::getCount ( ) const
inlineinherited

Returns the current number of QP problems solved.

Returns
Number of QP problems solved.

References QProblemB::count.

◆ getDualSolution()

returnValue QProblem::getDualSolution ( real_t *const  yOpt) const
virtual

Returns the dual solution vector (deep copy).

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

Reimplemented from QProblemB.

References getNC(), QProblemB::getNV(), QProblemB::getStatus(), QPS_AUXILIARYQPSOLVED, QPS_HOMOTOPYQPSOLVED, QPS_SOLVED, RET_QP_NOT_SOLVED, SUCCESSFUL_RETURN, and QProblemB::y.

Referenced by main(), and solveOqpBenchmark().

◆ getFreeVariablesFlags()

returnValue QProblem::getFreeVariablesFlags ( BooleanType varIsFree)

Set the incoming array to true for each variable entry that is in the set of free variables

References QProblemB::bounds, BT_FALSE, BT_TRUE, Bounds::getFree(), QProblemB::getNFR(), Indexlist::getNumberArray(), QProblemB::getNV(), and SUCCESSFUL_RETURN.

◆ getHessianType()

HessianType QProblemB::getHessianType ( ) const
inlineinherited

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

Returns
Hessian type.

References QProblemB::hessianType.

Referenced by SolutionAnalysis::getKktViolation().

◆ getNAC()

int_t QProblem::getNAC ( ) const
inline

◆ getNC()

int_t QProblem::getNC ( ) const
inline

◆ getNEC()

int_t QProblem::getNEC ( ) const
inline

Returns the number of (implicitly defined) equality constraints.

Returns
Number of (implicitly defined) equality constraints.

References constraints, and Constraints::getNEC().

Referenced by printProperties().

◆ getNFR()

int_t QProblemB::getNFR ( ) const
inlineinherited

◆ getNFV()

int_t QProblemB::getNFV ( ) const
inlineinherited

Returns the number of implicitly fixed variables.

Returns
Number of implicitly fixed variables.

References QProblemB::bounds, and Bounds::getNFV().

Referenced by QProblemB::setupInitialCholesky(), and setupInitialCholesky().

◆ getNFX()

int_t QProblemB::getNFX ( ) const
inlineinherited

◆ getNIAC()

int_t QProblem::getNIAC ( ) const
inline

Returns the number of inactive constraints.

Returns
Number of inactive constraints.

References constraints, and Constraints::getNIAC().

Referenced by ensureNonzeroCurvature(), performStep(), and writeQpWorkspaceIntoMatFile().

◆ getNV()

int_t QProblemB::getNV ( ) const
inlineinherited

Returns the number of variables.

Returns
Number of variables.

References QProblemB::bounds, and Bounds::getNV().

Referenced by addBound(), QProblemB::addBound(), addBound_checkLI(), SQProblemSchur::addBound_checkLISchur(), SQProblemSchur::addBound_ensureLI(), addBound_ensureLI(), addConstraint(), addConstraint_checkLI(), SQProblemSchur::addConstraint_checkLISchur(), SQProblemSchur::addConstraint_ensureLI(), addConstraint_ensureLI(), QProblemB::areBoundsConsistent(), QProblemB::backsolveR(), changeActiveSet(), QProblemB::computeCholesky(), computeProjectedCholesky(), QProblemB::determineDataShift(), QProblemB::determineHessianType(), determineStepDirection(), ensureNonzeroCurvature(), QProblemB::getBounds(), getConstraints(), QProblemB::getDualSolution(), getDualSolution(), getFreeVariablesFlags(), SolutionAnalysis::getKktViolation(), QProblemB::getObjVal(), QProblemB::getPrimalSolution(), QProblemB::getRelativeHomotopyLength(), SolutionAnalysis::getVarianceCovariance(), getWorkingSet(), QProblemB::getWorkingSetBounds(), SQProblem::hotstart(), QProblemB::hotstart(), hotstart(), init(), QProblemB::init(), QProblemB::loadQPvectorsFromFile(), QProblemB::obtainAuxiliaryWorkingSet(), obtainAuxiliaryWorkingSet(), performDriftCorrection(), QProblemB::performDriftCorrection(), QProblemB::performRamping(), performRamping(), performStep(), QProblemB::performStep(), printIteration(), QProblemB::printIteration(), printProperties(), QProblemB::printProperties(), QProblemB::regulariseHessian(), removeBound(), QProblemB::removeBound(), removeConstraint(), reset(), QProblemB::reset(), setA(), QProblemB::setH(), QProblemB::setLB(), setLBA(), QProblemB::setUB(), setUBA(), SQProblemSchur::setupAuxiliaryQP(), setupAuxiliaryQP(), QProblemB::setupAuxiliaryQP(), setupAuxiliaryQPbounds(), QProblemB::setupAuxiliaryQPbounds(), setupAuxiliaryQPgradient(), QProblemB::setupAuxiliaryQPgradient(), setupAuxiliaryQPsolution(), QProblemB::setupAuxiliaryQPsolution(), SQProblemSchur::setupAuxiliaryWorkingSet(), setupAuxiliaryWorkingSet(), QProblemB::setupAuxiliaryWorkingSet(), QProblemB::setupInitialCholesky(), setupInitialCholesky(), SQProblem::setupNewAuxiliaryQP(), setupQPdata(), QProblemB::setupQPdataFromFile(), setupQPdataFromFile(), QProblemB::setupSubjectToType(), setupTQfactorisation(), shallRefactorise(), QProblemB::shallRefactorise(), solveCurrentEQP(), solveInitialQP(), QProblemB::solveInitialQP(), solveQP(), QProblemB::solveQP(), solveRegularisedQP(), QProblemB::solveRegularisedQP(), updateActivitiesForHotstart(), QProblemB::updateFarBounds(), updateFarBounds(), writeQpDataIntoMatFile(), and writeQpWorkspaceIntoMatFile().

◆ getNZ()

int_t QProblem::getNZ ( ) const
virtual

◆ getObjVal() [1/2]

real_t QProblemB::getObjVal ( ) const
inherited

Returns the optimal objective function value.

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

References QProblemB::getStatus(), INFTY, QPS_AUXILIARYQPSOLVED, QPS_HOMOTOPYQPSOLVED, QPS_SOLVED, real_t, and QProblemB::x.

Referenced by main().

◆ getObjVal() [2/2]

real_t QProblemB::getObjVal ( const real_t *const  _x) const
inherited

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.

References BT_TRUE, QProblemB::g, QProblemB::getNV(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_ZERO, real_t, QProblemB::regVal, Matrix::times(), and QProblemB::usingRegularisation().

◆ getOptions()

Options QProblemB::getOptions ( ) const
inlineinherited

Returns current options struct.

Returns
Current options struct.

References QProblemB::options.

◆ getPrimalSolution()

returnValue QProblemB::getPrimalSolution ( real_t *const  xOpt) const
inherited

Returns the primal solution vector.

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

References QProblemB::getNV(), QProblemB::getStatus(), QPS_AUXILIARYQPSOLVED, QPS_HOMOTOPYQPSOLVED, QPS_SOLVED, RET_QP_NOT_SOLVED, SUCCESSFUL_RETURN, and QProblemB::x.

Referenced by main(), and solveOqpBenchmark().

◆ getPrintLevel()

PrintLevel QProblemB::getPrintLevel ( ) const
inlineinherited

Returns the print level.

Returns
Print level.

References QProblemB::options, and Options::printLevel.

◆ getRelativeHomotopyLength() [1/2]

real_t QProblemB::getRelativeHomotopyLength ( const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new 
)
protectedinherited

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.

References QProblemB::g, getAbs(), QProblemB::getNV(), QProblemB::lb, real_t, and QProblemB::ub.

Referenced by getRelativeHomotopyLength(), and QProblemB::solveQP().

◆ getRelativeHomotopyLength() [2/2]

real_t QProblem::getRelativeHomotopyLength ( const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new 
)
protected

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

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

References getAbs(), getNC(), QProblemB::getRelativeHomotopyLength(), lbA, real_t, and ubA.

Referenced by solveQP().

◆ getStatus()

QProblemStatus QProblemB::getStatus ( ) const
inlineinherited

◆ getWorkingSet()

returnValue QProblem::getWorkingSet ( real_t workingSet)
virtual

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.

Reimplemented from QProblemB.

References QProblemB::getNV(), getWorkingSetBounds(), getWorkingSetConstraints(), RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and THROWERROR.

◆ getWorkingSetBounds()

returnValue QProblem::getWorkingSetBounds ( real_t workingSetB)
virtual

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.

Reimplemented from QProblemB.

References QProblemB::getWorkingSetBounds().

Referenced by SolutionAnalysis::getKktViolation(), and getWorkingSet().

◆ getWorkingSetConstraints()

returnValue QProblem::getWorkingSetConstraints ( real_t workingSetC)
virtual

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.

Reimplemented from QProblemB.

References constraints, getNC(), SubjectTo::getStatus(), RET_INVALID_ARGUMENTS, ST_LOWER, ST_UPPER, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by SolutionAnalysis::getKktViolation(), and getWorkingSet().

◆ hotstart() [1/4]

returnValue QProblemB::hotstart ( const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
int_t nWSR,
real_t *const  cputime = 0,
const Bounds *const  guessedBounds = 0 
)
inherited

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!)

References QProblemB::areBoundsConsistent(), Options::boundTolerance, BT_FALSE, BT_TRUE, QProblemB::count, Options::enableFarBounds, getAbs(), getCPUtime(), QProblemB::getNV(), Options::growFarBounds, QProblemB::haveCholesky, QProblemB::infeasible, INFTY, Options::initialFarBounds, QProblemB::options, QPS_AUXILIARYQPSOLVED, QPS_HOMOTOPYQPSOLVED, QPS_SOLVED, QProblemB::rampOffset, real_t, RET_HOTSTART_STOPPED_INFEASIBILITY, RET_HOTSTART_STOPPED_UNBOUNDEDNESS, RET_QPOBJECT_NOT_SETUP, RET_SETUP_AUXILIARYQP_FAILED, QProblemB::setInfeasibilityFlag(), QProblemB::setupAuxiliaryQP(), QProblemB::setupInitialCholesky(), QProblemB::solveRegularisedQP(), QProblemB::status, SUCCESSFUL_RETURN, THROWERROR, QProblemB::unbounded, QProblemB::updateFarBounds(), and QProblemB::x.

Referenced by QProblemB::hotstart(), main(), QProblemB::solveInitialQP(), and solveOqpBenchmark().

◆ hotstart() [2/4]

returnValue QProblem::hotstart ( const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new,
int_t nWSR,
real_t *const  cputime = 0,
const Bounds *const  guessedBounds = 0,
const Constraints *const  guessedConstraints = 0 
)

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
Parameters
g_newGradient of neighbouring QP to be solved.
lb_newLower bounds of neighbouring QP to be solved.
If no lower bounds exist, a NULL pointer can be passed.
ub_newUpper bounds of neighbouring QP to be solved.
If no upper bounds exist, a NULL pointer can be passed.
lbA_newLower constraints' bounds of neighbouring QP to be solved.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_newUpper constraints' bounds of neighbouring QP to be solved.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of bounds is kept!)
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of constraints is kept!)

References areBoundsConsistent(), Ax, QProblemB::bounds, Options::boundTolerance, BT_FALSE, BT_TRUE, constraints, QProblemB::count, Options::enableFarBounds, getAbs(), getCPUtime(), getNC(), QProblemB::getNV(), Options::growFarBounds, QProblemB::haveCholesky, QProblemB::infeasible, INFTY, Options::initialFarBounds, QProblemB::options, QPS_AUXILIARYQPSOLVED, QPS_HOMOTOPYQPSOLVED, QPS_SOLVED, QProblemB::rampOffset, real_t, RET_HOTSTART_STOPPED_INFEASIBILITY, RET_HOTSTART_STOPPED_UNBOUNDEDNESS, RET_QPOBJECT_NOT_SETUP, RET_SETUP_AUXILIARYQP_FAILED, QProblemB::setInfeasibilityFlag(), setupAuxiliaryQP(), setupInitialCholesky(), solveRegularisedQP(), QProblemB::status, SUCCESSFUL_RETURN, THROWERROR, QProblemB::unbounded, updateFarBounds(), and QProblemB::x.

Referenced by SQProblem::hotstart(), hotstart(), main(), solveInitialQP(), and solveOqpBenchmark().

◆ hotstart() [3/4]

returnValue QProblemB::hotstart ( const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
int_t nWSR,
real_t *const  cputime = 0,
const Bounds *const  guessedBounds = 0 
)
inherited

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_SETUP_AUXILIARYQP_FAILED
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).
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set is kept!)

References QProblemB::getNV(), QProblemB::hotstart(), QProblemB::loadQPvectorsFromFile(), real_t, RET_INVALID_ARGUMENTS, RET_QPOBJECT_NOT_SETUP, RET_UNABLE_TO_READ_FILE, SUCCESSFUL_RETURN, and THROWERROR.

◆ hotstart() [4/4]

returnValue QProblem::hotstart ( const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
const char *const  lbA_file,
const char *const  ubA_file,
int_t nWSR,
real_t *const  cputime = 0,
const Bounds *const  guessedBounds = 0,
const Constraints *const  guessedConstraints = 0 
)

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
Parameters
g_fileName of file where gradient, of neighbouring QP to be solved, is stored.
lb_fileName of file where lower bounds, of neighbouring QP to be solved, is stored.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bounds, of neighbouring QP to be solved, is stored.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bounds, of neighbouring QP to be solved, is stored.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bounds, of neighbouring QP to be solved, is stored.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spent for QP solution (or to perform nWSR iterations).
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of bounds is kept!)
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
(If a null pointer is passed, the previous working set of constraints is kept!)

References getNC(), QProblemB::getNV(), hotstart(), loadQPvectorsFromFile(), real_t, RET_INVALID_ARGUMENTS, RET_QPOBJECT_NOT_SETUP, RET_UNABLE_TO_READ_FILE, SUCCESSFUL_RETURN, and THROWERROR.

◆ init() [1/6]

returnValue QProblemB::init ( SymmetricMatrix _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub,
int_t nWSR,
real_t *const  cputime = 0,
const real_t *const  xOpt = 0,
const real_t *const  yOpt = 0,
const Bounds *const  guessedBounds = 0,
const real_t *const  _R = 0 
)
inherited

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!

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
RET_INVALID_ARGUMENTS
Parameters
_HHessian matrix (a shallow copy is made).
_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).
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!)

References BT_TRUE, QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::isInitialised(), QProblemB::reset(), RET_INVALID_ARGUMENTS, RET_NO_CHOLESKY_WITH_INITIAL_GUESS, RET_QP_ALREADY_INITIALISED, RET_QPOBJECT_NOT_SETUP, QProblemB::setupQPdata(), QProblemB::solveInitialQP(), ST_UNDEFINED, SUCCESSFUL_RETURN, THROWERROR, and THROWWARNING.

Referenced by main(), and solveOqpBenchmark().

◆ init() [2/6]

returnValue QProblem::init ( SymmetricMatrix _H,
const real_t *const  _g,
Matrix _A,
const real_t *const  _lb,
const real_t *const  _ub,
const real_t *const  _lbA,
const real_t *const  _ubA,
int_t nWSR,
real_t *const  cputime = 0,
const real_t *const  xOpt = 0,
const real_t *const  yOpt = 0,
const Bounds *const  guessedBounds = 0,
const Constraints *const  guessedConstraints = 0,
const real_t *const  _R = 0 
)

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

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

Note: This function internally calls solveInitialQP for initialisation!

Returns
SUCCESSFUL_RETURN
RET_INIT_FAILED
RET_INIT_FAILED_CHOLESKY
RET_INIT_FAILED_TQ
RET_INIT_FAILED_HOTSTART
RET_INIT_FAILED_INFEASIBILITY
RET_INIT_FAILED_UNBOUNDEDNESS
RET_MAX_NWSR_REACHED
RET_INVALID_ARGUMENTS
Parameters
_HHessian matrix (a shallow copy is made).
_gGradient vector.
_AConstraint matrix (a shallow copy is made).
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation (if pointer passed).
xOptOptimal primal solution vector.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, all bounds are assumed inactive!)
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
(If a null pointer is passed, all constraints 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!)

References BT_TRUE, getNC(), QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::isInitialised(), reset(), RET_INVALID_ARGUMENTS, RET_NO_CHOLESKY_WITH_INITIAL_GUESS, RET_QP_ALREADY_INITIALISED, RET_QPOBJECT_NOT_SETUP, setupQPdata(), solveInitialQP(), ST_UNDEFINED, SUCCESSFUL_RETURN, THROWERROR, and THROWWARNING.

Referenced by main(), and solveOqpBenchmark().

◆ init() [3/6]

returnValue QProblemB::init ( const real_t *const  _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub,
int_t nWSR,
real_t *const  cputime = 0,
const real_t *const  xOpt = 0,
const real_t *const  yOpt = 0,
const Bounds *const  guessedBounds = 0,
const real_t *const  _R = 0 
)
inherited

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!

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
RET_INVALID_ARGUMENTS
Parameters
_HHessian matrix (a shallow copy is made).
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).
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!)

References BT_TRUE, QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::isInitialised(), QProblemB::reset(), RET_INVALID_ARGUMENTS, RET_NO_CHOLESKY_WITH_INITIAL_GUESS, RET_QP_ALREADY_INITIALISED, RET_QPOBJECT_NOT_SETUP, QProblemB::setupQPdata(), QProblemB::solveInitialQP(), ST_UNDEFINED, SUCCESSFUL_RETURN, THROWERROR, and THROWWARNING.

◆ init() [4/6]

returnValue QProblem::init ( const real_t *const  _H,
const real_t *const  _g,
const real_t *const  _A,
const real_t *const  _lb,
const real_t *const  _ub,
const real_t *const  _lbA,
const real_t *const  _ubA,
int_t nWSR,
real_t *const  cputime = 0,
const real_t *const  xOpt = 0,
const real_t *const  yOpt = 0,
const Bounds *const  guessedBounds = 0,
const Constraints *const  guessedConstraints = 0,
const real_t *const  _R = 0 
)

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

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

Note: This function internally calls solveInitialQP for initialisation!

Returns
SUCCESSFUL_RETURN
RET_INIT_FAILED
RET_INIT_FAILED_CHOLESKY
RET_INIT_FAILED_TQ
RET_INIT_FAILED_HOTSTART
RET_INIT_FAILED_INFEASIBILITY
RET_INIT_FAILED_UNBOUNDEDNESS
RET_MAX_NWSR_REACHED
RET_INVALID_ARGUMENTS
Parameters
_HHessian matrix (a shallow copy is made).
If Hessian matrix is trivial, a NULL pointer can be passed.
_gGradient vector.
_AConstraint matrix (a shallow copy is made).
_lbLower bound vector (on variables).
If no lower bounds exist, a NULL pointer can be passed.
_ubUpper bound vector (on variables).
If no upper bounds exist, a NULL pointer can be passed.
_lbALower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
_ubAUpper constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation (if pointer passed).
xOptOptimal primal solution vector.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, all bounds are assumed inactive!)
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
(If a null pointer is passed, all constraints 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!)

References BT_TRUE, getNC(), QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::isInitialised(), reset(), RET_INVALID_ARGUMENTS, RET_NO_CHOLESKY_WITH_INITIAL_GUESS, RET_QP_ALREADY_INITIALISED, RET_QPOBJECT_NOT_SETUP, setupQPdata(), solveInitialQP(), ST_UNDEFINED, SUCCESSFUL_RETURN, THROWERROR, and THROWWARNING.

◆ init() [5/6]

returnValue QProblemB::init ( const char *const  H_file,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
int_t nWSR,
real_t *const  cputime = 0,
const real_t *const  xOpt = 0,
const real_t *const  yOpt = 0,
const Bounds *const  guessedBounds = 0,
const char *const  R_file = 0 
)
inherited

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!

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

References BT_TRUE, QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::isInitialised(), QProblemB::R, readFromFile(), QProblemB::reset(), RET_INVALID_ARGUMENTS, RET_NO_CHOLESKY_WITH_INITIAL_GUESS, RET_QP_ALREADY_INITIALISED, RET_QPOBJECT_NOT_SETUP, RET_UNABLE_TO_READ_FILE, QProblemB::setupQPdataFromFile(), QProblemB::solveInitialQP(), ST_UNDEFINED, SUCCESSFUL_RETURN, THROWERROR, and THROWWARNING.

◆ init() [6/6]

returnValue QProblem::init ( const char *const  H_file,
const char *const  g_file,
const char *const  A_file,
const char *const  lb_file,
const char *const  ub_file,
const char *const  lbA_file,
const char *const  ubA_file,
int_t nWSR,
real_t *const  cputime = 0,
const real_t *const  xOpt = 0,
const real_t *const  yOpt = 0,
const Bounds *const  guessedBounds = 0,
const Constraints *const  guessedConstraints = 0,
const char *const  R_file = 0 
)

Initialises a QP problem with given 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/gC empty (or all implicit equality bounds),
  2. xOpt, 0, 0 : starts with xOpt, yOpt = 0 and obtain gB/gC by "clipping",
  3. 0, yOpt, 0 : starts with xOpt = 0, yOpt and obtain gB/gC from yOpt != 0,
  4. 0, 0, gB/gC: starts with xOpt = 0, yOpt = 0 and gB/gC,
  5. xOpt, yOpt, 0 : starts with xOpt, yOpt and obtain gB/gC from yOpt != 0,
  6. xOpt, 0, gB/gC: starts with xOpt, yOpt = 0 and gB/gC,
  7. xOpt, yOpt, gB/gC: starts with xOpt, yOpt and gB/gC (assume them to be consistent!)

Note: This function internally calls solveInitialQP for initialisation!

Returns
SUCCESSFUL_RETURN
RET_INIT_FAILED
RET_INIT_FAILED_CHOLESKY
RET_INIT_FAILED_TQ
RET_INIT_FAILED_HOTSTART
RET_INIT_FAILED_INFEASIBILITY
RET_INIT_FAILED_UNBOUNDEDNESS
RET_MAX_NWSR_REACHED
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
Parameters
H_fileName of file where Hessian matrix is stored.
If Hessian matrix is trivial, a NULL pointer can be passed.
g_fileName of file where gradient vector is stored.
A_fileName of file where constraint matrix is stored.
lb_fileName of file where lower bound vector.
If no lower bounds exist, a NULL pointer can be passed.
ub_fileName of file where upper bound vector.
If no upper bounds exist, a NULL pointer can be passed.
lbA_fileName of file where lower constraints' bound vector.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_fileName of file where upper constraints' bound vector.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations when using initial homotopy. Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP initialisation.
Output: CPU time spent for QP initialisation (if pointer passed).
xOptOptimal primal solution vector.
(If a null pointer is passed, the old primal solution is kept!)
yOptOptimal dual solution vector.
(If a null pointer is passed, the old dual solution is kept!)
guessedBoundsOptimal working set of bounds for solution (xOpt,yOpt).
(If a null pointer is passed, all bounds are assumed inactive!)
guessedConstraintsOptimal working set of constraints for solution (xOpt,yOpt).
(If a null pointer is passed, all constraints 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!)

References BT_TRUE, getNC(), QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::isInitialised(), QProblemB::R, readFromFile(), reset(), RET_INVALID_ARGUMENTS, RET_NO_CHOLESKY_WITH_INITIAL_GUESS, RET_QP_ALREADY_INITIALISED, RET_QPOBJECT_NOT_SETUP, RET_UNABLE_TO_READ_FILE, setupQPdataFromFile(), solveInitialQP(), ST_UNDEFINED, SUCCESSFUL_RETURN, THROWERROR, and THROWWARNING.

◆ isBlocking()

BooleanType QProblemB::isBlocking ( real_t  num,
real_t  den,
real_t  epsNum,
real_t  epsDen,
real_t t 
) const
inlineprotectedinherited

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

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

References BT_FALSE, and BT_TRUE.

Referenced by QProblemB::performRatioTest().

◆ isCPUtimeLimitExceeded()

BooleanType QProblemB::isCPUtimeLimitExceeded ( const real_t *const  cputime,
real_t  starttime,
int_t  nWSR 
) const
protectedinherited

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.

References BT_FALSE, BT_TRUE, getCPUtime(), and real_t.

Referenced by solveQP(), and QProblemB::solveQP().

◆ isInfeasible()

BooleanType QProblemB::isInfeasible ( ) const
inlineinherited

Returns if the QP is infeasible.

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

References QProblemB::infeasible.

Referenced by solveInitialQP(), QProblemB::solveInitialQP(), and solveQP().

◆ isInitialised()

BooleanType QProblemB::isInitialised ( ) const
inlineinherited

Returns if the QProblem object is initialised.

Returns
BT_TRUE: QProblemB initialised
BT_FALSE: QProblemB not initialised

References BT_FALSE, BT_TRUE, QPS_NOTINITIALISED, and QProblemB::status.

Referenced by init(), and QProblemB::init().

◆ isSolved()

BooleanType QProblemB::isSolved ( ) const
inlineinherited

Returns if the QP has been solved.

Returns
BT_TRUE: QProblemB solved
BT_FALSE: QProblemB not solved

References BT_FALSE, BT_TRUE, QPS_SOLVED, and QProblemB::status.

◆ isUnbounded()

BooleanType QProblemB::isUnbounded ( ) const
inlineinherited

Returns if the QP is unbounded.

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

References QProblemB::unbounded.

Referenced by solveInitialQP(), and QProblemB::solveInitialQP().

◆ loadQPvectorsFromFile() [1/2]

returnValue QProblemB::loadQPvectorsFromFile ( 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 
) const
protectedinherited

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

References QProblemB::getNV(), readFromFile(), RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by QProblemB::hotstart(), and loadQPvectorsFromFile().

◆ loadQPvectorsFromFile() [2/2]

returnValue QProblem::loadQPvectorsFromFile ( const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file,
const char *const  lbA_file,
const char *const  ubA_file,
real_t *const  g_new,
real_t *const  lb_new,
real_t *const  ub_new,
real_t *const  lbA_new,
real_t *const  ubA_new 
) const
protected

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

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

References getNC(), QProblemB::loadQPvectorsFromFile(), readFromFile(), RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by SQProblem::hotstart(), and hotstart().

◆ obtainAuxiliaryWorkingSet() [1/2]

returnValue QProblemB::obtainAuxiliaryWorkingSet ( const real_t *const  xOpt,
const real_t *const  yOpt,
const Bounds *const  guessedBounds,
Bounds auxiliaryBounds 
) const
protectedinherited

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

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

References QProblemB::bounds, Options::boundTolerance, EPS, QProblemB::getNV(), SubjectTo::getStatus(), SubjectTo::getType(), Options::initialStatusBounds, QProblemB::lb, QProblemB::options, RET_INVALID_ARGUMENTS, RET_OBTAINING_WORKINGSET_FAILED, Bounds::setupBound(), ST_EQUALITY, ST_INACTIVE, ST_LOWER, ST_UNBOUNDED, ST_UPPER, SUCCESSFUL_RETURN, THROWERROR, and QProblemB::ub.

Referenced by obtainAuxiliaryWorkingSet(), and QProblemB::solveInitialQP().

◆ obtainAuxiliaryWorkingSet() [2/2]

returnValue QProblem::obtainAuxiliaryWorkingSet ( const real_t *const  xOpt,
const real_t *const  yOpt,
const Bounds *const  guessedBounds,
const Constraints *const  guessedConstraints,
Bounds auxiliaryBounds,
Constraints auxiliaryConstraints 
) const
protected

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

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

References Ax, Ax_u, Options::boundTolerance, constraints, EPS, getNC(), QProblemB::getNV(), SubjectTo::getStatus(), SubjectTo::getType(), lbA, QProblemB::obtainAuxiliaryWorkingSet(), QProblemB::options, RET_INVALID_ARGUMENTS, RET_OBTAINING_WORKINGSET_FAILED, Constraints::setupConstraint(), ST_EQUALITY, ST_INACTIVE, ST_LOWER, ST_UPPER, SUCCESSFUL_RETURN, THROWERROR, and ubA.

Referenced by solveInitialQP().

◆ operator=()

QProblem & QProblem::operator= ( const QProblem rhs)
virtual

Assignment operator (deep copy).

Parameters
rhsRhs object.

References clear(), copy(), and QProblemB::operator=().

Referenced by SQProblem::operator=().

◆ performDriftCorrection()

returnValue QProblem::performDriftCorrection ( )
protectedvirtual

◆ performPlainRatioTest()

returnValue QProblem::performPlainRatioTest ( int_t  nIdx,
const int_t *const  idxList,
const real_t *const  num,
const real_t *const  den,
real_t  epsNum,
real_t  epsDen,
real_t t,
int_t BC_idx 
) const
protected

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

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

References SUCCESSFUL_RETURN.

Referenced by ensureNonzeroCurvature().

◆ performRamping()

returnValue QProblem::performRamping ( )
protectedvirtual

◆ performRatioTest()

returnValue QProblemB::performRatioTest ( int_t  nIdx,
const int_t *const  idxList,
const SubjectTo *const  subjectTo,
const real_t *const  num,
const real_t *const  den,
real_t  epsNum,
real_t  epsDen,
real_t t,
int_t BC_idx 
) const
protectedinherited

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/Constraint 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.

References BT_TRUE, SubjectTo::getStatus(), SubjectTo::getType(), QProblemB::isBlocking(), ST_EQUALITY, ST_INACTIVE, ST_LOWER, ST_UPPER, and SUCCESSFUL_RETURN.

Referenced by SQProblemSchur::addBound_ensureLI(), addBound_ensureLI(), SQProblemSchur::addConstraint_ensureLI(), addConstraint_ensureLI(), performStep(), and QProblemB::performStep().

◆ performStep()

returnValue QProblem::performStep ( const real_t *const  delta_g,
const real_t *const  delta_lbA,
const real_t *const  delta_ubA,
const real_t *const  delta_lb,
const real_t *const  delta_ub,
const real_t *const  delta_xFX,
const real_t *const  delta_xFR,
const real_t *const  delta_yAC,
const real_t *const  delta_yFX,
int_t BC_idx,
SubjectToStatus BC_status,
BooleanType BC_isBound 
)
protected

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

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

References __FILE__, __FUNC__, __LINE__, A, Ax, Ax_l, Ax_u, QProblemB::bounds, BT_FALSE, BT_TRUE, constraintProduct, constraints, Options::epsDen, Options::epsNum, QProblemB::g, Constraints::getActive(), Bounds::getFixed(), Bounds::getFree(), getGlobalMessageHandler(), Constraints::getInactive(), getMax(), getNAC(), getNC(), QProblemB::getNFR(), QProblemB::getNFX(), getNIAC(), Indexlist::getNumberArray(), QProblemB::getNV(), SubjectTo::getType(), SubjectTo::hasNoLower(), SubjectTo::hasNoUpper(), QProblemB::lb, lbA, MAX_STRING_LENGTH, QProblemB::options, QProblemB::performRatioTest(), real_t, RET_ERROR_IN_CONSTRAINTPRODUCT, RET_STEPSIZE, RET_STEPSIZE_NONPOSITIVE, ST_INACTIVE, ST_LOWER, ST_UNBOUNDED, ST_UNDEFINED, ST_UPPER, SUCCESSFUL_RETURN, QProblemB::tau, THROWERROR, MessageHandling::throwInfo(), MessageHandling::throwWarning(), Matrix::times(), QProblemB::ub, ubA, VS_VISIBLE, QProblemB::x, QProblemB::y, and ZERO.

Referenced by solveQP().

◆ printIteration()

returnValue QProblem::printIteration ( int_t  iter,
int_t  BC_idx,
SubjectToStatus  BC_status,
BooleanType  BC_isBound,
real_t  homotopyLength,
BooleanType  isFirstCall = BT_TRUE 
)
protected

Prints concise information on the current iteration.

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

References A, BT_TRUE, QProblemB::count, EPS, TabularOutput::excAddB, TabularOutput::excAddC, TabularOutput::excRemB, TabularOutput::excRemC, QProblemB::g, getAbs(), getNAC(), getNC(), QProblemB::getNFX(), QProblemB::getNV(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_ZERO, TabularOutput::idxAddB, TabularOutput::idxAddC, TabularOutput::idxRemB, TabularOutput::idxRemC, QProblemB::lb, lbA, MAX_STRING_LENGTH, myPrintf(), QProblemB::options, PL_DEBUG_ITER, PL_MEDIUM, PL_TABULAR, Options::printLevel, real_t, QProblemB::regVal, RET_INVALID_ARGUMENTS, sizeT, ST_INACTIVE, ST_UNDEFINED, SUCCESSFUL_RETURN, QProblemB::tabularOutput, QProblemB::tau, THROWERROR, Matrix::times(), Matrix::transTimes(), TT, QProblemB::ub, ubA, QProblemB::x, and QProblemB::y.

Referenced by solveQP().

◆ printOptions()

returnValue QProblemB::printOptions ( ) const
inherited

Prints a list of all options and their current values.

Returns
SUCCESSFUL_RETURN

References QProblemB::options, and Options::print().

Referenced by main().

◆ printProperties()

returnValue QProblem::printProperties ( )
virtual

◆ regulariseHessian()

returnValue QProblemB::regulariseHessian ( )
protectedinherited

◆ removeBound()

returnValue QProblem::removeBound ( int_t  number,
BooleanType  updateCholesky,
BooleanType  allowFlipping = BT_FALSE,
BooleanType  ensureNZC = BT_FALSE 
)
protectedvirtual

Removes a bounds from active set.

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

Reimplemented in SQProblemSchur.

References A, addBound(), addConstraint(), QProblemB::applyGivens(), QProblemB::backsolveR(), QProblemB::bounds, BT_FALSE, BT_TRUE, QProblemB::computeGivens(), constraints, Matrix::diag(), Options::enableFlippingBounds, ensureNonzeroCurvature(), EPS, Options::epsFlipping, TabularOutput::excAddB, TabularOutput::excAddC, Bounds::flipFixed(), QProblemB::flipper, Flipper::get(), Constraints::getActive(), Matrix::getCol(), Bounds::getFree(), getNAC(), QProblemB::getNFR(), Indexlist::getNumberArray(), QProblemB::getNV(), getNZ(), getSqrt(), SubjectTo::getStatus(), QProblemB::getStatus(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_SEMIDEF, HST_ZERO, TabularOutput::idxAddB, TabularOutput::idxRemB, QProblemB::lb, Bounds::moveFixedToFree(), QProblemB::options, Q, QPS_AUXILIARYQPSOLVED, QPS_HOMOTOPYQPSOLVED, QPS_NOTINITIALISED, QPS_SOLVED, QQ, QProblemB::R, real_t, RET_BOUND_NOT_ACTIVE, RET_HESSIAN_NOT_SPD, RET_MOVING_BOUND_FAILED, RET_REMOVEBOUND_FAILED, RET_UNKNOWN_BUG, RR, Flipper::set(), sizeT, ST_INACTIVE, ST_LOWER, ST_UPPER, SUCCESSFUL_RETURN, T, QProblemB::tabularOutput, THROWERROR, Matrix::times(), TT, QProblemB::ub, and ZERO.

Referenced by addBound_ensureLI(), addConstraint_ensureLI(), changeActiveSet(), dropInfeasibles(), setupAuxiliaryWorkingSet(), and updateActivitiesForHotstart().

◆ removeConstraint()

returnValue QProblem::removeConstraint ( int_t  number,
BooleanType  updateCholesky,
BooleanType  allowFlipping = BT_FALSE,
BooleanType  ensureNZC = BT_FALSE 
)
protectedvirtual

Removes a constraint from active set.

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

Reimplemented in SQProblemSchur.

References addBound(), addConstraint(), QProblemB::applyGivens(), Ax_l, Ax_u, QProblemB::backsolveR(), QProblemB::bounds, BT_FALSE, BT_TRUE, QProblemB::computeGivens(), constraints, Options::enableFlippingBounds, ensureNonzeroCurvature(), EPS, Options::epsFlipping, TabularOutput::excAddB, TabularOutput::excAddC, Constraints::flipFixed(), QProblemB::flipper, Flipper::get(), Constraints::getActive(), Bounds::getFree(), Indexlist::getIndex(), getNAC(), QProblemB::getNFR(), Indexlist::getNumberArray(), QProblemB::getNV(), getNZ(), getSqrt(), SubjectTo::getStatus(), QProblemB::getStatus(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_SEMIDEF, HST_ZERO, TabularOutput::idxAddC, TabularOutput::idxRemC, lbA, Constraints::moveActiveToInactive(), QProblemB::options, Q, QPS_AUXILIARYQPSOLVED, QPS_HOMOTOPYQPSOLVED, QPS_NOTINITIALISED, QPS_SOLVED, QQ, QProblemB::R, real_t, RET_CONSTRAINT_NOT_ACTIVE, RET_HESSIAN_NOT_SPD, RET_MOVING_BOUND_FAILED, RET_REMOVECONSTRAINT_FAILED, RET_UNKNOWN_BUG, RR, Flipper::set(), sizeT, ST_INACTIVE, ST_LOWER, ST_UPPER, SUCCESSFUL_RETURN, T, QProblemB::tabularOutput, THROWERROR, Matrix::times(), TT, ubA, and ZERO.

Referenced by addBound_ensureLI(), addConstraint_ensureLI(), changeActiveSet(), dropInfeasibles(), and setupAuxiliaryWorkingSet().

◆ reset()

returnValue QProblem::reset ( )
virtual

Clears all data structures of QProblemB except for QP data.

Returns
SUCCESSFUL_RETURN
RET_RESET_FAILED

Reimplemented from QProblemB.

Reimplemented in SQProblemSchur.

References constraintProduct, constraints, QProblemB::flipper, getNC(), QProblemB::getNV(), Constraints::init(), Flipper::init(), Q, QProblemB::reset(), RET_QPOBJECT_NOT_SETUP, RET_RESET_FAILED, sizeT, SUCCESSFUL_RETURN, T, and THROWERROR.

Referenced by init(), and SQProblemSchur::reset().

◆ resetCounter()

returnValue QProblemB::resetCounter ( )
inlineinherited

Resets QP problem counter (to zero).

Returns
SUCCESSFUL_RETURN.

References QProblemB::count, and SUCCESSFUL_RETURN.

◆ setA() [1/2]

returnValue QProblem::setA ( Matrix A_new)
inlineprotected

Sets constraint matrix of the QP.
Note: Also internal vector Ax is recomputed!

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
Parameters
A_newNew constraint matrix (a shallow copy is made).

References A, Ax, Ax_l, Ax_u, BT_FALSE, BT_TRUE, constraints, freeConstraintMatrix, getNC(), QProblemB::getNV(), Matrix::getRowNorm(), isZero(), lbA, RET_INVALID_ARGUMENTS, RET_QPOBJECT_NOT_SETUP, SubjectTo::setType(), ST_DISABLED, SUCCESSFUL_RETURN, tempC, THROWERROR, Matrix::times(), ubA, and QProblemB::x.

Referenced by SQProblemSchur::setupAuxiliaryQP(), SQProblem::setupNewAuxiliaryQP(), setupQPdata(), and setupQPdataFromFile().

◆ setA() [2/2]

returnValue QProblem::setA ( const real_t *const  A_new)
inlineprotected

Sets dense constraint matrix of the QP.
Note: Also internal vector Ax is recomputed!

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
Parameters
A_newNew dense constraint matrix (with correct dimension!), a shallow copy is made.

References A, Ax, Ax_l, Ax_u, BT_TRUE, freeConstraintMatrix, getNC(), QProblemB::getNV(), lbA, real_t, RET_INVALID_ARGUMENTS, RET_QPOBJECT_NOT_SETUP, SUCCESSFUL_RETURN, THROWERROR, Matrix::times(), ubA, and QProblemB::x.

◆ setConstraintProduct()

returnValue QProblem::setConstraintProduct ( ConstraintProduct *const  _constraintProduct)

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

Returns
SUCCESSFUL_RETURN

References constraintProduct, and SUCCESSFUL_RETURN.

Referenced by main().

◆ setG()

returnValue QProblemB::setG ( const real_t *const  g_new)
inlineprotectedinherited

Changes gradient vector of the QP.

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

Referenced by QProblemB::setupQPdata().

◆ setH() [1/2]

returnValue QProblemB::setH ( SymmetricMatrix H_new)
inlineprotectedinherited

Sets Hessian matrix of the QP.

Returns
SUCCESSFUL_RETURN
Parameters
H_newNew Hessian matrix (a shallow copy is made).

References BT_FALSE, BT_TRUE, QProblemB::freeHessian, QProblemB::H, and SUCCESSFUL_RETURN.

Referenced by SQProblemSchur::setupAuxiliaryQP(), SQProblem::setupNewAuxiliaryQP(), QProblemB::setupQPdata(), and QProblemB::setupQPdataFromFile().

◆ setH() [2/2]

returnValue QProblemB::setH ( const real_t *const  H_new)
inlineprotectedinherited

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

Returns
SUCCESSFUL_RETURN
Parameters
H_newNew dense Hessian matrix (with correct dimension!), a shallow copy is made.

References BT_FALSE, BT_TRUE, QProblemB::freeHessian, QProblemB::getNV(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_ZERO, real_t, and SUCCESSFUL_RETURN.

◆ setHessianType()

returnValue QProblemB::setHessianType ( HessianType  _hessianType)
inlineinherited

Changes the print level.

Returns
SUCCESSFUL_RETURN
Parameters
_hessianTypeNew Hessian type.

References QProblemB::hessianType, and SUCCESSFUL_RETURN.

◆ setInfeasibilityFlag()

returnValue QProblemB::setInfeasibilityFlag ( returnValue  returnvalue,
BooleanType  doThrowError = BT_FALSE 
)
protectedinherited

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.

References BT_FALSE, BT_TRUE, Options::enableFarBounds, QProblemB::infeasible, QProblemB::options, and THROWERROR.

Referenced by SQProblemSchur::addBound_ensureLI(), addBound_ensureLI(), SQProblemSchur::addConstraint_ensureLI(), addConstraint_ensureLI(), QProblemB::hotstart(), hotstart(), solveQP(), and QProblemB::solveQP().

◆ setLB() [1/2]

returnValue QProblemB::setLB ( const real_t *const  lb_new)
inlineprotectedinherited

Changes lower bound vector of the QP.

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

Referenced by QProblemB::setupQPdata().

◆ setLB() [2/2]

returnValue QProblemB::setLB ( int_t  number,
real_t  value 
)
inlineprotectedinherited

Changes single entry of lower bound vector of the QP.

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

References QProblemB::getNV(), QProblemB::lb, RET_INDEX_OUT_OF_BOUNDS, RET_QPOBJECT_NOT_SETUP, SUCCESSFUL_RETURN, and THROWERROR.

◆ setLBA() [1/2]

returnValue QProblem::setLBA ( const real_t *const  lbA_new)
inlineprotected

Sets constraints' lower bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
Parameters
lbA_newNew constraints' lower bound vector (with correct dimension!).

Referenced by setupQPdata().

◆ setLBA() [2/2]

returnValue QProblem::setLBA ( int_t  number,
real_t  value 
)
inlineprotected

Changes single entry of lower constraints' bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
RET_INDEX_OUT_OF_BOUNDS
Parameters
numberNumber of entry to be changed.
valueNew value for entry of lower constraints' bound vector (with correct dimension!).

References getNC(), QProblemB::getNV(), lbA, RET_INDEX_OUT_OF_BOUNDS, RET_QPOBJECT_NOT_SETUP, SUCCESSFUL_RETURN, and THROWERROR.

◆ setOptions()

returnValue QProblemB::setOptions ( const Options _options)
inlineinherited

Overrides current options with given ones.

Returns
SUCCESSFUL_RETURN
Parameters
_optionsNew options.

References Options::ensureConsistency(), QProblemB::options, Options::printLevel, QProblemB::setPrintLevel(), and SUCCESSFUL_RETURN.

Referenced by main(), and solveOqpBenchmark().

◆ setPrintLevel()

returnValue QProblemB::setPrintLevel ( PrintLevel  _printlevel)
inherited

◆ setUB() [1/2]

returnValue QProblemB::setUB ( const real_t *const  ub_new)
inlineprotectedinherited

Changes upper bound vector of the QP.

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

Referenced by QProblemB::setupQPdata().

◆ setUB() [2/2]

returnValue QProblemB::setUB ( int_t  number,
real_t  value 
)
inlineprotectedinherited

Changes single entry of upper bound vector of the QP.

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

References QProblemB::getNV(), RET_INDEX_OUT_OF_BOUNDS, RET_QPOBJECT_NOT_SETUP, SUCCESSFUL_RETURN, THROWERROR, and QProblemB::ub.

◆ setUBA() [1/2]

returnValue QProblem::setUBA ( const real_t *const  ubA_new)
inlineprotected

Sets constraints' upper bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
Parameters
ubA_newNew constraints' upper bound vector (with correct dimension!).

Referenced by setupQPdata().

◆ setUBA() [2/2]

returnValue QProblem::setUBA ( int_t  number,
real_t  value 
)
inlineprotected

Changes single entry of upper constraints' bound vector of the QP.

Returns
SUCCESSFUL_RETURN
RET_QPOBJECT_NOT_SETUP
RET_INDEX_OUT_OF_BOUNDS
Parameters
numberNumber of entry to be changed.
valueNew value for entry of upper constraints' bound vector (with correct dimension!).

References getNC(), QProblemB::getNV(), RET_INDEX_OUT_OF_BOUNDS, RET_QPOBJECT_NOT_SETUP, SUCCESSFUL_RETURN, THROWERROR, and ubA.

◆ setupAuxiliaryQP() [1/3]

returnValue QProblemB::setupAuxiliaryQP
protected

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

Returns
SUCCESSFUL_RETURN
RET_SETUP_AUXILIARYQP_FAILED
RET_INVALID_ARGUMENTS

◆ setupAuxiliaryQP() [2/3]

returnValue QProblem::setupAuxiliaryQP ( const Bounds *const  guessedBounds,
const Constraints *const  guessedConstraints 
)
protectedvirtual

◆ setupAuxiliaryQP() [3/3]

returnValue QProblemB::setupAuxiliaryQP ( const Bounds *const  guessedBounds)
protectedvirtualinherited

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.

References QProblemB::bounds, BT_FALSE, BT_TRUE, QProblemB::computeCholesky(), QProblemB::getNV(), SubjectTo::getStatus(), Bounds::init(), QPS_PREPARINGAUXILIARYQP, RET_SETUP_AUXILIARYQP_FAILED, Bounds::setupAllFree(), QProblemB::setupAuxiliaryQPbounds(), QProblemB::setupAuxiliaryQPgradient(), QProblemB::setupAuxiliaryWorkingSet(), QProblemB::setupSubjectToType(), QProblemB::shallRefactorise(), ST_INACTIVE, QProblemB::status, SUCCESSFUL_RETURN, THROWERROR, and QProblemB::y.

Referenced by QProblemB::hotstart().

◆ setupAuxiliaryQPbounds()

returnValue QProblem::setupAuxiliaryQPbounds ( const Bounds *const  auxiliaryBounds,
const Constraints *const  auxiliaryConstraints,
BooleanType  useRelaxation 
)
protected

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

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

References Ax_l, Ax_u, Options::boundRelaxation, QProblemB::bounds, BT_TRUE, constraints, getNC(), QProblemB::getNV(), SubjectTo::getStatus(), SubjectTo::getType(), QProblemB::lb, lbA, QProblemB::options, RET_UNKNOWN_BUG, ST_EQUALITY, ST_INACTIVE, ST_INFEASIBLE_LOWER, ST_INFEASIBLE_UPPER, ST_LOWER, ST_UPPER, SUCCESSFUL_RETURN, THROWERROR, QProblemB::ub, ubA, and QProblemB::x.

Referenced by setupAuxiliaryQP(), SQProblem::setupNewAuxiliaryQP(), and solveInitialQP().

◆ setupAuxiliaryQPgradient()

returnValue QProblem::setupAuxiliaryQPgradient ( )
protected

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

Returns
SUCCESSFUL_RETURN

References A, BT_FALSE, QProblemB::g, getNC(), QProblemB::getNV(), QProblemB::H, QProblemB::hessianType, HST_IDENTITY, HST_ZERO, QProblemB::regVal, SUCCESSFUL_RETURN, Matrix::times(), Matrix::transTimes(), QProblemB::usingRegularisation(), QProblemB::x, and QProblemB::y.

Referenced by performDriftCorrection(), performRamping(), SQProblemSchur::setupAuxiliaryQP(), setupAuxiliaryQP(), SQProblem::setupNewAuxiliaryQP(), and solveInitialQP().

◆ setupAuxiliaryQPsolution()

returnValue QProblem::setupAuxiliaryQPsolution ( const real_t *const  xOpt,
const real_t *const  yOpt 
)
protected

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.

References A, Ax, Ax_l, Ax_u, getNC(), QProblemB::getNV(), SUCCESSFUL_RETURN, Matrix::times(), QProblemB::x, and QProblemB::y.

Referenced by solveInitialQP().

◆ setupAuxiliaryWorkingSet()

returnValue QProblem::setupAuxiliaryWorkingSet ( const Bounds *const  auxiliaryBounds,
const Constraints *const  auxiliaryConstraints,
BooleanType  setupAfresh 
)
protectedvirtual

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

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

Reimplemented in SQProblemSchur.

References addBound(), addBound_checkLI(), addConstraint(), addConstraint_checkLI(), QProblemB::bounds, BT_FALSE, BT_TRUE, constraints, Options::enableFullLITests, Options::enableNZCTests, Options::epsLITests, getNC(), QProblemB::getNV(), SubjectTo::getStatus(), SubjectTo::getType(), Bounds::moveFreeToFixed(), QProblemB::options, real_t, removeBound(), removeConstraint(), RET_INVALID_ARGUMENTS, RET_LINEARLY_INDEPENDENT, RET_SETUP_WORKINGSET_FAILED, RET_UNKNOWN_BUG, SubjectTo::setType(), ST_BOUNDED, ST_EQUALITY, ST_INACTIVE, ST_LOWER, ST_UNDEFINED, ST_UPPER, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by setupAuxiliaryQP(), SQProblem::setupNewAuxiliaryQP(), and solveInitialQP().

◆ setupInitialCholesky()

returnValue QProblem::setupInitialCholesky ( )
protectedvirtual

Computes initial Cholesky decomposition of the projected Hessian making use of the function computeCholesky() or computeProjectedCholesky().

Returns
SUCCESSFUL_RETURN
RET_HESSIAN_NOT_SPD
RET_INDEXLIST_CORRUPTED

Reimplemented from QProblemB.

References BT_TRUE, computeProjectedCholesky(), Options::enableRegularisation, QProblemB::getNFR(), QProblemB::getNFV(), QProblemB::getNV(), QProblemB::haveCholesky, QProblemB::options, QProblemB::regulariseHessian(), RET_HESSIAN_NOT_SPD, RET_INIT_FAILED_CHOLESKY, RET_INIT_FAILED_REGULARISATION, and SUCCESSFUL_RETURN.

Referenced by hotstart().

◆ setupQPdata() [1/4]

returnValue QProblemB::setupQPdata ( SymmetricMatrix _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub 
)
protectedinherited

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.

References RET_INVALID_ARGUMENTS, QProblemB::setG(), QProblemB::setH(), QProblemB::setLB(), QProblemB::setUB(), SUCCESSFUL_RETURN, and THROWERROR.

Referenced by QProblemB::init(), and setupQPdata().

◆ setupQPdata() [2/4]

returnValue QProblemB::setupQPdata ( const real_t *const  _H,
const real_t *const  _g,
const real_t *const  _lb,
const real_t *const  _ub 
)
protectedinherited

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.

References RET_INVALID_ARGUMENTS, QProblemB::setG(), QProblemB::setH(), QProblemB::setLB(), QProblemB::setUB(), SUCCESSFUL_RETURN, and THROWERROR.

◆ setupQPdata() [3/4]

returnValue QProblem::setupQPdata ( SymmetricMatrix _H,
const real_t *const  _g,
Matrix _A,
const real_t *const  _lb,
const real_t *const  _ub,
const real_t *const  _lbA,
const real_t *const  _ubA 
)
protected

Sets up internal QP data.

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

References getNC(), and QProblemB::getNV().

Referenced by init().

◆ setupQPdata() [4/4]

returnValue QProblem::setupQPdata ( const real_t *const  _H,
const real_t *const  _g,
const real_t *const  _A,
const real_t *const  _lb,
const real_t *const  _ub,
const real_t *const  _lbA,
const real_t *const  _ubA 
)
protected

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

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

References getNC(), RET_INVALID_ARGUMENTS, setA(), setLBA(), setUBA(), QProblemB::setupQPdata(), SUCCESSFUL_RETURN, and THROWERROR.

◆ setupQPdataFromFile() [1/2]

returnValue QProblemB::setupQPdataFromFile ( const char *const  H_file,
const char *const  g_file,
const char *const  lb_file,
const char *const  ub_file 
)
protectedinherited

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.

References Matrix::doFreeMemory(), QProblemB::g, QProblemB::getNV(), QProblemB::H, INFTY, QProblemB::lb, readFromFile(), real_t, RET_INVALID_ARGUMENTS, QProblemB::setH(), SUCCESSFUL_RETURN, THROWERROR, and QProblemB::ub.

Referenced by QProblemB::init(), and setupQPdataFromFile().

◆ setupQPdataFromFile() [2/2]

returnValue QProblem::setupQPdataFromFile ( const char *const  H_file,
const char *const  g_file,
const char *const  A_file,
const char *const  lb_file,
const char *const  ub_file,
const char *const  lbA_file,
const char *const  ubA_file 
)
protected

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

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

References A, Matrix::doFreeMemory(), getNC(), QProblemB::getNV(), INFTY, lbA, readFromFile(), real_t, RET_INVALID_ARGUMENTS, setA(), QProblemB::setupQPdataFromFile(), SUCCESSFUL_RETURN, THROWERROR, and ubA.

Referenced by init().

◆ setupSubjectToType() [1/5]

returnValue QProblemB::setupSubjectToType ( const real_t *const  lb_new,
const real_t *const  ub_new 
)
protectedvirtualinherited

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.

References QProblemB::bounds, Options::boundTolerance, BT_FALSE, BT_TRUE, Options::enableEqualities, Options::enableFarBounds, QProblemB::getNV(), INFTY, QProblemB::lb, QProblemB::options, SubjectTo::setNoLower(), SubjectTo::setNoUpper(), SubjectTo::setType(), ST_BOUNDED, ST_EQUALITY, ST_UNBOUNDED, SUCCESSFUL_RETURN, and QProblemB::ub.

◆ setupSubjectToType() [2/5]

returnValue QProblem::setupSubjectToType ( )
protectedvirtual

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

Returns
SUCCESSFUL_RETURN
RET_SETUPSUBJECTTOTYPE_FAILED

Reimplemented from QProblemB.

References QProblemB::lb, lbA, QProblemB::ub, and ubA.

Referenced by setupAuxiliaryQP(), SQProblem::setupNewAuxiliaryQP(), and solveInitialQP().

◆ setupSubjectToType() [3/5]

returnValue QProblemB::setupSubjectToType
protected

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

Returns
SUCCESSFUL_RETURN
RET_SETUPSUBJECTTOTYPE_FAILED

◆ setupSubjectToType() [4/5]

returnValue QProblemB::setupSubjectToType
protected

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

Returns
SUCCESSFUL_RETURN
RET_SETUPSUBJECTTOTYPE_FAILED

◆ setupSubjectToType() [5/5]

returnValue QProblem::setupSubjectToType ( const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new 
)
protectedvirtual

◆ setupTQfactorisation()

returnValue QProblem::setupTQfactorisation ( )
protectedvirtual

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

Returns
SUCCESSFUL_RETURN
RET_INDEXLIST_CORRUPTED

Reimplemented in SQProblemSchur.

References QProblemB::bounds, Bounds::getFree(), QProblemB::getNFR(), Indexlist::getNumberArray(), QProblemB::getNV(), Q, QQ, sizeT, SUCCESSFUL_RETURN, and T.

Referenced by setupAuxiliaryQP(), SQProblem::setupNewAuxiliaryQP(), and solveInitialQP().

◆ shallRefactorise()

BooleanType QProblem::shallRefactorise ( const Bounds *const  guessedBounds,
const Constraints *const  guessedConstraints 
) const
protected

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

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

References QProblemB::bounds, BT_FALSE, BT_TRUE, constraints, Constraints::getNAC(), getNC(), Bounds::getNFX(), QProblemB::getNV(), SubjectTo::getStatus(), QProblemB::hessianType, HST_INDEF, and HST_SEMIDEF.

Referenced by setupAuxiliaryQP().

◆ solveCurrentEQP()

returnValue QProblem::solveCurrentEQP ( const int_t  n_rhs,
const real_t g_in,
const real_t lb_in,
const real_t ub_in,
const real_t lbA_in,
const real_t ubA_in,
real_t x_out,
real_t y_out 
)

Solves an equality-constrained QP problem resulting from the current working set.

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

References QProblemB::bounds, BT_FALSE, constraints, determineStepDirection(), Constraints::getActive(), Bounds::getFixed(), Bounds::getFree(), getNAC(), getNC(), QProblemB::getNFR(), QProblemB::getNFX(), Indexlist::getNumberArray(), QProblemB::getNV(), real_t, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and THROWERROR.

Referenced by main().

◆ solveInitialQP()

returnValue QProblem::solveInitialQP ( const real_t *const  xOpt,
const real_t *const  yOpt,
const Bounds *const  guessedBounds,
const Constraints *const  guessedConstraints,
const real_t *const  _R,
int_t nWSR,
real_t *const  cputime 
)
protected

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

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

References QProblemB::bounds, BT_FALSE, BT_TRUE, constraints, QProblemB::determineHessianType(), Options::enableRamping, QProblemB::g, getCPUtime(), getNC(), QProblemB::getNV(), QProblemB::haveCholesky, QProblemB::hessianType, hotstart(), HST_SEMIDEF, HST_ZERO, Options::initialStatusBounds, QProblemB::isInfeasible(), QProblemB::isUnbounded(), QProblemB::lb, lbA, obtainAuxiliaryWorkingSet(), QProblemB::options, performRamping(), QPS_AUXILIARYQPSOLVED, QPS_NOTINITIALISED, QPS_PREPARINGAUXILIARYQP, QProblemB::R, real_t, QProblemB::regulariseHessian(), RET_INIT_FAILED, RET_INIT_FAILED_HOTSTART, RET_INIT_FAILED_INFEASIBILITY, RET_INIT_FAILED_REGULARISATION, RET_INIT_FAILED_TQ, RET_INIT_FAILED_UNBOUNDEDNESS, RET_INIT_SUCCESSFUL, RET_MAX_NWSR_REACHED, RET_NO_CHOLESKY_WITH_INITIAL_GUESS, RR, Bounds::setupAllFree(), Constraints::setupAllInactive(), setupAuxiliaryQPbounds(), setupAuxiliaryQPgradient(), setupAuxiliaryQPsolution(), setupAuxiliaryWorkingSet(), setupSubjectToType(), setupTQfactorisation(), ST_INACTIVE, QProblemB::status, SUCCESSFUL_RETURN, THROWERROR, THROWINFO, THROWWARNING, QProblemB::ub, and ubA.

Referenced by init().

◆ solveQP()

returnValue QProblem::solveQP ( const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new,
int_t nWSR,
real_t *const  cputime,
int_t  nWSRperformed = 0,
BooleanType  isFirstCall = BT_TRUE 
)
protected

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

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

References __FILE__, __FUNC__, __LINE__, BT_FALSE, BT_TRUE, changeActiveSet(), computeProjectedCholesky(), determineDataShift(), determineStepDirection(), Options::enableCholeskyRefactorisation, Options::enableDriftCorrection, Options::enableRamping, EPS, TabularOutput::excAddB, TabularOutput::excAddC, TabularOutput::excRemB, TabularOutput::excRemC, getCPUtime(), getGlobalMessageHandler(), getNC(), QProblemB::getNV(), getRelativeHomotopyLength(), QProblemB::getStatus(), TabularOutput::idxAddB, TabularOutput::idxAddC, TabularOutput::idxRemB, TabularOutput::idxRemC, QProblemB::infeasible, QProblemB::isCPUtimeLimitExceeded(), QProblemB::isInfeasible(), MAX_STRING_LENGTH, QProblemB::options, performDriftCorrection(), performRamping(), performStep(), PL_HIGH, printIteration(), Options::printLevel, QPS_HOMOTOPYQPSOLVED, QPS_NOTINITIALISED, QPS_PERFORMINGHOMOTOPY, QPS_PREPARINGAUXILIARYQP, QPS_SOLVED, real_t, RET_HOMOTOPY_STEP_FAILED, RET_HOTSTART_FAILED, RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED, RET_HOTSTART_STOPPED_INFEASIBILITY, RET_HOTSTART_STOPPED_UNBOUNDEDNESS, RET_ITERATION_STARTED, RET_MAX_NWSR_REACHED, RET_OPTIMAL_SOLUTION_FOUND, RET_PRINT_ITERATION_FAILED, RET_SHIFT_DETERMINATION_FAILED, RET_STEPDIRECTION_DETERMINATION_FAILED, RET_STEPLENGTH_DETERMINATION_FAILED, QProblemB::setInfeasibilityFlag(), ST_UNDEFINED, QProblemB::status, SUCCESSFUL_RETURN, QProblemB::tabularOutput, QProblemB::tau, Options::terminationTolerance, THROWERROR, MessageHandling::throwInfo(), THROWINFO, MessageHandling::throwWarning(), QProblemB::unbounded, updateActivitiesForHotstart(), and VS_VISIBLE.

Referenced by solveRegularisedQP().

◆ solveRegularisedQP()

returnValue QProblem::solveRegularisedQP ( const real_t *const  g_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new,
int_t nWSR,
real_t *const  cputime,
int_t  nWSRperformed = 0,
BooleanType  isFirstCall = BT_TRUE 
)
protected

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

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

References BT_FALSE, QProblemB::g, QProblemB::getNV(), Options::numRegularisationSteps, QProblemB::options, real_t, QProblemB::regVal, RET_FEWER_REGSTEPS_NWSR, RET_MAX_NWSR_REACHED, RET_NO_REGSTEP_NWSR, solveQP(), SUCCESSFUL_RETURN, THROWWARNING, QProblemB::usingRegularisation(), and QProblemB::x.

Referenced by hotstart().

◆ updateActivitiesForHotstart()

returnValue QProblem::updateActivitiesForHotstart ( const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new 
)
protectedvirtual

Update activities in a hot start if some of the bounds have become infinity or if variables have become fixed.

Parameters
lb_newNew lower bounds.
ub_newNew upper bounds.
lbA_newNew lower constraints' bounds.
ubA_newNew upper constraints' bounds.

References addBound(), addBound_checkLI(), Options::boundRelaxation, QProblemB::bounds, BT_FALSE, BT_TRUE, Options::enableNZCTests, QProblemB::g, QProblemB::getNV(), SubjectTo::getStatus(), SubjectTo::getType(), INFTY, QProblemB::lb, QProblemB::options, removeBound(), RET_LINEARLY_INDEPENDENT, RET_SETUPSUBJECTTOTYPE_FAILED, QProblemB::setupSubjectToType(), ST_EQUALITY, ST_INACTIVE, ST_LOWER, ST_UPPER, SUCCESSFUL_RETURN, THROWERROR, QProblemB::ub, QProblemB::x, and QProblemB::y.

Referenced by solveQP().

◆ updateFarBounds() [1/2]

returnValue QProblemB::updateFarBounds ( real_t  curFarBound,
int_t  nRamp,
const real_t *const  lb_new,
real_t *const  lb_new_far,
const real_t *const  ub_new,
real_t *const  ub_new_far 
) const
protectedinherited

...

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

References BT_TRUE, Options::enableRamping, getMax(), getMin(), QProblemB::getNV(), QProblemB::options, QProblemB::ramp0, QProblemB::ramp1, QProblemB::rampOffset, real_t, and SUCCESSFUL_RETURN.

Referenced by QProblemB::hotstart(), and updateFarBounds().

◆ updateFarBounds() [2/2]

returnValue QProblem::updateFarBounds ( real_t  curFarBound,
int_t  nRamp,
const real_t *const  lb_new,
real_t *const  lb_new_far,
const real_t *const  ub_new,
real_t *const  ub_new_far,
const real_t *const  lbA_new,
real_t *const  lbA_new_far,
const real_t *const  ubA_new,
real_t *const  ubA_new_far 
) const
protected

...

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

References BT_TRUE, Options::enableRamping, getMax(), getMin(), getNC(), QProblemB::getNV(), QProblemB::options, QProblemB::ramp0, QProblemB::ramp1, QProblemB::rampOffset, real_t, SUCCESSFUL_RETURN, and QProblemB::updateFarBounds().

Referenced by hotstart().

◆ usingRegularisation()

BooleanType QProblemB::usingRegularisation ( ) const
inlineinherited

◆ writeQpDataIntoMatFile()

returnValue QProblem::writeQpDataIntoMatFile ( const char *const  filename) const

...

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
Parameters
filenameMat file name.

References A, Matrix::full(), QProblemB::g, getNC(), QProblemB::getNV(), QProblemB::H, QProblemB::lb, lbA, real_t, RET_NOT_YET_IMPLEMENTED, RET_UNABLE_TO_OPEN_FILE, SUCCESSFUL_RETURN, QProblemB::ub, ubA, and writeIntoMatFile().

◆ writeQpWorkspaceIntoMatFile()

returnValue QProblem::writeQpWorkspaceIntoMatFile ( const char *const  filename)

Member Data Documentation

◆ A

Matrix* QProblem::A
protected

◆ Ax

real_t* QProblem::Ax
protected

◆ Ax_l

real_t* QProblem::Ax_l
protected

◆ Ax_u

real_t* QProblem::Ax_u
protected

◆ bounds

Bounds QProblemB::bounds
protectedinherited

Data structure for problem's bounds.

Referenced by SQProblemSchur::addBound(), addBound(), QProblemB::addBound(), SQProblemSchur::addBound_checkLISchur(), SQProblemSchur::addBound_ensureLI(), addBound_ensureLI(), addConstraint(), addConstraint_checkLI(), SQProblemSchur::addConstraint_checkLISchur(), SQProblemSchur::addConstraint_ensureLI(), addConstraint_ensureLI(), SolutionAnalysis::checkCurvatureOnStronglyActiveConstraints(), QProblemB::computeCholesky(), computeProjectedCholesky(), SQProblemSchur::correctInertia(), QProblemB::determineDataShift(), determineDataShift(), determineStepDirection(), QProblemB::determineStepDirection(), SQProblemSchur::determineStepDirection2(), dropInfeasibles(), ensureNonzeroCurvature(), QProblemB::getBounds(), getFreeVariablesFlags(), QProblemB::getNFR(), QProblemB::getNFV(), QProblemB::getNFX(), QProblemB::getNV(), SolutionAnalysis::getVarianceCovariance(), QProblemB::getWorkingSetBounds(), hotstart(), QProblemB::obtainAuxiliaryWorkingSet(), performDriftCorrection(), QProblemB::performDriftCorrection(), QProblemB::performRamping(), performRamping(), performStep(), QProblemB::performStep(), printProperties(), QProblemB::printProperties(), QProblemB::QProblemB(), SQProblemSchur::removeBound(), removeBound(), QProblemB::removeBound(), removeConstraint(), SQProblemSchur::repairSingularWorkingSet(), QProblemB::reset(), setupAuxiliaryQP(), QProblemB::setupAuxiliaryQP(), setupAuxiliaryQPbounds(), QProblemB::setupAuxiliaryQPbounds(), SQProblemSchur::setupAuxiliaryWorkingSet(), setupAuxiliaryWorkingSet(), QProblemB::setupAuxiliaryWorkingSet(), SQProblem::setupNewAuxiliaryQP(), QProblemB::setupSubjectToType(), setupTQfactorisation(), shallRefactorise(), QProblemB::shallRefactorise(), solveCurrentEQP(), solveInitialQP(), QProblemB::solveInitialQP(), updateActivitiesForHotstart(), and writeQpWorkspaceIntoMatFile().

◆ constraintProduct

ConstraintProduct* QProblem::constraintProduct
protected

Pointer to user-defined constraint product function.

Referenced by performStep(), QProblem(), reset(), and setConstraintProduct().

◆ constraints

Constraints QProblem::constraints
protected

◆ count

uint_t QProblemB::count
protectedinherited

◆ delta_xFR_TMP

real_t* QProblemB::delta_xFR_TMP
protectedinherited

◆ delta_xFRy

real_t* QProblem::delta_xFRy
protected

Temporary for determineStepDirection.

Referenced by clear(), determineStepDirection(), and QProblem().

◆ delta_xFRz

real_t* QProblem::delta_xFRz
protected

Temporary for determineStepDirection.

Referenced by clear(), determineStepDirection(), and QProblem().

◆ delta_yAC_TMP

real_t* QProblem::delta_yAC_TMP
protected

Temporary for determineStepDirection.

Referenced by clear(), determineStepDirection(), and QProblem().

◆ flipper

Flipper QProblemB::flipper
protectedinherited

Struct for making a temporary copy of the matrix factorisations.

Referenced by QProblem(), QProblemB::QProblemB(), removeBound(), QProblemB::removeBound(), removeConstraint(), reset(), and QProblemB::reset().

◆ freeConstraintMatrix

BooleanType QProblem::freeConstraintMatrix
protected

Flag indicating whether the constraint matrix needs to be de-allocated.

Referenced by clear(), QProblem(), setA(), and SQProblem::setupNewAuxiliaryQP().

◆ freeHessian

BooleanType QProblemB::freeHessian
protectedinherited

Flag indicating whether the Hessian matrix needs to be de-allocated.

Referenced by QProblemB::clear(), QProblemB::QProblemB(), QProblemB::setH(), and SQProblem::setupNewAuxiliaryQP().

◆ g

real_t* QProblemB::g
protectedinherited

◆ H

SymmetricMatrix* QProblemB::H
protectedinherited

◆ haveCholesky

BooleanType QProblemB::haveCholesky
protectedinherited

◆ hessianType

HessianType QProblemB::hessianType
protectedinherited

◆ infeasible

BooleanType QProblemB::infeasible
protectedinherited

◆ lb

real_t* QProblemB::lb
protectedinherited

◆ lbA

real_t* QProblem::lbA
protected

◆ options

Options QProblemB::options
protectedinherited

Struct containing all user-defined options for solving QPs.

Referenced by SQProblemSchur::addBound(), addBound_checkLI(), SQProblemSchur::addBound_checkLISchur(), SQProblemSchur::addBound_ensureLI(), addBound_ensureLI(), SQProblemSchur::addConstraint(), addConstraint_checkLI(), SQProblemSchur::addConstraint_checkLISchur(), SQProblemSchur::addConstraint_ensureLI(), addConstraint_ensureLI(), changeActiveSet(), SQProblemSchur::correctInertia(), SQProblemSchur::deleteFromSchurComplement(), QProblemB::determineHessianType(), determineStepDirection(), QProblemB::determineStepDirection(), SQProblemSchur::determineStepDirection2(), dropInfeasibles(), ensureNonzeroCurvature(), QProblemB::getOptions(), QProblemB::getPrintLevel(), QProblemB::hotstart(), hotstart(), QProblemB::obtainAuxiliaryWorkingSet(), obtainAuxiliaryWorkingSet(), performStep(), QProblemB::performStep(), printIteration(), QProblemB::printIteration(), QProblemB::printOptions(), printProperties(), QProblemB::printProperties(), QProblemB::QProblemB(), QProblemB::regulariseHessian(), SQProblemSchur::removeBound(), removeBound(), QProblemB::removeBound(), SQProblemSchur::removeConstraint(), removeConstraint(), SQProblemSchur::repairSingularWorkingSet(), QProblemB::reset(), SQProblemSchur::resetSchurComplement(), QProblemB::setInfeasibilityFlag(), QProblemB::setOptions(), QProblemB::setPrintLevel(), SQProblemSchur::setupAuxiliaryQP(), setupAuxiliaryQPbounds(), QProblemB::setupAuxiliaryQPbounds(), SQProblemSchur::setupAuxiliaryWorkingSet(), setupAuxiliaryWorkingSet(), QProblemB::setupInitialCholesky(), setupInitialCholesky(), SQProblem::setupNewAuxiliaryQP(), QProblemB::setupSubjectToType(), setupSubjectToType(), solveInitialQP(), QProblemB::solveInitialQP(), solveQP(), QProblemB::solveQP(), solveRegularisedQP(), QProblemB::solveRegularisedQP(), SQProblemSchur::undoDeleteFromSchurComplement(), updateActivitiesForHotstart(), QProblemB::updateFarBounds(), and updateFarBounds().

◆ Q

real_t* QProblem::Q
protected

◆ R

real_t* QProblemB::R
protectedinherited

◆ ramp0

real_t QProblemB::ramp0
protectedinherited

◆ ramp1

real_t QProblemB::ramp1
protectedinherited

◆ rampOffset

int_t QProblemB::rampOffset
protectedinherited

◆ regVal

real_t QProblemB::regVal
protectedinherited

◆ sizeT

int_t QProblem::sizeT
protected

◆ status

QProblemStatus QProblemB::status
protectedinherited

◆ T

real_t* QProblem::T
protected

Reverse triangular matrix, A = [0 T]*Q'.

Referenced by clear(), QProblem(), removeBound(), removeConstraint(), reset(), setupTQfactorisation(), and writeQpWorkspaceIntoMatFile().

◆ tabularOutput

TabularOutput QProblemB::tabularOutput
protectedinherited

◆ tau

real_t QProblemB::tau
protectedinherited

◆ tempA

real_t* QProblem::tempA
protected

Temporary for determineStepDirection.

Referenced by clear(), determineStepDirection(), and QProblem().

◆ tempB

real_t* QProblem::tempB
protected

Temporary for determineStepDirection.

Referenced by clear(), determineStepDirection(), and QProblem().

◆ tempC

real_t* QProblem::tempC
protected

Temporary for constraint types.

Referenced by clear(), QProblem(), and setA().

◆ ub

real_t* QProblemB::ub
protectedinherited

◆ ubA

real_t* QProblem::ubA
protected

◆ unbounded

BooleanType QProblemB::unbounded
protectedinherited

◆ x

real_t* QProblemB::x
protectedinherited

◆ y

real_t* QProblemB::y
protectedinherited

◆ ZFR_delta_xFRz

real_t* QProblem::ZFR_delta_xFRz
protected

Temporary for determineStepDirection.

Referenced by clear(), determineStepDirection(), and QProblem().


The documentation for this class was generated from the following files: