A wrapper of the ql algorithm by Professor Schittkowski, with some convention changes on the way the constraints are written. More...
#include <eigen-qld/QLD.h>
Public Member Functions | |
EIGEN_QLD_API | QLD () |
EIGEN_QLD_API | QLD (int nrvar, int nreq, int nrineq, int ldq=-1, bool verbose=false) |
EIGEN_QLD_API void | problem (int nrvar, int nreq, int nrineq, int ldq=-1) |
EIGEN_QLD_API const VectorXd & | multipliers () const |
template<typename MatObj , typename VecObj , typename MatEq , typename VecEq , typename MatIneq , typename VecIneq , typename VecVar > | |
bool | solve (const MatrixBase< MatObj > &Q, const MatrixBase< VecObj > &c, const MatrixBase< MatEq > &Aeq, const MatrixBase< VecEq > &beq, const MatrixBase< MatIneq > &Aineq, const MatrixBase< VecIneq > &bineq, const MatrixBase< VecVar > &xl, const MatrixBase< VecVar > &xu, bool isDecomp=false, double eps=1e-12) |
![]() | |
EIGEN_QLD_API | QLDDirect () |
EIGEN_QLD_API | QLDDirect (int nrvar, int nreq, int nrineq, int ldq=-1, int lda=-1, bool verbose=false) |
EIGEN_QLD_API void | fdOut (int fd) |
EIGEN_QLD_API int | fdOut () const |
EIGEN_QLD_API void | verbose (bool v) |
EIGEN_QLD_API bool | verbose () const |
EIGEN_QLD_API int | fail () const |
EIGEN_QLD_API void | problem (int nrvar, int nreq, int nrineq, int ldq=-1, int lda=-1) |
EIGEN_QLD_API const VectorXd & | result () const |
EIGEN_QLD_API const VectorXd & | multipliers () const |
template<typename MatObj , typename VecObj , typename MatConstr , typename VecConstr , typename VecVar > | |
bool | solve (const MatrixBase< MatObj > &Q, const MatrixBase< VecObj > &c, const MatrixBase< MatConstr > &A, const MatrixBase< VecConstr > &b, const MatrixBase< VecVar > &xl, const MatrixBase< VecVar > &xu, int nreq, bool isDecomp=false, double eps=1e-12) |
A wrapper of the ql algorithm by Professor Schittkowski, with some convention changes on the way the constraints are written.
EIGEN_QLD_API Eigen::QLD::QLD | ( | ) |
Create a solver without allocating memory. A call to QLD::problem will be necessary before calling QLD::solve
EIGEN_QLD_API Eigen::QLD::QLD | ( | int | nrvar, |
int | nreq, | ||
int | nrineq, | ||
int | ldq = -1 , |
||
bool | verbose = false |
||
) |
Create a solver and allocate the memory necessary to solve a problem with the given dimensions. See also QLD::problem
EIGEN_QLD_API const VectorXd& Eigen::QLD::multipliers | ( | ) | const |
Return the lagrange multipliers associated with results, with the multipliers corresponding to equality constraints first, then to inequality constraints, then lower bounds, then upper bounds.
EIGEN_QLD_API void Eigen::QLD::problem | ( | int | nrvar, |
int | nreq, | ||
int | nrineq, | ||
int | ldq = -1 |
||
) |
Allocate the memory necessary to solve a problem with the given dimensions.
nrvar | Size of the variable vector \(x\). |
nreq | Number of equality constraints, i.e. the row size of \(A_{eq}\). |
nrineq | Number of inequality constraints, i.e. the row size of \(A_{ineq}\). |
ldq | Leading dimension of the matrix \(Q\) (see QLDDirect::problem). If smaller than nrvar , nrvar will be used instead (which is the default case). |
|
inline |
Solve the problem
\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} \\ & \ x_l \leq x \leq x_u \end{align}
For a positive definite matrix \(Q\), we have the Cholesky decomposition \(Q = R^T R\) with \(R\) upper triangular. If isDecomp
is true, \(R\) should be given instead of \(Q\). Only the upper triangular part of \(R\) will be used.
Q | The matrix \(Q\), or its Cholesky factor \(R\) if isDecomp is true. \(Q\) should be symmetric and positive definite, \(R\) should be upper triangular. |
c | The vector \(c\). |
Aeq | The matrix \(A_{eq}\). |
beq | The vector \(b_{eq}\). |
Aineq | The matrix \(A_{ineq}\). |
bineq | The vector \(b_{ineq}\). |
xl | The vector \(x_{l}\). |
xu | The vector \(x_{u}\). |
isDecomp | specify if the Cholesky decomposition of \(Q\) is used or not. |
eps | Desired final accuracy. |
This is a wrapper around QLDDirect::solver.