#12220: Updated CBC spkg
----------------------------------+-----------------------------------------
Reporter: ncohen | Owner: ncohen
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-4.8
Component: linear programming | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author: Nathann Cohen
Merged: | Dependencies:
----------------------------------+-----------------------------------------
Comment(by john_perry):
Replying to [comment:26 ncohen]:
> When you talk about "the model", do you mean that you have to copy all
the constraints and variables again if you ever want to 1) solve a LP 2)
add a constraint 3) solve it again ?
Here's a rough sketch of what works.
1. let ''si'' = '''new''' ''OsiClpSolverInterface''()
2. '''while not''' ''done'':
a. add constraints, variables, whatnot to ''si''
b. let ''model'' = '''new''' CbcModel(''si'')
c. ''model.branchAndCut''()
d. extract solutions from ''model.si'', evaluate ''done''
Step 2b clones ''si'', so I think the answer to your question is, ''yes''.
I find this deeply unsatisfying myself, but if I try to move that step
outside the loop and modify Cbc's model after solving, Sage gives a
`SIGSEV`.
The only alternative I know of right now is to use `OsiClpSolverInterface`
alone, but (a) the developers have told me repeatedly that its
`branchAndBound`() is '''orders of magnitude''' slower than `CbcModel`,
and (b) this is the method that ignores the `setLogLevel` method.
As I say, I've inquired at their list:
http://list.coin-or.org/pipermail/cbc/2012-January/000751.html
but as of this moment, I don't yet have an answer.
Actually, all this discussion reminds me of something. `CbcModel` has an
`assignSolver()` method whose parameter has type `OsiSolverInterface * &`.
Notice the pointer; the argument for the constructor I'm using has type
`OsiSolverInterface &`, which as I understand it necessarily creates a
copy of the parameter. ` One reason I'm not using it now is that, when I
was trying to, I was also having issues with Cython's quirks. I'll see if
I can use that; looking at the code, it doesn't seem to clone the solver.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12220#comment:27>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.