momentumopt
momentumopt.kinoptpy.qp.QpSolver Class Reference

Public Member Functions

def quadprog_solve_qp (self, P, q, G=None, h=None, A=None, b=None, initvals=None)
 Solve a Quadratic Program defined as: More...
 
def cvxopt_solve_qp (self, P, q, G=None, h=None, A=None, b=None)
 

Member Function Documentation

def momentumopt.kinoptpy.qp.QpSolver.quadprog_solve_qp (   self,
  P,
  q,
  G = None,
  h = None,
  A = None,
  b = None,
  initvals = None 
)

Solve a Quadratic Program defined as:

minimize (1/2) * x.T * P * x + q.T * x

subject to G * x <= h A * x == b

using quadprog https://pypi.python.org/pypi/quadprog/.

Parameters

P numpy.array Symmetric quadratic-cost matrix. q numpy.array Quadratic-cost vector. G numpy.array Linear inequality constraint matrix. h numpy.array Linear inequality constraint vector. A numpy.array, optional Linear equality constraint matrix. b numpy.array, optional Linear equality constraint vector. initvals numpy.array, optional Warm-start guess vector (not used).

Returns

x numpy.array Solution to the QP, if found, otherwise None.

Note

The quadprog solver only considers the lower entries of P, therefore it will use a wrong cost function if a non-symmetric matrix is provided.


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