#13646: Bug in p.add_constraint (when input is True/False)
-----------------------------------------------+----------------------------
Reporter: ncohen | Owner: ncohen
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.5
Component: linear programming | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Nathann Cohen, Volker Braun | Merged in:
Dependencies: | Stopgaps:
-----------------------------------------------+----------------------------
Comment (by vbraun):
Having `Sum()` return `int(0)` is also tricky, think about
{{{
p.add_constraint( Sum(...) <= 123 )
}}}
Now this breaks because int(0) <= 123 evaluates to ``True``. Since neither
the left nor the right hand side is of type `LinearFunction`, there is no
type information to construct a `LinearConstraint`.
It wasn't really ever an option to not play nice with the coercion system,
you just let users again and again fall into the same trap ;-) But since
now there is a QQ in addition to RDF backends its even more pressing to
fix this up, I think.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13646#comment:22>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.