#13281: gurobi backend has no copy(), and creates named constraints since v5
----------------------------------+-----------------------------------------
Reporter: dimpase | Owner: ncohen
Type: defect | Status: new
Priority: major | Milestone: sage-5.3
Component: linear programming | Keywords:
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
----------------------------------+-----------------------------------------
installing {{{Gurobi}}} switches the default LP solver to {{{Gurobi}}},
leading to doctest failure in {{{mip.pyx}}}
{{{
File "/usr/local/src/sage/sage-5.2.rc0/devel/sage-
main/sage/numerical/mip.pyx", line 298:
sage: q = copy(p)
Exception raised:
Traceback (most recent call last):
File "/usr/local/src/sage/sage-5.2.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/usr/local/src/sage/sage-5.2.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/usr/local/src/sage/sage-5.2.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_4[4]>", line 1, in <module>
q = copy(p)###line 298:
sage: q = copy(p)
File "/usr/local/src/sage/sage-5.2.rc0/local/lib/python2.7/copy.py",
line 80, in copy
return copier(x)
File "mip.pyx", line 320, in
sage.numerical.mip.MixedIntegerLinearProgram.__copy__
(sage/numerical/mip.c:2352)
p._backend = (<GenericBackend> self._backend).copy()
AttributeError: 'sage.numerical.backends.gurobi_backend.GurobiBacke'
object has no attribute 'copy'
}}}
And indeed, there is no copy() in gurobi backend.
Another bunch of tests that fail in a similar fashion, due to Gurobi
(version 5) automatically naming constraints, and so
one gets
{{{
File "/usr/local/src/sage/sage-5.2.rc0/devel/sage-
main/sage/numerical/mip.pyx", line 1132:
sage: p.show()
Expected:
Maximization:
<BLANKLINE>
Constraints:
x_0 + x_1 <= 10.0
x_0 - x_1 <= 0.0
x_0 <= 4.0
...
Got:
Maximization:
<BLANKLINE>
Constraints:
R0: x_0 + x_1 <= 10.0
R1: x_0 - x_1 <= 0.0
R2: x_0 <= 4.0
Variables:
x_0 is a continuous variable (min=0.0, max=+oo)
x_1 is a continuous variable (min=0.0, max=+oo)
}}}
and other similar failures from {{{show()}}}.
One particular way to fix this would be to set the solver to be {{{GLPK}}}
in all these tests, and create similar
optional tests for {{{Gurobi}}}.
And, lastly, Gurobi version 5 on OSX 10.6 outputs {{{[-0.0, 3.0]}}} rather
than {{{[0.0, 3.0]}}} in a doctest in {{{gurobi_backend.pyx}}}.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13281>
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.