Totsu PrimalDualIPM
|
A Quadratic Program solver class. More...
#include <QP.h>
Public Member Functions | |
IPM_Error | solve (IPM_Vector &x, const IPM_Matrix &P, const IPM_Vector &q, const IPM_Single &r, const IPM_Matrix &G, const IPM_Vector &h, const IPM_Matrix &A, const IPM_Vector &b) |
Runs the solver with given parameters. More... | |
bool | isConverged (void) |
Indicates if the previous solve() has converged or not. | |
Public Member Functions inherited from PrimalDualIPM | |
PrimalDualIPM () | |
Constructor. | |
virtual | ~PrimalDualIPM () |
Destructor. | |
void | setLog (std::ostream *pOuts) |
Sets output destination of internal calculation log. More... | |
Protected Attributes | |
IPM_Scalar | m_slack |
Initial margin value for a slack variable. | |
Protected Attributes inherited from PrimalDualIPM | |
IPM_Scalar | m_margin |
Initial margin value for dual variables of inequalities. | |
IPM_Scalar | m_loop |
Max iteration number of outer-loop for the Newton step. | |
IPM_Scalar | m_bloop |
Max iteration number of inner-loop for the backtracking line search. | |
IPM_Scalar | m_eps_feas |
Tolerance of the primal and dual residuals. | |
IPM_Scalar | m_eps |
Tolerance of the surrogate duality gap. | |
IPM_Scalar | m_mu |
The factor to squeeze complementary slackness. | |
IPM_Scalar | m_alpha |
The factor to decrease residuals in the backtracking line search. | |
IPM_Scalar | m_beta |
The factor to decrease a step size in the backtracking line search. | |
IPM_Scalar | m_s_coef |
The factor to determine an initial step size in the backtracking line search. | |
Additional Inherited Members | |
Protected Member Functions inherited from PrimalDualIPM | |
void | logWarn (const char *str) |
Logs a warning message. More... | |
void | logVector (const char *str, IPM_Vector_IN v) |
Logs values of a vector, transposing if it is a colomn vector. More... | |
void | logMatrix (const char *str, IPM_Matrix_IN m) |
Logs values of a matrix. More... | |
IPM_Error | start (const IPM_uint n, const IPM_uint m, const IPM_uint p) |
Starts to solve a optimization problem by primal-dual interior-point method. More... | |
Static Protected Member Functions inherited from PrimalDualIPM | |
static IPM_Scalar | max (const IPM_Scalar a, const IPM_Scalar b) |
Returns the larger of a and b. | |
static IPM_Scalar | min (const IPM_Scalar a, const IPM_Scalar b) |
Returns the smaller of a and b. | |
static IPM_Scalar | abs (const IPM_Scalar x) |
Returns the absolute value of x. | |
A Quadratic Program solver class.
The problem is \[ \begin{array}{ll} {\rm minimize} & {1 \over 2} x^T P x + q^T x + r \\ {\rm subject \ to} & G x \preceq h \\ & A x = b, \end{array} \] where
Internally a slack variable \( s \in {\bf R} \) is introduced for the infeasible start method as follows: \[ \begin{array}{ll} {\rm minimize}_{x,s} & {1 \over 2} x^T P x + q^T x + r \\ {\rm subject \ to} & G x \preceq h + s {\bf 1} \\ & A x = b \\ & s = 0. \end{array} \]
IPM_Error QP::solve | ( | IPM_Vector & | x, |
const IPM_Matrix & | P, | ||
const IPM_Vector & | q, | ||
const IPM_Single & | r, | ||
const IPM_Matrix & | G, | ||
const IPM_Vector & | h, | ||
const IPM_Matrix & | A, | ||
const IPM_Vector & | b | ||
) |
Runs the solver with given parameters.
x | [IN-OUT] is a column vector containing values of \(x\). It is used as the initial values and overwritten with the final results. |
P | [IN] is a matrix containing values of \(P\). |
q | [IN] is a vector containing values of \(q\). |
r | [IN] is a single element matrix containing values of \(r\). |
G | [IN] is a matrix containing values of \(G\). |
h | [IN] is a vector containing values of \(h\). |
A | [IN] is a matrix containing values of \(A\). |
b | [IN] is a vector containing values of \(b\). |