# Ticket #10505: trac_10505.patch

File trac_10505.patch, 1.7 KB (added by ncohen, 10 years ago)
• ## sage/numerical/backends/cplex_backend.pyx

# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1292861612 -3600
# Node ID 200c9860d061c5387564b66f5a91ae4bdf1defeb
# Parent  d740726a92bc0eef8e372e0a59c37b6cdf0a84b0
trac 10505 - round values returned by CPLEX before forwarding them

diff --git a/sage/numerical/backends/cplex_backend.pyx b/sage/numerical/backends/cplex_backend.pyx
 a cdef int status cdef int zero cdef char ctype cdef double value status = CPXgetx(self.env, self.lp, &value, variable, variable) check(status) return value status = CPXgetctype(self.env, self.lp, &ctype, variable, variable) return value if (status == 3003 or ctype=='C') else round(value) cpdef int ncols(self): r"""
• ## sage/numerical/mip.pyx

diff --git a/sage/numerical/mip.pyx b/sage/numerical/mip.pyx
 a is an optimization problem _ in the following form .. centered:: \max \{ c^T x \;|\; A x \leq b, x \geq 0 \} .. MATH:: \max \{ c^T x \;|\; A x \leq b, x \geq 0 \} with given A \in \mathbb{R}^{m,n}, b \in \mathbb{R}^m, c \in \mathbb{R}^n and unknown x \in \mathbb{R}^{n}. - Each element of an instance of a MIPVariable is replaced by its corresponding numerical value. .. NOTE:: While a variable may be declared as binary or integer, its value as returned by the solver is of type float. EXAMPLE:: sage: p = MixedIntegerLinearProgram()