qp_solver_collection
Public Types | Public Member Functions | Protected Attributes | List of all members
QpSolverCollection::QpSolver Class Referenceabstract

Virtual class of QP solver. More...

#include <QpSolverCollection.h>

Inheritance diagram for QpSolverCollection::QpSolver:
Inheritance graph
[legend]

Public Types

using clock = typename std::conditional< std::chrono::high_resolution_clock::is_steady, std::chrono::high_resolution_clock, std::chrono::steady_clock >::type
 

Public Member Functions

 QpSolver ()
 Constructor. More...
 
void printInfo (bool verbose=false, const std::string &header="") const
 Print information. More...
 
virtual Eigen::VectorXd solve (int dim_var, int dim_eq, int dim_ineq, Eigen::Ref< Eigen::MatrixXd > Q, const Eigen::Ref< const Eigen::VectorXd > &c, const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::VectorXd > &b, const Eigen::Ref< const Eigen::MatrixXd > &C, const Eigen::Ref< const Eigen::VectorXd > &d, const Eigen::Ref< const Eigen::VectorXd > &x_min, const Eigen::Ref< const Eigen::VectorXd > &x_max)=0
 Solve QP. More...
 
virtual Eigen::VectorXd solve (QpCoeff &qp_coeff)
 Solve QP. More...
 
QpSolverType type () const
 Get QP solver type. More...
 
bool solveFailed () const
 Get whether it failed to solve the QP. More...
 

Protected Attributes

QpSolverType type_ = QpSolverType::Uninitialized
 QP solver type. More...
 
bool solve_failed_ = false
 Whether it failed to solve the QP. More...
 

Detailed Description

Virtual class of QP solver.

Definition at line 192 of file QpSolverCollection.h.

Member Typedef Documentation

◆ clock

using QpSolverCollection::QpSolver::clock = typename std::conditional<std::chrono::high_resolution_clock::is_steady, std::chrono::high_resolution_clock, std::chrono::steady_clock>::type

Definition at line 197 of file QpSolverCollection.h.

Constructor & Destructor Documentation

◆ QpSolver()

QpSolverCollection::QpSolver::QpSolver ( )
inline

Constructor.

Definition at line 201 of file QpSolverCollection.h.

Member Function Documentation

◆ printInfo()

void QpSolverCollection::QpSolver::printInfo ( bool  verbose = false,
const std::string &  header = "" 
) const

Print information.

◆ solve() [1/2]

virtual Eigen::VectorXd QpSolverCollection::QpSolver::solve ( int  dim_var,
int  dim_eq,
int  dim_ineq,
Eigen::Ref< Eigen::MatrixXd >  Q,
const Eigen::Ref< const Eigen::VectorXd > &  c,
const Eigen::Ref< const Eigen::MatrixXd > &  A,
const Eigen::Ref< const Eigen::VectorXd > &  b,
const Eigen::Ref< const Eigen::MatrixXd > &  C,
const Eigen::Ref< const Eigen::VectorXd > &  d,
const Eigen::Ref< const Eigen::VectorXd > &  x_min,
const Eigen::Ref< const Eigen::VectorXd > &  x_max 
)
pure virtual

Solve QP.

Parameters
dim_vardimension of decision variable
dim_eqdimension of equality constraint
dim_ineqdimension of inequality constraint
Qobjective matrix (LSSOL requires non-const for Q)
cobjective vector
Aequality constraint matrix
bequality constraint vector
Cinequality constraint matrix
dinequality constraint vector
x_minlower bound
x_maxupper bound

QP is formulated as follows:

\begin{align*} & min_{\boldsymbol{x}} \ \frac{1}{2}{\boldsymbol{x}^T \boldsymbol{Q} \boldsymbol{x}} + {\boldsymbol{c}^T \boldsymbol{x}} \\ & s.t. \ \ \boldsymbol{A} \boldsymbol{x} = \boldsymbol{b} \nonumber \\ & \phantom{s.t.} \ \ \boldsymbol{C} \boldsymbol{x} \leq \boldsymbol{d} \nonumber \\ & \phantom{s.t.} \ \ \boldsymbol{x}_{min} \leq \boldsymbol{x} \leq \boldsymbol{x}_{max} \nonumber \end{align*}

Todo:
Support both-sided inequality constraints (i.e., \(\boldsymbol{d}_{lower} \leq \boldsymbol{C} \boldsymbol{x} \leq \boldsymbol{d}_{upper}\)). QLD, QuadProg, and NASOQ support only one-sided constraints, while LSSOL, JRLQP, QPOASES, OSQP, HPIPM, PROXQP, and QPMAD support both-sided constraints.

Implemented in QpSolverCollection::QpSolverQpmad, QpSolverCollection::QpSolverProxqp, QpSolverCollection::QpSolverHpipm, QpSolverCollection::QpSolverNasoq, QpSolverCollection::QpSolverOsqp, QpSolverCollection::QpSolverQpoases, QpSolverCollection::QpSolverJrlqp, QpSolverCollection::QpSolverLssol, QpSolverCollection::QpSolverQuadprog, and QpSolverCollection::QpSolverQld.

◆ solve() [2/2]

virtual Eigen::VectorXd QpSolverCollection::QpSolver::solve ( QpCoeff qp_coeff)
virtual

Solve QP.

Parameters
qp_coeffQP coefficient

◆ solveFailed()

bool QpSolverCollection::QpSolver::solveFailed ( ) const
inline

Get whether it failed to solve the QP.

Definition at line 256 of file QpSolverCollection.h.

◆ type()

QpSolverType QpSolverCollection::QpSolver::type ( ) const
inline

Get QP solver type.

Definition at line 250 of file QpSolverCollection.h.

Member Data Documentation

◆ solve_failed_

bool QpSolverCollection::QpSolver::solve_failed_ = false
protected

Whether it failed to solve the QP.

Definition at line 266 of file QpSolverCollection.h.

◆ type_

QpSolverType QpSolverCollection::QpSolver::type_ = QpSolverType::Uninitialized
protected

QP solver type.

Definition at line 263 of file QpSolverCollection.h.


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