Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing sage_numerical_backends_gurobi changes output of certain __repr__ #2

Open
saliola opened this issue Jun 25, 2020 · 1 comment

Comments

@saliola
Copy link

saliola commented Jun 25, 2020

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.

@saliola
Copy link
Author

saliola commented Jun 28, 2020

Note that this also causes problems for the command milp.write_lp, since that file will have the all the variable names x_i replaced with x_.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant