Exemple #1
0
CoinPackedVector::CoinPackedVector(const CoinPackedVectorBase & rhs) :
   CoinPackedVectorBase(),
   indices_(NULL),
   elements_(NULL),
   nElements_(0),
   origIndices_(NULL),
   capacity_(0)
{  
   gutsOfSetVector(rhs.getNumElements(), rhs.getIndices(), rhs.getElements(),
		   rhs.testForDuplicateIndex(), "copy constructor from base");
}
//-------------------------------------------------------------------
// Copy
//-------------------------------------------------------------------
CoinShallowPackedVector::CoinShallowPackedVector(const CoinPackedVectorBase &x)
  : CoinPackedVectorBase()
  , indices_(x.getIndices())
  , elements_(x.getElements())
  , nElements_(x.getNumElements())
{
  CoinPackedVectorBase::copyMaxMinIndex(x);
  try {
    CoinPackedVectorBase::setTestForDuplicateIndex(x.testForDuplicateIndex());
  } catch (CoinError &e) {
    throw CoinError("duplicate index", "copy constructor from base",
      "CoinShallowPackedVector");
  }
}