id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
12833 Crashes and doctests problems with Gurobi ncohen ncohen "HEllooooooooo !!!
Gurobi actually crashed Sage when MixedIntegerLinearProgram(solver=""Gurobi"") is run with no license installed (or an invalid one). This if fixed by a if var == NULL before free(var).
I also noticed that the doctests of gurobi_backend were actually *all wrong* because of a solver=""GUROBI"" instead of solver=""Gurobi"".
There was also a *scary* error in digraph.py : an inequality was actually REVERSED (a <= n had become a >= n) and it is really a wonder that the code did not break before `O_o`. Well, Gurobi did break on that, but the others were doing just fine.
Before :
{{{
sage: g = DiGraph('IESK@XgAbCgH??KG??')
sage: g.feedback_edge_set(value_only = True, constraint_generation = False)
7
sage: g.feedback_edge_set(value_only = True, constraint_generation = False, solver = ""GUROBI"")
6
}}}
After :
{{{
sage: g = DiGraph('IESK@XgAbCgH??KG??')
sage: g.feedback_edge_set(value_only = True, constraint_generation = False)
7
sage: g.feedback_edge_set(value_only = True, constraint_generation = False, solver = ""Gurobi"")
7
}}}
Hopefully, the problem came from an optional algorithm, optional because slower than the other one.
After this patch everything is uniform, and all tests pass in the graph/ files with gubori as the default solver. All doctests do not pass in mip.pyx but that is only matters of default names for constraints, and stupid ways to store inequalities inside of Gurobi. For instance :
{{{
sage: p = MixedIntegerLinearProgram(solver = ""Gurobi"") # optional - Gurobi
sage: p.add_constraint(p[0] - p[2], min = 1, max = 4) # optional - Gurobi
sage: p.add_constraint(p[0] - 2*p[1], min = 1) # optional - Gurobi
sage: p.show()
Maximization:
Constraints:
R0: 4.0 <= x_0 -x_1 +RgR0 <= 4.0
R1: 1.0 <= x_0 -2.0 x_3
Variables:
x_0 is a continuous variable (min=0.0, max=+oo)
x_1 is a continuous variable (min=0.0, max=+oo)
RgR0 is a continuous variable (min=0.0, max=3.0)
x_3 is a continuous variable (min=0.0, max=+oo)
}}}
You always pay for the bad code you write `-_-`
Nathann
'''Apply:'''
* [attachment:trac_12833.patch]
* [attachment:trac_12833-docstrings.patch]
* [attachment:trac_12833_acronyms_are_evil.patch]" defect closed major sage-5.0 misc fixed ncohen dcoudert sage-5.0.rc0 Nathann Cohen John Perry N/A