[Coin-lpsolver] Packed Matrix to CbcModel

Kyle Ellrott kellrott at csbl.bmb.uga.edu
Tue May 23 14:05:32 EDT 2006


I'm trying to minimize the number of memory duplication steps in the  
creation of a CbcModel.
I start with a packed description of the matrix, the kind that you  
can pass directly to CoinPackedMatrix::assignMatrix.

To assign the data to CbcModel, I use CbcModel::assignSolver, which  
takes an OsiSolverInterface.  I use the OsiClpSolverInterface  
interface to implement OsiSolverInterface.

When I try this, my compiler throws a:

../../../open_prospect/src/intpro_threading/intpro_threading.cc:380:  
error: no matching function for call to 'CbcModel::assignSolver 
(OsiClpSolverInterface*&)'
/Users/kye/CvsWork/COIN//include/CbcModel.hpp:1316: note: candidates  
are: void CbcModel::assignSolver(OsiSolverInterface*&, bool)

I can get it to work if I use the OsiClpSolverInterface::clone  
function, but of course, that would duplicate the data.

As I understand it, the next problem is that  
OsiClpSolverInterface::assignProblem takes a CoinPackedMatrix, passes  
it to OsiClpSolverInterface::loadProblem (which uses it to create a  
ClpSimplex object), and then deletes the originals.  This is my main  
concern, because this action causes a duplication event on the  
matrix, and the row/column boundaries and objective function,so for a  
period of time, the program has two copies of the data in memory.

Is there any way that I can go from a packed matrix description to a  
CbcModel without ever duplicating the data?


Kyle Ellrott



More information about the Clp mailing list