problems with quotations in python code
This commit is contained in:
@@ -1158,15 +1158,15 @@ The following code solves the equations for us
|
||||
import numpy
|
||||
from cvxopt import matrix
|
||||
from cvxopt import solvers
|
||||
P = matrix(numpy.diag([1,0]), tc=’d’)
|
||||
q = matrix(numpy.array([3,4]), tc=’d’)
|
||||
G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc=’d’)
|
||||
h = matrix(numpy.array([0,0,-15,100,80]), tc=’d’)
|
||||
P = matrix(numpy.diag([1,0]), tc='d')
|
||||
q = matrix(numpy.array([3,4]), tc='d')
|
||||
G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc='d')
|
||||
h = matrix(numpy.array([0,0,-15,100,80]), tc='d')
|
||||
# Construct the QP, invoke solver
|
||||
sol = solvers.qp(P,q,G,h)
|
||||
# Extract optimal value and solution
|
||||
sol[’x’]
|
||||
sol[’primal objective’]
|
||||
sol['x']
|
||||
sol['primal objective']
|
||||
!ec
|
||||
|
||||
!split
|
||||
@@ -1187,7 +1187,6 @@ subject to $\bm{y}^T\bm{\lambda}=0$. Here we defined the vectors $\bm{\lambda} =
|
||||
$\bm{y}=[y_1,y_2,\dots,y_n]$.
|
||||
With the slack constants this leads to the additional constraint $0\leq \lambda_i \leq C$.
|
||||
|
||||
_code will be added_
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user