void OsiTestSolverInterface::colRimResize_(const int newSize) { if (newSize > maxNumcols_) { double* cub = colupper_; double* clb = collower_; bool* cont = continuous_; double* obj = objcoeffs_; double* sol = colsol_; double* rc = rc_; maxNumcols_ = CoinMax(1000, (newSize * 5) / 4); colRimAllocator_(); const int colnum = getNumCols(); CoinDisjointCopyN(cub , colnum, colupper_); CoinDisjointCopyN(clb , colnum, collower_); CoinDisjointCopyN(cont, colnum, continuous_); CoinDisjointCopyN(obj , colnum, objcoeffs_); CoinDisjointCopyN(sol , colnum, colsol_); CoinDisjointCopyN(rc , colnum, rc_); delete[] cub; delete[] clb; delete[] cont; delete[] obj; delete[] sol; delete[] rc; } }
void OsiVolSolverInterface::initFromClbCubObj(const int colnum, const double* collb, const double* colub, const double* obj) { if (maxNumcols_ > 0) { colRimAllocator_(); if (colub) { CoinDisjointCopyN(colub, colnum, colupper_); } else { CoinFillN(colupper_, colnum, OsiVolInfinity); } if (collb) { CoinDisjointCopyN(collb, colnum, collower_); } else { CoinFillN(collower_, colnum, 0.0); } CoinFillN(continuous_,colnum,true); if (obj) { CoinDisjointCopyN(obj, colnum, objcoeffs_); } else { CoinFillN(objcoeffs_, colnum, 0.0); } int c; for ( c=0; c<colnum; c++ ) { if ( fabs(collower_[c]) < fabs(colupper_[c]) ) { colsol_[c] = collower_[c]; } else { colsol_[c] = colupper_[c]; } } } }
OsiTestSolverInterface& OsiTestSolverInterface::operator=(const OsiTestSolverInterface& rhs) { if (&rhs == this) return *this; OsiSolverInterface::operator=(rhs); gutsOfDestructor_(); rowMatrixCurrent_ = rhs.rowMatrixCurrent_; if (rowMatrixCurrent_) rowMatrix_ = rhs.rowMatrix_; colMatrixCurrent_ = rhs.colMatrixCurrent_; if (colMatrixCurrent_) colMatrix_ = rhs.colMatrix_; if (rhs.maxNumrows_) { maxNumrows_ = rhs.maxNumrows_; rowRimAllocator_(); const int rownum = getNumRows(); CoinDisjointCopyN(rhs.rowupper_, rownum, rowupper_); CoinDisjointCopyN(rhs.rowlower_, rownum, rowlower_); CoinDisjointCopyN(rhs.rowsense_, rownum, rowsense_); CoinDisjointCopyN(rhs.rhs_, rownum, rhs_); CoinDisjointCopyN(rhs.rowrange_, rownum, rowrange_); CoinDisjointCopyN(rhs.rowprice_, rownum, rowprice_); CoinDisjointCopyN(rhs.lhs_, rownum, lhs_); } if (rhs.maxNumcols_) { maxNumcols_ = rhs.maxNumcols_; colRimAllocator_(); const int colnum = getNumCols(); CoinDisjointCopyN(rhs.colupper_, colnum, colupper_); CoinDisjointCopyN(rhs.collower_, colnum, collower_); CoinDisjointCopyN(rhs.continuous_, colnum, continuous_); CoinDisjointCopyN(rhs.objcoeffs_, colnum, objcoeffs_); CoinDisjointCopyN(rhs.colsol_, colnum, colsol_); CoinDisjointCopyN(rhs.rc_, colnum, rc_); } volprob_.parm.granularity = 0.0; return *this; }