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 
new variables.  

On Tuesday, March 26, 2013 7:15:29 AM UTC-6, Nathann Cohen wrote:
>
> Helloooooooooooooooooo !!!
>
> > 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
> sage: int((x<= 5).rhs())
> 5
> sage: (x<=5).lhs()
> x
> sage: p[(x<=5).lhs()] <= (x<= 5).rhs()
> x_0 <= 5
> sage: p.add_constraint(p[(x<=5).lhs()] <= (x<= 5).rhs())
>
> Nathann
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to