#16755: PPL LP solver does not accept rationals
----------------------------------+----------------------------
   Reporter:  jdemeyer            |            Owner:
       Type:  defect              |           Status:  new
   Priority:  major               |        Milestone:  sage-6.3
  Component:  linear programming  |         Keywords:
  Merged in:                      |          Authors:
  Reviewers:                      |  Report Upstream:  N/A
Work issues:                      |           Branch:
     Commit:                      |     Dependencies:
   Stopgaps:                      |
----------------------------------+----------------------------
 Given that PPL natively works with rationals, this should work:
 {{{
 sage: p = MixedIntegerLinearProgram(solver="PPL")
 sage: x = p.new_variable(nonnegative=True)
 sage: p.add_constraint(x[0] + x[1] <= 1/2)
 sage: p.set_objective(x[0])
 sage: p.solve()
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-10-082b726ace8d> in <module>()
 ----> 1 p.solve()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/numerical/mip.so in
 sage.numerical.mip.MixedIntegerLinearProgram.solve
 (build/cythonized/sage/numerical/mip.c:10574)()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/numerical/backends/ppl_backend.so in
 sage.numerical.backends.ppl_backend.PPLBackend.solve
 (build/cythonized/sage/numerical/backends/ppl_backend.c:5346)()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/numerical/backends/ppl_backend.so in
 sage.numerical.backends.ppl_backend.PPLBackend.init_mip
 (build/cythonized/sage/numerical/backends/ppl_backend.c:2284)()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/libs/ppl.so in sage.libs.ppl.Linear_Expression.__richcmp__
 (build/cythonized/sage/libs/ppl.cpp:17640)()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/libs/ppl.so in sage.libs.ppl._make_Constraint_from_richcmp
 (build/cythonized/sage/libs/ppl.cpp:23124)()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/libs/ppl.so in sage.libs.ppl.Linear_Expression.__cinit__
 (build/cythonized/sage/libs/ppl.cpp:15675)()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/rings/integer.so in sage.rings.integer.Integer.__init__
 (build/cythonized/sage/rings/integer.c:7650)()

 /usr/local/src/sage-config/local/lib/python2.7/site-
 packages/sage/rings/rational.so in sage.rings.rational.Rational._integer_
 (build/cythonized/sage/rings/rational.c:20851)()

 TypeError: no conversion of this rational to integer
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16755>
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