Tom van der Hoeven
unread,Mar 14, 2015, 9:30:14 AM3/14/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pulp-or...@googlegroups.com
Hi,
in the following example:
---------------
from pulp import *
AA = LpVariable('aa')
BB = LpVariable('bb')
equationlist = [ (AA,1),(BB,2),(AA,5)]
print 'aff ', LpAffineExpression(equationlist)
print 'Lpsum', lpSum(coef*var for var,coef in equationlist)
---------------------------
the output is
__________________
aff 5*aa + 2*bb
Lpsum 6*aa + 2*bb
-------------------------
what happens is that AA is referenced twice.
This happened to me in a larger application.
Is a multiple reference to one variable forbidden for LpAffineExpression
or is it an error.
Tom