Changeset 5812
 Timestamp:
 May 26, 2012 4:11:59 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

coopr.data.pyomo/trunk/coopr/data/pyomo/performance/diagA100000.py
r5810 r5812 5 5 6 6 def f(model, N): 7 for i in range(1,N+1):7 for i in xrange(1,N+1): 8 8 setattr(model, 'x'+str(i), Var()) 9 9 10 expr=sum(i*getattr(model, 'x'+str(i)) for i in range(1,N+1))10 expr=sum(i*getattr(model, 'x'+str(i)) for i in xrange(1,N+1)) 11 11 model.obj = Objective(expr=expr) 12 12 13 for i in range(1,N+1):13 for i in xrange(1,N+1): 14 14 setattr(model, 'c'+str(i), Constraint(expr = (Ni+1)*getattr(model, 'x'+str(i)) >= N)) 15 15
Note: See TracChangeset
for help on using the changeset viewer.