#16504: A mandatory 'nonnegative' argument for
MixedIntegerLinearProgram.new_variable() until the standard changes
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.3
      Component:  linear             |   Resolution:
  programming                        |    Merged in:
       Keywords:                     |    Reviewers:  Jeroen Demeyer
        Authors:  Nathann Cohen      |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  public/16504       |  190393753fff48a6e210066fe0f0fff931ef404c
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by dimpase):

 just to make sure I merged public/16504 over the latest 6.3.beta5, and I
 get 2 failures:
 {{{
 sage -t src/sage/numerical/mip.pyx
 **********************************************************************
 File "src/sage/numerical/mip.pyx", line 253, in
 sage.numerical.mip.MixedIntegerLinearProgram
 Failed example:
     for type in ["binary", "integer"]:
         k = 3
         items = [1/5, 1/3, 2/3, 3/4, 5/7]
         maximum=1
         p=MixedIntegerLinearProgram()
         box=p.new_variable(**{type:True})
         for b in range(k):
              p.add_constraint(p.sum([items[i]*box[i,b] for i in
 range(len(items))]) <= maximum)
         for i in range(len(items)):
             p.add_constraint(p.sum([box[i,b] for b in range(k)]) == 1)
         p.set_objective(None)
         _ = p.solve()
         box=p.get_values(box)
         print(all(v in ZZ for v in box.values()))
 Expected:
     True
     True
 Got:
     True
     doctest:839: DeprecationWarning: The default value of 'nonnegative'
 will change, to False instead of True. You should add the explicit
 'nonnegative=True'.
     See http://trac.sagemath.org/15521 for details.
     True
 **********************************************************************
 File "src/sage/numerical/mip.pyx", line 364, in
 sage.numerical.mip.MixedIntegerLinearProgram.?
 Failed example:
     v = p.new_variable(real=True)
 Expected:
     doctest:839: DeprecationWarning: The default value of 'nonnegative'
 will change, to False instead of True. You should add the explicit
 'nonnegative=True'.
     See http://trac.sagemath.org/15521 for details.
 Got:
     <BLANKLINE>
 **********************************************************************
 2 items had failures:
    1 of   9 in sage.numerical.mip.MixedIntegerLinearProgram
    1 of  15 in sage.numerical.mip.MixedIntegerLinearProgram.?
     [440 tests, 2 failures, 8.08 s]
 ----------------------------------------------------------------------
 sage -t src/sage/numerical/mip.pyx  # 2 doctests failed
 ----------------------------------------------------------------------
 Total time for all tests: 8.7 seconds
     cpu time: 8.1 seconds
     cumulative wall time: 8.1 seconds
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16504#comment:55>
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/d/optout.

Reply via email to