Re: Error in <TVectorT<double>::operator=(const TVectorT<Element> &)>: vectors not compatible

From: Edmond Offermann <edmondoffermann_at_yahoo.com>
Date: Thu, 10 Dec 2009 09:00:49 -0800


Hi Robert,
In the linear algebra package, memory is only automatically allocated in the constructors. In other cases you will have to do an explicit ResizeTo operation. So change your code to

  1. TVectorD Lambda = aSVD.GetSig (copy constructor)
  2. Lambda.ResizeTo(aSVD.GetSig()); Lambda = aSVD.GetSig() (assignment operator)

Eddy



From: Robert Riemann <robert.riemann_at_physik.hu-berlin.de> To: roottalk_at_root.cern.ch
Sent: Thu, December 10, 2009 10:24:35 AM Subject: [ROOT] Error in <TVectorT<double>::operator=(const TVectorT<Element> &)>: vectors not compatible

Hi everyone,

I have a serious problem. I want to write an analysis-class using the following piece of code to compute the eigenvalues.

  TDecompSVD aSVD(MomentumTensor);
  Lambda = aSVD.GetSig();

Lambda was declared in header file with: TVectorD Lambda;

But in the second line of code i get the following error (program don't stop running):

Error in <TVectorT<double>::operator=(const TVectorT<Element> &)>: vectors not compatible

Where is the mistake? Does anybody have an idea?

Regards,
Robert Riemann Received on Thu Dec 10 2009 - 18:00:54 CET

This archive was generated by hypermail 2.2.0 : Thu Dec 10 2009 - 23:50:02 CET