/usr/share/pyshared/openopt/examples/lunp_1.py is in python-openopt 0.38+svn1589-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | __docformat__ = "restructuredtext en"
from numpy import *
from openopt import LUNP
M, N = 1500, 150
C = empty((M,N))
d = empty(M)
for j in xrange(M):
d[j] = 1.5*N+80*sin(j)
C[j] = 8*sin(4.0+arange(N)) + 15*cos(j)
lb = sin(arange(N))
ub = lb + 1
p = LUNP(C, d, lb=lb, ub=ub)
r = p.solve('lp:glpk', iprint = -1)
print 'f_opt:', r.ff
#print 'x_opt:', r.xf
|