Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
MixedIntegerLinearProgram.get_values: Fix up for tolerance=None
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jul 15, 2021
1 parent cfd8c7b commit cf16293
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sage/numerical/mip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1613,9 +1613,10 @@ cdef class MixedIntegerLinearProgram(SageObject):
raise TypeError('cannot use tolerance if convert is None')
get_backend_variable_value = self._backend_variable_value
else:
if self.base_ring().is_exact():
if not 0 <= tolerance:
raise ValueError('for an exact base_ring, tolerance must be nonnegative')
if tolerance is not None:
if self.base_ring().is_exact():
if not 0 <= tolerance:
raise ValueError('for an exact base_ring, tolerance must be nonnegative')
else:
if not 0 < tolerance:
raise ValueError('for an inexact base_ring, tolerance must be positive')
Expand Down

0 comments on commit cf16293

Please sign in to comment.