#12091: chained inequalities bug in add_constraint to MixedIntegerLinearProgram
--------------------------------------+-------------------------------------
       Reporter:  dimpase             |         Owner:  ncohen         
           Type:  defect              |        Status:  positive_review
       Priority:  major               |     Milestone:  sage-5.5       
      Component:  linear programming  |    Resolution:                 
       Keywords:                      |   Work issues:                 
Report Upstream:  N/A                 |     Reviewers:                 
        Authors:                      |     Merged in:                 
   Dependencies:  13650               |      Stopgaps:                 
--------------------------------------+-------------------------------------
Changes (by dimpase):

  * status:  needs_review => positive_review
  * dependencies:  => 13650


Old description:

> This ticket was originally started to address problems now dealt with in
> #13646.
> Still, the following (chained inequalities don't work) needs to be fixed:
> {{{
> sage: p = MixedIntegerLinearProgram()
> sage: b = p.new_variable()
> sage: b[0] <= b[1] <= 2  # This is not ok
> x_1 <= 2
> sage: (b[0] <= b[1] <= 2).constraints # Not ok
> [x_1, 2]
> sage: 1 >= b[1] >= 2*b[0] # Not ok (note that without #13646 this returns
> False)
> 2 x_0 <= x_1
> sage: b[2] >= b[1] >= 2*b[0]  # Not ok
> 2 x_0 <= x_1
> }}}
> See also this
> [http://permalink.gmane.org/gmane.comp.mathematics.sage.support/29948
> sage-support thread].

New description:

 This ticket was originally started to address problems now dealt with in
 #13646.
 Still, the following (chained inequalities don't work) needs to be fixed:
 {{{
 sage: p = MixedIntegerLinearProgram()
 sage: b = p.new_variable()
 sage: b[0] <= b[1] <= 2  # This is not ok
 x_1 <= 2
 sage: (b[0] <= b[1] <= 2).constraints # Not ok
 [x_1, 2]
 sage: 1 >= b[1] >= 2*b[0] # Not ok (note that without #13646 this returns
 False)
 2 x_0 <= x_1
 sage: b[2] >= b[1] >= 2*b[0]  # Not ok
 2 x_0 <= x_1
 }}}
 See also this
 [http://permalink.gmane.org/gmane.comp.mathematics.sage.support/29948
 sage-support thread].

 Apply
 * [attachment:trac_12091_constraints_parents.patch]

--

Comment:

 As far as I am concerned, better parsing of things like {{{x[0] <= x[1] >=
 x[2]}}} or {{{x[0] <= x[1] == 2}}} can wait till another ticket.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12091#comment:36>
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.

Reply via email to