Skip to content

Commit 7b4046c

Browse files
committed
Document that GLPK/exact can be inexact
1 parent 443b754 commit 7b4046c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/sage/numerical/backends/glpk_backend.pyx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,10 +1012,14 @@ cdef class GLPKBackend(GenericBackend):
10121012
(`get_col_dual` etc.) or tableau data (`get_row_stat` etc.),
10131013
one needs to switch to "simplex_only" before solving.
10141014
1015-
GLPK also has an exact rational simplex solver. The only
1016-
access to data is via double-precision floats, however. It
1017-
reconstructs rationals from doubles and also provides results
1018-
as doubles.
1015+
GLPK also has an exact rational simplex solver. The only access
1016+
to data is via double-precision floats, which means that
1017+
rationals in the input data may be rounded before the exact
1018+
solver sees them. Thus, it is unreasonable to expect that
1019+
arbitrary LPs with rational coefficients are solved exactly.
1020+
Once the LP has been read into the backend, it reconstructs
1021+
rationals from doubles and does solve exactly over the rationals,
1022+
but results are returned as as doubles.
10191023
10201024
EXAMPLES::
10211025

src/sage/numerical/backends/glpk_exact_backend.pyx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ cdef class GLPKExactBackend(GLPKBackend):
1919
"""
2020
MIP Backend that runs the GLPK solver in exact rational simplex mode.
2121
22-
The only access to data is via double-precision floats, however. It
23-
reconstructs rationals from doubles and also provides results
24-
as doubles.
22+
The only access to data is via double-precision floats, which
23+
means that rationals in the input data may be rounded before
24+
the exact solver sees them. Thus, it is unreasonable to expect
25+
that arbitrary LPs with rational coefficients are solved exactly.
26+
Once the LP has been read into the backend, it reconstructs
27+
rationals from doubles and does solve exactly over the rationals,
28+
but results are returned as as doubles.
2529
2630
There is no support for integer variables.
2731
"""

0 commit comments

Comments
 (0)