Opened 10 years ago
Last modified 10 years ago
#10151 closed defect
Update calls to MixedIntegerLinearProgram and its solve function to follow the new interface — at Version 1
Reported by: | ncohen | Owned by: | ncohen |
---|---|---|---|
Priority: | major | Milestone: | sage-4.6.1 |
Component: | linear programming | Keywords: | |
Cc: | malb, mvngu | Merged in: | |
Authors: | Nathann Cohen | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Right now, the followinjg is happening
sage: g = graphs.PetersenGraph() sage: g.dominating_set() IBM ILOG License Manager: "IBM ILOG Optimization Suite for Academic Initiative" is accessing CPLEX 12 with option(s): "e m b q ". [4, 6, 7] sage: g.dominating_set(solver = "GLPK") --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /auto/sop-nas2a/u/sop-nas2a/vol/home_mascotte/ncohen/<ipython console> in <module>() /home/ncohen/sage/local/lib/python2.6/site-packages/sage/graphs/generic_graph.pyc in dominating_set(self, independent, value_only, solver, verbose) 5666 return p.solve(objective_only=True, solver=solver, log=verbose) 5667 else: -> 5668 p.solve(solver=solver, log=verbose) 5669 b=p.get_values(b) 5670 return [v for v in g.vertices() if b[v]==1] /home/ncohen/sage/local/lib/python2.6/site-packages/sage/numerical/mip.so in sage.numerical.mip.MixedIntegerLinearProgram.solve (sage/numerical/mip.c:5813)() ValueError: Solver argument deprecated. This parameter now has to be set when calling the class' constructor
The new interface between Sage and the LP solvers requires the solver's name to be given when the constructor is called.
This patch applied, all is fine :
sage: g = graphs.PetersenGraph() sage: g.dominating_set() IBM ILOG License Manager: "IBM ILOG Optimization Suite for Academic Initiative" is accessing CPLEX 12 with option(s): "e m b q ". [4, 6, 7] sage: g.dominating_set(solver = "GLPK") [0, 2, 6]
Apply first :
This long list of undeserved dependencies is here to prevent this patch from having to be rebased, as it touches many files almost everywhere.
Change History (1)
comment:1 Changed 10 years ago by
- Description modified (diff)
- Status changed from new to needs_review
Note: See
TracTickets for help on using
tickets.