Changes between Initial Version and Version 1 of Ticket #12833


Ignore:
Timestamp:
04/12/12 11:42:56 (9 years ago)
Author:
ncohen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12833

    • Property Status changed from new to needs_review
    • Property Cc dcoudert added
  • Ticket #12833 – Description

    initial v1  
    33Gurobi 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).
    44
    5 I also noticed that the doctests were actually *all wrong* because of a solver="GUROBI" instead of solver="Gurobi".
     5I also noticed that the doctests of gurobi_backend were actually *all wrong* because of a solver="GUROBI" instead of solver="Gurobi".
    66
    7 There was also a broken doctest in digraph.py.
     7There 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.
    88
    9 After this patch everything is uniform, and all tests pass in the graph/ files with gubori as the default solver.
     9Before :
     10{{{
     11sage: g = DiGraph('IESK@XgAbCgH??KG??')                                                                                                                                                                                                                                     
     12sage: g.feedback_edge_set(value_only = True, constraint_generation = False)                                                                                                                                                                                                 
     137                                                                                                                                                                                                                                                                           
     14sage: g.feedback_edge_set(value_only = True, constraint_generation = False, solver = "GUROBI")
     157
     16}}}
     17
     18After :
     19{{{
     20sage: g = DiGraph('IESK@XgAbCgH??KG??')                                                                                                                                                                                                                                     
     21sage: g.feedback_edge_set(value_only = True, constraint_generation = False)                                                                                                                                                                                                 
     227                                                                                                                                                                                                                                                                           
     23sage: g.feedback_edge_set(value_only = True, constraint_generation = False, solver = "Gurobi")
     247
     25}}}
     26
     27Hopefully, the problem came from an optional algorithm, optional because slower than the other one.
     28
     29After 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 :
     30{{{
     31sage: p = MixedIntegerLinearProgram(solver = "Gurobi")        # optional - Gurobi                                                                                                                                                                                   
     32sage: p.add_constraint(p[0] - p[2], min = 1, max = 4)         # optional - Gurobi                                                                                                                                                                                   
     33sage: p.add_constraint(p[0] - 2*p[1], min = 1)                # optional - Gurobi                                                                                                                                                                                   
     34sage: p.show()
     35Maximization:
     36 
     37Constraints:
     38  R0: 4.0 <= x_0 -x_1 +RgR0 <= 4.0
     39  R1: 1.0 <= x_0 -2.0 x_3
     40Variables:
     41  x_0 is a continuous variable (min=0.0, max=+oo)
     42  x_1 is a continuous variable (min=0.0, max=+oo)
     43  RgR0 is a continuous variable (min=0.0, max=3.0)
     44  x_3 is a continuous variable (min=0.0, max=+oo)
     45}}}
     46
     47You always pay for the bad code you write `-_-`
    1048
    1149Nathann