[Cbc] copying a linear program
Lou Hafer
lou at cs.sfu.ca
Mon Dec 12 15:01:20 EST 2011
John,
Several comments and observations (since I'm not sure just what you're
trying to accomplish).
* Deleting a solver interface should free all resources that it
acquired. That doesn't seem to happen, so there's probably a
bug in OsiCbc.
* OsiCbc is regarded as a mistake by most of the developers, myself
included (hence the general lack of response :-) No one who likes
to use it is willing to maintain it. If you need to solve MIPs, use
Cbc directly. If you just want to solve continuous LPs, use some
other OsiXXX. OsiClp, for example.
* You say you want to copy a linear program. Do you want copies of the
model, or copies of the model embedded in a solver interface? Not a
question I can answer from what you've written.
Lou
On 12/12/11 11:46 AM, John Perry wrote:
> Hi
>
> My apologies if I've sent this to the wrong list; let me know if so. (I tried
> Osi, but they didn't answer, so maybe that was the wrong place.)
>
> I want to copy a linear program many times (several hundred). An examination
> of the source code suggests that this is the right approach:
>
> #include "include/coin/OsiCbcSolverInterface.hpp"
>
> int main() {
> OsiCbcSolverInterface * si = new OsiCbcSolverInterface(NULL);
> OsiCbcSolverInterface * newsi;
>
> for (int i = 0; i < 13; i++) {
> newsi = new OsiCbcSolverInterface(si);
> delete si;
> si = newsi;
> }
>
> while (true) {}
> }
>
> but even this empty linear program, copied only 13 times, causes exponential
> memory consumption, to the tune of hundreds of megabytes.
>
> Am I going about this the wrong way, or is it a bug?
>
> regards
> john perry
More information about the Cbc
mailing list