#include <Tasks/GenQPSolver.h>
Public Member Functions | |
virtual | ~GenQPSolver () |
virtual void | updateSize (int nrVars, int nrEq, int nrInEq, int nrGenInEq)=0 |
virtual void | setDependencies (int nrVars, std::vector< std::tuple< int, int, double >> dependencies) |
virtual void | updateMatrix (const std::vector< Task * > &tasks, const std::vector< Equality * > &eqConstr, const std::vector< Inequality * > &inEqConstr, const std::vector< GenInequality * > &genInEqConstr, const std::vector< Bound * > &boundConstr)=0 |
virtual bool | solve ()=0 |
virtual const Eigen::VectorXd & | result () const =0 |
virtual std::ostream & | errorMsg (const std::vector< rbd::MultiBody > &mbs, const std::vector< Task * > &tasks, const std::vector< Equality * > &eqConstr, const std::vector< Inequality * > &inEqConstr, const std::vector< GenInequality * > &genInEqConstr, const std::vector< Bound * > &boundConstr, std::ostream &out) const =0 |
virtual std::string | name () const =0 |
Static Public Attributes | |
static const std::string | default_qp_solver |
Default QP solver. More... | |
Protected Attributes | |
std::vector< int > | fullToReduced_ |
std::vector< int > | reducedToFull_ |
std::vector< std::tuple< int, int, double > > | dependencies_ |
Eigen::SparseMatrix< double > | multipliers_ |
Generic QP solver abstract interface. Solve the following problem:
\begin{align} \underset{x}{\text{minimize }} & \frac{1}{2} x^T Q x + x^T c\\ \text{s.t. } & L \leq \left\{ \begin{array}{c} x \\ A x \end{array} \right\} \leq U \end{align}
|
inlinevirtual |
|
pure virtual |
Implemented in tasks::qp::LSSOLQPSolver, and tasks::qp::QLDQPSolver.
|
pure virtual |
Implemented in tasks::qp::LSSOLQPSolver, and tasks::qp::QLDQPSolver.
|
pure virtual |
Implemented in tasks::qp::LSSOLQPSolver, and tasks::qp::QLDQPSolver.
|
virtual |
Setup dependent variables, only linear dependencies are supported
nrVars | Variable number. |
dependencies | List of tuple {primary, replica, factor, offset} |
|
pure virtual |
Solve the quadratic program.
Implemented in tasks::qp::LSSOLQPSolver, and tasks::qp::QLDQPSolver.
|
pure virtual |
Construct the QP matrices.
tasks | Build \( Q \) and \( c \). |
eqConstr | Build \( A x = b \) constraints. |
inEqConstr | Build \( A x \geq b \) constraints. |
genInEqConstr | Build \( L \leq A x \leq U \) constraints. |
boundConstr | Build \( L \leq x \leq U \) constraints. |
Implemented in tasks::qp::LSSOLQPSolver, and tasks::qp::QLDQPSolver.
|
pure virtual |
Update the problem size.
nrVars | Variable number. |
nrEq | maximum number of equality. |
nrInEq | maximum number of inequality. |
nrGenInEq | maximum number of general inequality. |
Implemented in tasks::qp::LSSOLQPSolver, and tasks::qp::QLDQPSolver.
|
static |
Default QP solver.
|
protected |
Variable dependencies, each tuple gives the primary variable index in the full variable, replica variable index in the full variable and the factor and offset in the dependency equation: replica = factor * primary
|
protected |
Correspondence between full variable indices and reduced variables
|
protected |
Multipliers matrix M of size (nFull, nReduced) such that full = M * reduce
|
protected |
Correspondence between reduced variable indices and full variable indices