[Cbc] copying a linear program

Giacomo Nannicini giacomo.n at gmail.com
Mon Dec 12 14:58:08 EST 2011


John,
I may be wrong but in my experience OsiCbcSolverInterface has several
problems and should not be used. If your problem is a linear program,
you should use OsiClpSolverInterface instead. Once you load the
problem in an object of class OsiClpSolverInterface, you can use the
clone() method to obtain copies.

Hope this helps.

Giacomo

On Mon, Dec 12, 2011 at 2:46 PM, John Perry <john.perry at usm.edu> 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
> --
> John Perry
> Associate Professor
> Department of Mathematics, Box 5045
> University of Southern Mississippi
> Hattiesburg MS 39406
> john.perry at usm.edu
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc



More information about the Cbc mailing list