TMatrix assignment operator

From: Nicolas Produit (Nicolas.Produit@obs.unige.ch)
Date: Thu Feb 10 2000 - 14:29:40 MET


In code for TMatrix operator =
if the target matrix is not compatible with source matrix you silentely
do nothing.
I would have imagined that we must distroy the target matrix and create
a new one with correct dimention?
Or at least issue a warning message?
Anybody can explain me the reason and is this behaviour also implicit in
other part of root code?
Is this common practise in C++?

TMatrix &TMatrix::operator=(const TMatrix &source)
{
   if (this != &source && AreCompatible(*this, source)) {
      TObject::operator=(source);
      memcpy(fElements, source.fElements, fNelems*sizeof(Real_t));
   }
   return *this;
}


-- 
              Nicolas Produit



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:18 MET