Public Member Functions | Protected Member Functions | Friends
SQProblem Class Reference

Implements the online active set strategy for QPs with varying matrices. More...

#include <SQProblem.hpp>

Inheritance diagram for SQProblem:
Inheritance graph
[legend]

List of all members.

Public Member Functions

returnValue hotstart (const real_t *const H_new, const real_t *const g_new, const real_t *const A_new, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new, int &nWSR, real_t *const cputime)
returnValue hotstart (const char *const H_file, const char *const g_file, const char *const A_file, const char *const lb_file, const char *const ub_file, const char *const lbA_file, const char *const ubA_file, int &nWSR, real_t *const cputime)
returnValue hotstart (SymmetricMatrix *H_new, const real_t *const g_new, Matrix *A_new, const real_t *const lb_new, const real_t *const ub_new, const real_t *const lbA_new, const real_t *const ubA_new, int &nWSR, real_t *const cputime)
returnValue 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 &nWSR, real_t *const cputime)
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 &nWSR, real_t *const cputime)
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 &nWSR, real_t *const cputime, const Bounds *const guessedBounds, const Constraints *const guessedConstraints)
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 &nWSR, real_t *const cputime, const Bounds *const guessedBounds, const Constraints *const guessedConstraints)
SQProblemoperator= (const SQProblem &rhs)
 SQProblem ()
 SQProblem (int _nV, int _nC, HessianType _hessianType=HST_UNKNOWN)
 SQProblem (const SQProblem &rhs)
virtual ~SQProblem ()

Protected Member Functions

virtual returnValue setupAuxiliaryQP (const real_t *const H_new, const real_t *const A_new)
virtual returnValue setupAuxiliaryQP (SymmetricMatrix *H_new, Matrix *A_new)

Friends

class SolutionAnalysis

Detailed Description

Implements the online active set strategy for QPs with varying matrices.

A class for setting up and solving quadratic programs with varying QP matrices. 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.0beta
Date:
2007-2011

Definition at line 59 of file SQProblem.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 51 of file SQProblem.cpp.

SQProblem::SQProblem ( int  _nV,
int  _nC,
HessianType  _hessianType = HST_UNKNOWN 
)

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

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

Definition at line 59 of file SQProblem.cpp.

SQProblem::SQProblem ( const SQProblem rhs)

Copy constructor (deep copy).

Parameters:
rhsRhs object.

Definition at line 67 of file SQProblem.cpp.

SQProblem::~SQProblem ( ) [virtual]

Destructor.

Definition at line 75 of file SQProblem.cpp.


Member Function Documentation

returnValue SQProblem::hotstart ( const real_t *const  H_new,
const real_t *const  g_new,
const real_t *const  A_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new,
int &  nWSR,
real_t *const  cputime 
)

Solves an initialised SQProblem using online active set strategy.

Returns:
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_MATRIX_SHIFT_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:
H_newHessian matrix of neighbouring QP to be solved.
If Hessian matrix is trivial, a NULL pointer can be passed.
g_newGradient of neighbouring QP to be solved.
A_newConstraint matrix of neighbouring QP to be solved.
If QP sequence does not involve constraints, a NULL pointer can be passed.
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 spend for QP solution (or to perform nWSR iterations).

Definition at line 97 of file SQProblem.cpp.

returnValue SQProblem::hotstart ( const char *const  H_file,
const char *const  g_file,
const char *const  A_file,
const char *const  lb_file,
const char *const  ub_file,
const char *const  lbA_file,
const char *const  ubA_file,
int &  nWSR,
real_t *const  cputime 
)

Solves an initialised SQProblem using online active set strategy reading QP data from files.

Returns:
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_MATRIX_SHIFT_FAILED
RET_SHIFT_DETERMINATION_FAILED
RET_STEPDIRECTION_DETERMINATION_FAILED
RET_STEPLENGTH_DETERMINATION_FAILED
RET_HOMOTOPY_STEP_FAILED
RET_HOTSTART_STOPPED_INFEASIBILITY
RET_HOTSTART_STOPPED_UNBOUNDEDNESS
RET_SETUP_AUXILIARYQP_FAILED
RET_UNABLE_TO_READ_FILE
RET_INVALID_ARGUMENTS
Parameters:
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, of neighbouring QP to be solved, is stored.
A_fileName of file where constraint matrix is stored.
If QP sequence does not involve constraints, a NULL pointer can be passed.
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 spend for QP solution (or to perform nWSR iterations).

Definition at line 140 of file SQProblem.cpp.

returnValue SQProblem::hotstart ( SymmetricMatrix H_new,
const real_t *const  g_new,
Matrix A_new,
const real_t *const  lb_new,
const real_t *const  ub_new,
const real_t *const  lbA_new,
const real_t *const  ubA_new,
int &  nWSR,
real_t *const  cputime 
)

Solves an initialised SQProblem using online active set strategy.

Returns:
SUCCESSFUL_RETURN
RET_MAX_NWSR_REACHED
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED
RET_HOTSTART_FAILED
RET_MATRIX_SHIFT_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:
H_newHessian matrix of neighbouring QP to be solved.
If Hessian matrix is trivial, a NULL pointer can be passed.
g_newGradient of neighbouring QP to be solved.
A_newConstraint matrix of neighbouring QP to be solved.
If QP sequence does not involve constraints, a NULL pointer can be passed.
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 spend for QP solution (or to perform nWSR iterations).

Definition at line 226 of file SQProblem.cpp.

returnValue SQProblem::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 &  nWSR,
real_t *const  cputime 
)

Solves an initialised SQProblem (without matrix shift) using online active set strategy. Note: This functions just forwards to the corresponding QProblem::hotstart member function.

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 spend for QP solution (or to perform nWSR iterations).

Reimplemented from QProblem.

Definition at line 275 of file SQProblem.cpp.

returnValue SQProblem::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 &  nWSR,
real_t *const  cputime 
)

Solves an initialised SQProblem (without matrix shift) using online active set strategy reading QP data from files. Note: This functions just forwards to the corresponding QProblem::hotstart member function.

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
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 spend for QP solution (or to perform nWSR iterations).

Reimplemented from QProblem.

Definition at line 289 of file SQProblem.cpp.

returnValue SQProblem::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 &  nWSR,
real_t *const  cputime,
const Bounds *const  guessedBounds,
const Constraints *const  guessedConstraints 
)

Solves an initialised SQProblem (without matrix shift) using online active set strategy (using an initialised homotopy). Note: This functions just forwards to the corresponding QProblem::hotstart member function.

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_WORKINGSET_UPDATE_FAILED
Parameters:
g_newGradient of neighbouring QP to be solved.
lb_newLower bounds of neighbouring QP to be solved.
If no lower bounds exist, a NULL pointer can be passed.
ub_newUpper bounds of neighbouring QP to be solved.
If no upper bounds exist, a NULL pointer can be passed.
lbA_newLower constraints' bounds of neighbouring QP to be solved.
If no lower constraints' bounds exist, a NULL pointer can be passed.
ubA_newUpper constraints' bounds of neighbouring QP to be solved.
If no upper constraints' bounds exist, a NULL pointer can be passed.
nWSRInput: Maximum number of working set recalculations;
Output: Number of performed working set recalculations.
cputimeInput: Maximum CPU time allowed for QP solution.
Output: CPU time spend for QP solution (or to perform nWSR iterations).
guessedBoundsInitial guess for working set of bounds. A null pointer corresponds to an empty working set!
guessedConstraintsInitial guess for working set of constraints. A null pointer corresponds to an empty working set!

Reimplemented from QProblem.

Definition at line 303 of file SQProblem.cpp.

returnValue SQProblem::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 &  nWSR,
real_t *const  cputime,
const Bounds *const  guessedBounds,
const Constraints *const  guessedConstraints 
)

Solves an initialised SQProblem (without matrix shift) using online active set strategy (using an initialised homotopy) reading QP data from files. Note: This functions just forwards to the corresponding QProblem::hotstart member function.

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_WORKINGSET_UPDATE_FAILED
RET_UNABLE_TO_READ_FILE
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 spend for QP solution (or to perform nWSR iterations).
guessedBoundsInitial guess for working set of bounds. A null pointer corresponds to an empty working set!
guessedConstraintsInitial guess for working set of constraints. A null pointer corresponds to an empty working set!

Reimplemented from QProblem.

Definition at line 318 of file SQProblem.cpp.

SQProblem & SQProblem::operator= ( const SQProblem rhs)

Assignment operator (deep copy).

Parameters:
rhsRhs object.

Definition at line 83 of file SQProblem.cpp.

returnValue SQProblem::setupAuxiliaryQP ( const real_t *const  H_new,
const real_t *const  A_new 
) [protected, virtual]

Sets new matrices and calculates their factorisations. 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. Afterwards, all QP vectors are transformed in order to start from an optimal solution.

Returns:
SUCCESSFUL_RETURN
RET_MATRIX_FACTORISATION_FAILED
RET_NO_HESSIAN_SPECIFIED
Parameters:
H_newNew Hessian matrix.
If Hessian matrix is trivial, a NULL pointer can be passed.
A_newNew constraint matrix.
If QP sequence does not involve constraints, a NULL pointer can be passed.

Definition at line 350 of file SQProblem.cpp.

returnValue SQProblem::setupAuxiliaryQP ( SymmetricMatrix H_new,
Matrix A_new 
) [protected, virtual]

Sets new matrices and calculates their factorisations. 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. Afterwards, all QP vectors are transformed in order to start from an optimal solution.

Returns:
SUCCESSFUL_RETURN
RET_MATRIX_FACTORISATION_FAILED
RET_NO_HESSIAN_SPECIFIED
Parameters:
H_newNew Hessian matrix.
If Hessian matrix is trivial, a NULL pointer can be passed.
A_newNew constraint matrix.
If QP sequence does not involve constraints, a NULL pointer can be passed.

Definition at line 371 of file SQProblem.cpp.


Friends And Related Function Documentation

friend class SolutionAnalysis [friend]

Reimplemented from QProblem.

Definition at line 62 of file SQProblem.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:26