[Coin-discuss] adding constraints incrementally to OsiSolverInterface

Kish Shen kish.shen at crosscoreop.com
Thu Jul 13 09:45:48 EDT 2006


Hi,

I looked at assignProblem() as well, and in the case of OsiClp, it seem to 
just call loadProblem(), so the CoinPackedMatrix is still copied. Here is an 
example from OsiClpSolverInterface.cpp:

void
OsiClpSolverInterface::assignProblem(CoinPackedMatrix*& matrix,
				     double*& collb, double*& colub,
				     double*& obj,
				     double*& rowlb, double*& rowub)
{
  // Get rid of integer information (modelPtr will get rid of its copy)
  loadProblem(*matrix, collb, colub, obj, rowlb, rowub);
  delete matrix;   matrix = NULL;
  delete[] collb;  collb = NULL;
  delete[] colub;  colub = NULL;
  delete[] obj;    obj = NULL;
  delete[] rowlb;  rowlb = NULL;
  delete[] rowub;  rowub = NULL;
}

Cheers,

Kish
On Thursday 13 July 2006 05:38, J P Fasano wrote:
> > I think the problem in the
> > CoinPackedMatrix is copied to the internal
> > Clp representation, and the
> > extraGap and extraMajor information in the
> > CoinPackedMatrix is not copied
> > into this internal representation (which seems to be of
> > class ClpPackedMatrix
> > rather than CoinPackedMatrix).
>
> That sounds correct.
> If you don't want the OSI to copy the CoinPackedMatrix but
> rather assume ownership of the CoinPackedMatrix, then use
> the assignProblem method instead of loadProblem.
>
> void OsiSolverInterface::assignProblem(
>             CoinPackedMatrix *& matrix,
>             double *&   collb
>             double *&   colub,
>             double *&   obj,
>             double *&   rowlb,
>             double *&   rowub );
> http://www.coin-or.org/Doxygen/Osi/class_osi_solver_interface.html#z124_1
>
> It might be the case that OsiClp will construct a ClpPackedMatrix.
>
> JP
>
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss



More information about the Coin-discuss mailing list