Example #1
0
def _solve_pyQP(E, f, G, h, A, b):
    """
    """
    P = dot(E.T, E)
    q = dot(f, E)

    X_sol = solve_qp_as_cvxopt(P, q, G, h, A, b)

    return X_sol
Example #2
0
def _solve_pyQP(E, f, G, h, A, b):
    """
    """
    P = dot(E.T, E)
    q = dot(f, E)

    X_sol = solve_qp_as_cvxopt(P, q, G, h, A, b)
    
    return X_sol
Example #3
0
ci0 = array([0, 0, -2], dtype=float64)

X = _solve_quadprog(G, g0, CE_T, ce0, CI_T, ci0, g0.shape[0])
print X

################################################################################
# Here, we use solve_qp, which takes more type of arguments as input.
# Its job is to format the arguments correctly, and to use the solver above.
################################################################################
P = array([[4, -2], [-2, 4]])
q = [6, 0]

X = solve_qp(P, q, CE_T, ce0, CI_T, ci0)
print X

################################################################################
# Here, we use solve_qp_as_cvxopt:
# The problem is defined as follows:
#   min (x.T P x + q.T x)
#   s.t.    A x =  b
#           G x <= h
################################################################################
A = [[1, 1]]
b = [3]

G = -array([[1, 0], [0, 1], [1, 1]])
h = -array([0, 0, 2])

X = solve_qp_as_cvxopt(P, q, G, h, A, b)
print X
Example #4
0
# Its job is to format the arguments correctly, and to use the solver above.
################################################################################
P   = array([[ 4,-2],
             [-2, 4]])
q  = [6, 0]

X = solve_qp(P, q, CE_T, ce0, CI_T, ci0)
print X


################################################################################
# Here, we use solve_qp_as_cvxopt:
# The problem is defined as follows:
#   min (x.T P x + q.T x)
#   s.t.    A x =  b
#           G x <= h
################################################################################
A = [[1,1]]
b = [3]

G = -array([[1,0],
            [0,1],
            [1,1]])
h = -array([0,0,2])

X = solve_qp_as_cvxopt(P, q, G, h, A, b)
print X