Gurobi mixed integer linear programming backend for SageMath. Source repository for https://pypi.org/project/sage-numerical-backends-gurobi/, can be installed on top of distributions providing SageMath. See also https://github.com/sagemath/sage-numerical-backends-cplex and https://github.com/sagemath/sage-numerical-backends-coin
GNU General Public License v2.0
6
stars
6
forks
source link
installing sage_numerical_backends_gurobi changes output of certain __repr__ #2
I noticed this over at https://trac.sagemath.org/ticket/29955, but that ticket is not necessary to expose the problem. Basically, the __repr__ output changes when this package is installed.
First of all, I installed this package via:
sage -i sage_numerical_backends_gurobi
Here is an example that causes the problem:
sage: milp = MixedIntegerLinearProgram()
sage: x = milp.new_variable(binary=True, indices=[0,1])
sage: milp.add_constraint(x[0] + x[1] == 1)
sage: milp.show()
Maximization:
Constraints:
R0: 1.0 <= x_ + x_ <= 1.0
Variables:
x_ = x_0 is a boolean variable (min=0.0, max=1.0)
x_ = x_1 is a boolean variable (min=0.0, max=1.0)
Note that both variables in the Constraints section are called x_ instead of x_0 and x_1.
Without this package I get the following:
sage: milp = MixedIntegerLinearProgram()
sage: x = milp.new_variable(binary=True, indices=[0,1])
sage: milp.add_constraint(x[0] + x[1] == 1)
sage: milp.show()
Maximization:
Constraints:
1.0 <= x_0 + x_1 <= 1.0
Variables:
x_0 is a boolean variable (min=0.0, max=1.0)
x_1 is a boolean variable (min=0.0, max=1.0)
Version number: SageMath version 9.2.beta1, Release Date: 2020-06-13, but I also noticed this on version 9.1.
I noticed this over at https://trac.sagemath.org/ticket/29955, but that ticket is not necessary to expose the problem. Basically, the
__repr__
output changes when this package is installed.First of all, I installed this package via:
Here is an example that causes the problem:
Note that both variables in the Constraints section are called
x_
instead ofx_0
andx_1
.Without this package I get the following:
Version number:
SageMath version 9.2.beta1, Release Date: 2020-06-13
, but I also noticed this on version 9.1.