Sparse quadratic program. More...
#include <QuadProg.h>
Public Member Functions | |
| EIGEN_QUADPROG_API | QuadProgSparse () |
| Default constructor. | |
| EIGEN_QUADPROG_API | QuadProgSparse (int nrvar, int nreq, int nrineq) |
| Constructor with problem dimensions. | |
| EIGEN_QUADPROG_API void | problem (int nrvar, int nreq, int nrineq) |
| Set problem dimensions. | |
| EIGEN_QUADPROG_API bool | solve (const MatrixXd &Q, const VectorXd &C, const SparseMatrix< double > &Aeq, const VectorXd &Beq, const SparseMatrix< double > &Aineq, const VectorXd &Bineq, bool isDecomp=false) |
| Solve quadratic program. | |
Public Member Functions inherited from Eigen::QuadProgCommon | |
| EIGEN_QUADPROG_API | QuadProgCommon () |
| Default constructor. | |
| EIGEN_QUADPROG_API const VectorXi & | iter () const |
| Two-dimensional iteration vector. | |
| EIGEN_QUADPROG_API int | fail () const |
| Failure code, 0 is success. | |
| EIGEN_QUADPROG_API const VectorXd & | result () const |
| Solution found by the solver. | |
| EIGEN_QUADPROG_API void | problem (int nrvar, int nreq, int nrineq) |
| Set problem dimensions. | |
Additional Inherited Members | |
Protected Member Functions inherited from Eigen::QuadProgCommon | |
| void | fillQCBf (int nreq, int nrineq, const MatrixXd &Q, const VectorXd &C, const VectorXd &Beq, const VectorXd &Bineq, bool isDecomp) |
Protected Attributes inherited from Eigen::QuadProgCommon | |
| MatrixXd | Q_ |
| Cost function matrix. | |
| VectorXd | C_ |
| Cost function vector. | |
| VectorXd | B_ |
| Inequality constraint vector. | |
| VectorXd | X_ |
| Solution of the quadratic program. | |
| int | fail_ |
| Failure code, 0 is success. | |
| VectorXi | iact_ |
| Vector of constraints that are active in solution. | |
| VectorXi | iter_ |
| 2x1 vector, first component gives the number of "main" iterations, the second one says how many constraints were deleted after they became active | |
| VectorXd | work_ |
| Working space vector with length at least \(2n+r(r+5)/2+2q+1\) where \(r=\min(n,q)\). | |
Sparse quadratic program.
\begin{align} \underset{{x} \in \mathbb{R}^n}{\text{minimize}} & \ \frac{1}{2}{x^TQx} + {c^Tx} \nonumber \\ \text{subject to} & \ A_{eq} x = b_{eq} \\ & \ A_{ineq} x \leq b_{ineq} \end{align}
| EIGEN_QUADPROG_API Eigen::QuadProgSparse::QuadProgSparse | ( | ) |
Default constructor.
| EIGEN_QUADPROG_API Eigen::QuadProgSparse::QuadProgSparse | ( | int | nrvar, |
| int | nreq, | ||
| int | nrineq | ||
| ) |
Constructor with problem dimensions.
| nrvar | Dimension \(n\) of optimization vector \(x \in \mathbb{R}^n\). |
| nreq | Number of equality constraints, i.e. number of lines of \(A_{eq}\) and \(b_{eq}\). |
| nrineq | Number of inequality constraints, i.e. number of lines of \(A_{ineq}\) and \(b_{ineq}\). |
| EIGEN_QUADPROG_API void Eigen::QuadProgSparse::problem | ( | int | nrvar, |
| int | nreq, | ||
| int | nrineq | ||
| ) |
Set problem dimensions.
| nrvar | Dimension \(n\) of optimization vector \(x \in \mathbb{R}^n\). |
| nreq | Number of equality constraints, i.e. number of lines of \(A_{eq}\) and \(b_{eq}\). |
| nrineq | Number of inequality constraints, i.e. number of lines of \(A_{ineq}\) and \(b_{ineq}\). |
| EIGEN_QUADPROG_API bool Eigen::QuadProgSparse::solve | ( | const MatrixXd & | Q, |
| const VectorXd & | C, | ||
| const SparseMatrix< double > & | Aeq, | ||
| const VectorXd & | Beq, | ||
| const SparseMatrix< double > & | Aineq, | ||
| const VectorXd & | Bineq, | ||
| bool | isDecomp = false |
||
| ) |
Solve quadratic program.
| Q | Cost function matrix. |
| C | Cost function vector. |
| Aeq | Matrix of equality constraints \(A_{eq} x = b_{eq}\). |
| Beq | Vector of equality constraints \(A_{eq} x = b_{eq}\). |
| Aineq | Matrix of equality constraints \(A_{ineq} x \leq b_{ineq}\). |
| Bineq | Vector of equality constraints \(A_{ineq} x \leq b_{ineq}\). |
| isDecomp | If false (default), Q is not decomposed. If true, the solver will assume that Q is already decomposed into \(Q = R^T R\) and it is given \(R^{-1}\). |