Totsu PrimalDualIPM
QP Class Reference

A Quadratic Program solver class. More...

#include <QP.h>

Inheritance diagram for QP:

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.
 

Detailed Description

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

  • variables \( x \in {\bf R}^n \)
  • \( P \in {\bf S}_{+}^n \), \( q \in {\bf R}^n \), \( r \in {\bf R} \)
  • \( G \in {\bf R}^{m \times n} \), \( h \in {\bf R}^m \).
  • \( A \in {\bf R}^{p \times n} \), \( b \in {\bf R}^p \).

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} \]

Member Function Documentation

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.

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\).

Here is the call graph for this function:


The documentation for this class was generated from the following files: