I'd say there are two bugs:

1) p.new_variable() should raise an error if it doesn't understand the 
argument, and not just silently do nothing.

2) the inequality operators should work both ways to create 
LinearConstraints


On Tuesday, October 23, 2012 9:36:54 AM UTC+1, Peter Mueller wrote:
>
> In Sage 5.3, I get the following:
>
> sage: p = MixedIntegerLinearProgram()
> sage: x = p.new_variable(integer=True)
> sage: c = x[0]-x[1]
> sage: p.add_constraint(10 <= c)
> sage: p.show()
> Maximization:
>  
> Constraints:
> Variables:
>   x_0 is an integer variable (min=0.0, max=+oo)
>   x_1 is an integer variable (min=0.0, max=+oo)
>
> Thus, the constraint was not added to p. If I however do
>
> sage: p.add_constraint(c >= 10)
> sage: p.show()
> Maximization:
>  
> Constraints:
>   R0: - x_0 + x_1 <= -10.0
> Variables:
>   x_0 is an integer variable (min=0.0, max=+oo)
>   x_1 is an integer variable (min=0.0, max=+oo)
>
> then things are fine.
>
> According to the doc, this seems to be a bug. Unfortunately, this behavior 
> produces wrong results. It took me some time to isolate the problem! Bugs 
> which just produce error messages are much friendlier ...
>
> -- Peter Mueller
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to