unittest/python/crocoddyl/qpsolvers.py
def quadprogWrapper(H, g, C=None, d=None, A=None, b=None, initvals=None):
    """
    Quadprog <https://pypi.python.org/pypi/quadprog/>.
    The quadprog solver only considers the lower entries of `H`, therefore it
    will use a wrong cost function if a non-symmetric matrix is provided.
    """
    assert (allclose(H, H.T, atol=1e-10))
    if initvals is not None:
        print("quadprog: note that warm-start values ignored by wrapper")
    if A is not None and C is not None:
        qp_C = -vstack([A, C]).T
        qp_b = -hstack([b, d])
        meq = A.shape[0] if A.ndim > 1 else 1
    elif A is None and C is not None:  # no equality constraint
        qp_C = -C.T
        qp_b = -d
        meq = 0
    elif A is not None and C is None:
        qp_C = A.T
        qp_b = b
        meq = A.shape[0] if A.ndim > 1 else 1
    else:  # if A is None and C is None:
        qp_C = None
        qp_b = None
        meq = 0

    nx = H.shape[0]
    nc = qp_C.shape[0]
    sol = QPSolution(nx, nc)
    """
    Quadprog API
    Solve a strictly convex quadratic program

    Minimize     1/2 x^T G x - a^T x
    Subject to   C.T x >= b
    """
    sol.argmin, sol.optimum, _, (sol.niter, _), sol.dual, iact = solve_qp(H, -g, qp_C, qp_b, meq)
    sol.dual *= -1.
    for i in iact:
        sol.active[i % nx] = True
    return sol

    Quadprog <https://pypi.python.org/pypi/quadprog/>.
    The quadprog solver only considers the lower entries of `H`, therefore it
    will use a wrong cost function if a non-symmetric matrix is provided.
    
Quadprog .
The quadprog solver only considers the lower entries of `H`, therefore it
will use a wrong cost function if a non-symmetric matrix is provided.
Quadprog . The quadprog solver only considers the lower entries of ` H ` therefore it will use a wrong cost function if a non - symmetric matrix is provided .
def quadprogWrapper(H, g, C=None, d=None, A=None, b=None, initvals=None):
    assert (allclose(H, H.T, atol=1e-10))
    if initvals is not None:
        print("quadprog: note that warm-start values ignored by wrapper")
    if A is not None and C is not None:
        qp_C = -vstack([A, C]).T
        qp_b = -hstack([b, d])
        meq = A.shape[0] if A.ndim > 1 else 1
    elif A is None and C is not None:  
        qp_C = -C.T
        qp_b = -d
        meq = 0
    elif A is not None and C is None:
        qp_C = A.T
        qp_b = b
        meq = A.shape[0] if A.ndim > 1 else 1
    else:  
        qp_C = None
        qp_b = None
        meq = 0
    nx = H.shape[0]
    nc = qp_C.shape[0]
    sol = QPSolution(nx, nc)
    sol.argmin, sol.optimum, _, (sol.niter, _), sol.dual, iact = solve_qp(H, -g, qp_C, qp_b, meq)
    sol.dual *= -1.
    for i in iact:
        sol.active[i % nx] = True
    return sol
def quadprogWrapper ( H , g , C = None , d = None , A = None , b = None , initvals = None ) : assert ( allclose ( H , H . T , atol = 1e-10 ) ) if initvals is not None : print ( "quadprog: note that warm-start values ignored by wrapper" ) if A is not None and C is not None : qp_C = - vstack ( [ A , C ] ) . T qp_b = - hstack ( [ b , d ] ) meq = A . shape [ 0 ] if A . ndim > 1 else 1 elif A is None and C is not None : qp_C = - C . T qp_b = - d meq = 0 elif A is not None and C is None : qp_C = A . T qp_b = b meq = A . shape [ 0 ] if A . ndim > 1 else 1 else : qp_C = None qp_b = None meq = 0 nx = H . shape [ 0 ] nc = qp_C . shape [ 0 ] sol = QPSolution ( nx , nc ) """
    Quadprog API
    Solve a strictly convex quadratic program

    Minimize     1/2 x^T G x - a^T x
    Subject to   C.T x >= b
    """ sol . argmin , sol . optimum , _ , ( sol . niter , _ ) , sol . dual , iact = solve_qp ( H , - g , qp_C , qp_b , meq ) sol . dual *= - 1. for i in iact : sol . active [ i % nx ] = True return sol
Quadprog <https://pypi.python.org/pypi/quadprog/>.
Quadprog <https : // pypi . python . org / pypi / quadprog / > .
"""
    Quadprog <https://pypi.python.org/pypi/quadprog/>.
    The quadprog solver only considers the lower entries of `H`, therefore it
    will use a wrong cost function if a non-symmetric matrix is provided.
    """ # no equality constraint # if A is None and C is None: """
    Quadprog API
    Solve a strictly convex quadratic program

    Minimize     1/2 x^T G x - a^T x
    Subject to   C.T x >= b
    """
H
g
C
d
A
b
initvals