Implements the online active set strategy for QPs with varying matrices. More...
#include <SQProblem.hpp>
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) |
SQProblem & | operator= (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 |
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.
Definition at line 59 of file SQProblem.hpp.
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.
_nV | Number of variables. |
_nC | Number of constraints. |
_hessianType | Type of Hessian matrix. |
Definition at line 59 of file SQProblem.cpp.
SQProblem::SQProblem | ( | const SQProblem & | rhs | ) |
Copy constructor (deep copy).
rhs | Rhs object. |
Definition at line 67 of file SQProblem.cpp.
SQProblem::~SQProblem | ( | ) | [virtual] |
Destructor.
Definition at line 75 of file SQProblem.cpp.
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.
H_new | Hessian matrix of neighbouring QP to be solved. If Hessian matrix is trivial, a NULL pointer can be passed. |
g_new | Gradient of neighbouring QP to be solved. |
A_new | Constraint matrix of neighbouring QP to be solved. If QP sequence does not involve constraints, a NULL pointer can be passed. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
lbA_new | Lower constraints' bounds of neighbouring QP to be solved. If no lower constraints' bounds exist, a NULL pointer can be passed. |
ubA_new | Upper constraints' bounds of neighbouring QP to be solved. If no upper constraints' bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time 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.
H_file | Name of file where Hessian matrix is stored. If Hessian matrix is trivial, a NULL pointer can be passed. |
g_file | Name of file where gradient, of neighbouring QP to be solved, is stored. |
A_file | Name of file where constraint matrix is stored. If QP sequence does not involve constraints, a NULL pointer can be passed. |
lb_file | Name of file where lower bounds, of neighbouring QP to be solved, is stored. If no lower bounds exist, a NULL pointer can be passed. |
ub_file | Name of file where upper bounds, of neighbouring QP to be solved, is stored. If no upper bounds exist, a NULL pointer can be passed. |
lbA_file | Name 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_file | Name 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. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time 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.
H_new | Hessian matrix of neighbouring QP to be solved. If Hessian matrix is trivial, a NULL pointer can be passed. |
g_new | Gradient of neighbouring QP to be solved. |
A_new | Constraint matrix of neighbouring QP to be solved. If QP sequence does not involve constraints, a NULL pointer can be passed. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
lbA_new | Lower constraints' bounds of neighbouring QP to be solved. If no lower constraints' bounds exist, a NULL pointer can be passed. |
ubA_new | Upper constraints' bounds of neighbouring QP to be solved. If no upper constraints' bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time 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.
g_new | Gradient of neighbouring QP to be solved. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
lbA_new | Lower constraints' bounds of neighbouring QP to be solved. If no lower constraints' bounds exist, a NULL pointer can be passed. |
ubA_new | Upper constraints' bounds of neighbouring QP to be solved. If no upper constraints' bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time 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.
g_file | Name of file where gradient, of neighbouring QP to be solved, is stored. |
lb_file | Name of file where lower bounds, of neighbouring QP to be solved, is stored. If no lower bounds exist, a NULL pointer can be passed. |
ub_file | Name of file where upper bounds, of neighbouring QP to be solved, is stored. If no upper bounds exist, a NULL pointer can be passed. |
lbA_file | Name 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_file | Name 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. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time 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.
g_new | Gradient of neighbouring QP to be solved. |
lb_new | Lower bounds of neighbouring QP to be solved. If no lower bounds exist, a NULL pointer can be passed. |
ub_new | Upper bounds of neighbouring QP to be solved. If no upper bounds exist, a NULL pointer can be passed. |
lbA_new | Lower constraints' bounds of neighbouring QP to be solved. If no lower constraints' bounds exist, a NULL pointer can be passed. |
ubA_new | Upper constraints' bounds of neighbouring QP to be solved. If no upper constraints' bounds exist, a NULL pointer can be passed. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time spend for QP solution (or to perform nWSR iterations). |
guessedBounds | Initial guess for working set of bounds. A null pointer corresponds to an empty working set! |
guessedConstraints | Initial 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.
g_file | Name of file where gradient, of neighbouring QP to be solved, is stored. |
lb_file | Name of file where lower bounds, of neighbouring QP to be solved, is stored. If no lower bounds exist, a NULL pointer can be passed. |
ub_file | Name of file where upper bounds, of neighbouring QP to be solved, is stored. If no upper bounds exist, a NULL pointer can be passed. |
lbA_file | Name 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_file | Name 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. |
nWSR | Input: Maximum number of working set recalculations; Output: Number of performed working set recalculations. |
cputime | Input: Maximum CPU time allowed for QP solution. Output: CPU time spend for QP solution (or to perform nWSR iterations). |
guessedBounds | Initial guess for working set of bounds. A null pointer corresponds to an empty working set! |
guessedConstraints | Initial 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.
Assignment operator (deep copy).
rhs | Rhs 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.
H_new | New Hessian matrix. If Hessian matrix is trivial, a NULL pointer can be passed. |
A_new | New 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.
H_new | New Hessian matrix. If Hessian matrix is trivial, a NULL pointer can be passed. |
A_new | New constraint matrix. If QP sequence does not involve constraints, a NULL pointer can be passed. |
Definition at line 371 of file SQProblem.cpp.
friend class SolutionAnalysis [friend] |
Reimplemented from QProblem.
Definition at line 62 of file SQProblem.hpp.