Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > by-pkgid > b92d07bcce6b7f2da3b9721b1d9483a1 > files > 87

python-cvxopt-1.1.2-1mdv2010.1.i586.rpm

#!/usr/bin/python

# The small LP of section 8.3 (Linear programming). 

from cvxopt import matrix, solvers  
c = matrix([-4., -5.])  
G = matrix([[2., 1., -1., 0.], [1., 2., 0., -1.]])  
h = matrix([3., 3., 0., 0.])  
sol = solvers.lp(c, G, h)  
print "\nx = \n\n", sol['x']