void OsiTestSolverInterface::rowRimResize_(const int newSize) { if (newSize > maxNumrows_) { double* rub = rowupper_; double* rlb = rowlower_; char* sense = rowsense_; double* right = rhs_; double* range = rowrange_; double* dual = rowprice_; double* left = lhs_; maxNumrows_ = CoinMax(1000, (newSize * 5) / 4); rowRimAllocator_(); const int rownum = getNumRows(); CoinDisjointCopyN(rub , rownum, rowupper_); CoinDisjointCopyN(rlb , rownum, rowlower_); CoinDisjointCopyN(sense, rownum, rowsense_); CoinDisjointCopyN(right, rownum, rhs_); CoinDisjointCopyN(range, rownum, rowrange_); CoinDisjointCopyN(dual , rownum, rowprice_); CoinDisjointCopyN(left , rownum, lhs_); delete[] rub; delete[] rlb; delete[] sense; delete[] right; delete[] range; delete[] dual; delete[] left; } }
void OsiVolSolverInterface::initFromRhsSenseRange(const int rownum, const char* rowsen, const double* rowrhs, const double* rowrng) { if (maxNumrows_ > 0) { rowRimAllocator_(); if (rowsen) { CoinDisjointCopyN(rowsen, rownum, rowsense_); } else { CoinFillN(rowsense_, rownum, 'G'); } if (rowrhs) { CoinDisjointCopyN(rowrhs, rownum, rhs_); } else { CoinFillN(rhs_, rownum, 0.0); } if (rowrng) { CoinDisjointCopyN(rowrng, rownum, rowrange_); } else { CoinFillN(rowrange_, rownum, 0.0); } // Set the initial dual solution CoinFillN(rowprice_, rownum, 0.0); convertSensesToBounds_(); } }
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; }
void OsiVolSolverInterface::initFromRlbRub(const int rownum, const double* rowlb, const double* rowub) { if (maxNumrows_ > 0) { rowRimAllocator_(); if (rowub) { CoinDisjointCopyN(rowub, rownum, rowupper_); } else { CoinFillN(rowupper_, rownum, OsiVolInfinity); } if (rowlb) { CoinDisjointCopyN(rowlb, rownum, rowlower_); } else { CoinFillN(rowlower_, rownum, -OsiVolInfinity); } // Set the initial dual solution CoinFillN(rowprice_, rownum, 0.0); convertBoundsToSenses_(); } }