44#include <visp3/core/vpConfig.h>
45#include <visp3/core/vpLinProg.h>
46#include <visp3/core/vpMatrix.h>
47#include <visp3/core/vpMatrixException.h>
73#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
76 bool solveQPe(const vpMatrix &Q, const vpColVector &r, vpColVector &x, const double &tol = 1e-6) const;
79 bool use_equality =
false,
const double &tol = 1e-6);
96 const double &tol = 1e-6);
98 const double &tol = 1e-6);
124 const double &tol = 1e-6);
145 unsigned int n = Q.getCols();
146 const bool Ab = (A !=
nullptr && b !=
nullptr && A->
getRows());
147 const bool Cd = (C !=
nullptr && d !=
nullptr && C->
getRows());
150 (Cd && C->
getRows() != d->getRows()) || Q.getRows() != r.getRows()) {
151 std::cout <<
"vpQuadProg::" << fct <<
": wrong dimension\n"
152 <<
"Q: " << Q.getRows() <<
"x" << Q.getCols() <<
" - r: " << r.getRows() << std::endl;
156 std::cout <<
"C: " << C->
getRows() <<
"x" << C->
getCols() <<
" - d: " << d->getRows() << std::endl;
unsigned int getCols() const
unsigned int getRows() const
Implementation of column vector and the associated operations.
@ dimensionError
Bad dimension.
Implementation of a matrix and operations on matrices.
This class provides a solver for Quadratic Programs.
std::vector< unsigned int > inactive
std::vector< unsigned int > active
bool solveQP(const vpMatrix &Q, const vpColVector &r, vpMatrix A, vpColVector b, const vpMatrix &C, const vpColVector &d, vpColVector &x, const double &tol=1e-6)
static unsigned int checkDimensions(const vpMatrix &Q, const vpColVector &r, const vpMatrix *A, const vpColVector *b, const vpMatrix *C, const vpColVector *d, const std::string fct)
bool setEqualityConstraint(const vpMatrix &A, const vpColVector &b, const double &tol=1e-6)
static vpColVector solveSVDorQR(const vpMatrix &A, const vpColVector &b)
bool solveQPi(const vpMatrix &Q, const vpColVector &r, const vpMatrix &C, const vpColVector &d, vpColVector &x, bool use_equality=false, const double &tol=1e-6)
static bool solveByProjection(const vpMatrix &Q, const vpColVector &r, vpMatrix &A, vpColVector &b, vpColVector &x, const double &tol=1e-6)