ocra-recipes
Doxygen documentation for the ocra-recipes repository
|
Functions | |
double | solve_quadprog (const Eigen::MatrixXd &_G, const Eigen::VectorXd &g0, const Eigen::MatrixXd &_CE, const Eigen::VectorXd &ce0, const Eigen::MatrixXd &_CI, const Eigen::VectorXd &ci0, Eigen::VectorXd &x) |
void | compute_d (Eigen::VectorXd &d, const Eigen::MatrixXd &J, const Eigen::VectorXd &np) |
void | update_z (Eigen::VectorXd &z, const Eigen::MatrixXd &J, const Eigen::VectorXd &d, int iq) |
void | update_r (const Eigen::MatrixXd &R, Eigen::VectorXd &r, const Eigen::VectorXd &d, int iq) |
bool | add_constraint (Eigen::MatrixXd &R, Eigen::MatrixXd &J, Eigen::VectorXd &d, int &iq, double &rnorm) |
void | delete_constraint (Eigen::MatrixXd &R, Eigen::MatrixXd &J, Eigen::VectorXi &A, Eigen::VectorXd &u, int n, int p, int &iq, int l) |
void | cholesky_decomposition (Eigen::MatrixXd &A) |
void | cholesky_solve (const Eigen::MatrixXd &L, Eigen::VectorXd &x, const Eigen::VectorXd &b) |
void | forward_elimination (const Eigen::MatrixXd &L, Eigen::VectorXd &y, const Eigen::VectorXd &b) |
void | backward_elimination (const Eigen::MatrixXd &U, Eigen::VectorXd &x, const Eigen::VectorXd &y) |
double | scalar_product (const Eigen::VectorXd &x, const Eigen::VectorXd &y) |
double | distance (double a, double b) |
void | print_matrix (const char *name, const Eigen::MatrixXd &A, int n=-1, int m=-1) |
template<typename T > | |
void | print_vector (const char *name, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, int n=-1) |
bool QuadProgPP::add_constraint | ( | Eigen::MatrixXd & | R, |
Eigen::MatrixXd & | J, | ||
Eigen::VectorXd & | d, | ||
int & | iq, | ||
double & | rnorm | ||
) |
Definition at line 566 of file QuadProg++.cpp.
|
inline |
Definition at line 804 of file QuadProg++.cpp.
void QuadProgPP::cholesky_decomposition | ( | Eigen::MatrixXd & | A | ) |
Definition at line 745 of file QuadProg++.cpp.
void QuadProgPP::cholesky_solve | ( | const Eigen::MatrixXd & | L, |
Eigen::VectorXd & | x, | ||
const Eigen::VectorXd & | b | ||
) |
Definition at line 778 of file QuadProg++.cpp.
|
inline |
Definition at line 523 of file QuadProg++.cpp.
void QuadProgPP::delete_constraint | ( | Eigen::MatrixXd & | R, |
Eigen::MatrixXd & | J, | ||
Eigen::VectorXi & | A, | ||
Eigen::VectorXd & | u, | ||
int | n, | ||
int | p, | ||
int & | iq, | ||
int | l | ||
) |
Definition at line 637 of file QuadProg++.cpp.
|
inline |
Definition at line 714 of file QuadProg++.cpp.
|
inline |
Definition at line 790 of file QuadProg++.cpp.
void QuadProgPP::print_matrix | ( | const char * | name, |
const Eigen::MatrixXd & | A, | ||
int | n = -1 , |
||
int | m = -1 |
||
) |
Definition at line 818 of file QuadProg++.cpp.
void QuadProgPP::print_vector | ( | const char * | name, |
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v, | ||
int | n = -1 |
||
) |
Definition at line 842 of file QuadProg++.cpp.
|
inline |
Definition at line 734 of file QuadProg++.cpp.
double QuadProgPP::solve_quadprog | ( | const Eigen::MatrixXd & | _G, |
const Eigen::VectorXd & | g0, | ||
const Eigen::MatrixXd & | _CE, | ||
const Eigen::VectorXd & | ce0, | ||
const Eigen::MatrixXd & | _CI, | ||
const Eigen::VectorXd & | ci0, | ||
Eigen::VectorXd & | x | ||
) |
The quadprog_solve() function implements the algorithm of Goldfarb and Idnani for the solution of a (convex) Quadratic Programming problem by means of an active-set dual method.
The quadratic problem with variables and constraints is:
The matrix and vectors dimensions are as follows:
:
:
:
:
:
:
:
The function will return the cost of the solution written in the vector or std::numeric_limits::infinity() if the problem is infeasible. In the latter case the value of the vector is not correct.
_G | n x n Symmetric positive definite matrix. |
g0 | Vector of size n, where n is the number of variables. |
_CE | Matrix of size n x p, where p is the number of equalities. |
ce0 | Vector of size p. |
_CI | Matrix of size n x m, where m is the number of inequalities. |
ci0 | Vector of size m. |
x | Problem variables of size n. |
Definition at line 75 of file QuadProg++.cpp.
|
inline |
Definition at line 551 of file QuadProg++.cpp.
|
inline |
Definition at line 538 of file QuadProg++.cpp.