[FlopCpp] Deleting a model

gemiel at impa.br gemiel at impa.br
Mon Sep 13 17:25:43 EDT 2010


Hi,

I have a question regarding memory management in FlopCPP.
Basically I am defining and solving many LPs in a loop and I would  
like to be sure that everything is deleted after each loop iteration.
It does not seem to be the case since the memory used by the program  
keeps increasing.

I reproduced this behavior with the 'mine.cpp' example:
_____________________________________________________
for (int i=1; i<100000 ; i++)
{
   MP_model::getDefaultModel().setSolver(new OsiCbcSolverInterface);

   enum {nw,ne,se,sw,numK};
   MP_set l(4);  // identfiers for level row and column labels  / 1*4 /;
   MP_index i,j;
   MP_data conc(l,l,l);

... etc ...

   maximize( sum(d(l,i,j), (conc(l,i,j)*value/100 - cost(l))*x(l,i,j)) );
   cout<<"Test mine " << i << " passed."<<endl;
}
________________________________________________________

I tried to add ' MP_model::getDefaultModel().detach(); ' but it did not help.
What should I do to be sure to delete all objects that are  
instantiated in the loop ?

Thanks.

Regards.

Gregory

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





More information about the FlopCpp mailing list