[sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread Dima Pasechnik
On 2013-03-26, tvn wrote: > --=_Part_262_20933178.1364323802734 > Content-Type: text/plain; charset=ISO-8859-1 > > Yes -- it would be very convenient for the users. For example, applying > solve() on a a set of linear equations probably do some preprocessing to > turn them into more effic

[sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread tvn
Yes -- it would be very convenient for the users. For example, applying solve() on a a set of linear equations probably do some preprocessing to turn them into more efficient format and send it to some specialize solver. But all those steps happen behind the scene , the only thing I give so

[sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread john_perry_usm
Dima & Nathann What he's facing is an annoyance. Would it be feasible (ha ha) to rewrite the creation of constraints so that variables are automatically created in the LP if they're not there? That is, rather than looking for a workaround for the user, should we see this as an opportunity for e

Re: [sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread Nathann Cohen
> Hi Nathan, it doesn't work if my constraint is say 2l + 3u - 8 <= 0 ? No... It just works for all kind of constraints that you have given so far > It seems I cant get around the hard work of 1) from the original cst, > figureout the variables (l,u) , then declare those variables with

Re: [sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread tvn
Hi Nathan, it doesn't work if my constraint is say 2l + 3u - 8 <= 0 ? It seems I cant get around the hard work of 1) from the original cst, figureout the variables (l,u) , then declare those variables with p , then recreate a list of linear constraints using the original csts and the n

Re: [sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread Nathann Cohen
Helloo !!! > ok -- from here, what is the easiest way to add csts to p ? Does this help ? It uses the fact that when you have any hashable object x in Sage you can create an "associated" LP variable by writing p[x] : sage: p = MixedIntegerLinearProgram() sage: (x<= 5).rhs() 5 sag

[sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread tvn
On Tuesday, March 26, 2013 4:13:39 AM UTC-6, Dima Pasechnik wrote: > > On 2013-03-26, tvn > wrote: > > --=_Part_232_6092612.1364277288756 > > Content-Type: text/plain; charset=ISO-8859-1 > > > > I am trying to play around with MixedIntegerLinearProgram but now sure > how > > to add con

[sage-support] Re: Adding constraints to MixedIntegerLinearProgram

2013-03-26 Thread Dima Pasechnik
On 2013-03-26, tvn wrote: > --=_Part_232_6092612.1364277288756 > Content-Type: text/plain; charset=ISO-8859-1 > > I am trying to play around with MixedIntegerLinearProgram but now sure how > to add constraints properly to it. My input is a list of relations , e.g. > csts = [l <= 15, u >= 1