コード例 #1
0
/*
  Extract the current version of the row or column from the CoinPostsolveMatrix
  into a CoinPackedVector, sort it, and compare it to the stored
  CoinPackedVector. Differences are reported to std::cout.
*/
void CoinPresolveMonitor::checkAndTell (const CoinPostsolveMatrix *mtx)
{
  CoinPackedVector *curVec = 0 ;
  const double *lbs = 0 ;
  const double *ubs = 0 ;
  if (isRow_) {
    lbs = mtx->getRowLower() ;
    ubs = mtx->getRowUpper() ;
    curVec = extractRow(ndx_,mtx) ;
  } else {
    curVec = extractCol(ndx_,mtx) ;
    lbs = mtx->getColLower() ;
    ubs = mtx->getColUpper() ;
  }
  checkAndTell(curVec,lbs[ndx_],ubs[ndx_]) ;
}
コード例 #2
0
/*
  Constructor to initialise from a CoinPostsolveMatrix
*/
CoinPresolveMonitor::CoinPresolveMonitor (const CoinPostsolveMatrix *mtx,
					  bool isRow,
					  int k)
{
  ndx_ = k ;
  isRow_ = isRow ;

  if (isRow) {
    origVec_ = extractRow(k,mtx) ;
    const double *blow = mtx->getRowLower() ;
    lb_ = blow[k] ;
    const double *b = mtx->getRowUpper() ;
    ub_ = b[k] ;
  } else {
    origVec_ = extractCol(k,mtx) ;
    const double *lb = mtx->getColLower() ;
    lb_ = lb[k] ;
    const double *ub = mtx->getColUpper() ;
    ub_ = ub[k] ;
  }
  origVec_->sortIncrIndex() ;
}
コード例 #3
0
ファイル: TextMatrix.cpp プロジェクト: vschulz/rvtests
std::vector<std::string> TextMatrix::extractCol(const std::string& col) const {
  std::vector<std::string> v;
  extractCol(col, &v);
  return v;
}