#15691: mip backends: bug due to bool/number confusion
-----------------------------+----------------------------
   Reporter:  equaeghe       |            Owner:
       Type:  defect         |           Status:  new
   Priority:  major          |        Milestone:  sage-6.1
  Component:  PLEASE CHANGE  |         Keywords:
  Merged in:                 |          Authors:
  Reviewers:                 |  Report Upstream:  N/A
Work issues:                 |           Branch:
     Commit:                 |     Dependencies:
   Stopgaps:                 |
-----------------------------+----------------------------
 (I only have the GLPK backend installed, so I actually only tested with
 that.)

 In all the mip backends, the methods `variable_upper_bound` and
 `variable_lower_bound` contain essentially the statement `value == False`.
 This causes it to be impossible to set variable bounds to 0.0, as `0.0 ==
 False` is `True`.

 Illustrated in the console:

 {{{
 sage: version()
 'Sage Version 6.0, Release Date: 2013-12-17'

 sage: p = MixedIntegerLinearProgram()
 sage: p.set_objective(p[0])
 sage: p.show()
 Maximization:
   x_0
 Constraints:
 Variables:
   x_0 is a continuous variable (min=0.0, max=+oo)

 sage: p.set_max(p[0], 0.0) # fails
 sage: p.show()
 Maximization:
   x_0
 Constraints:
 Variables:
   x_0 is a continuous variable (min=0.0, max=+oo)
 }}}

 A simple fix is to replace all(?) occurrences of `value == False` by
 `value is False`.

--
Ticket URL: <http://trac.sagemath.org/ticket/15691>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to