Re: Solving eigenvalue problem with root

From: Edmond Offermann <edmondoffermann_at_yahoo.com>
Date: Wed, 23 Sep 2009 04:20:01 -0700


Hi Ajinkya

Have a look at the User's Guide, in particular the Linear Algebra section:

ftp://root.cern.ch/root/doc/14LinearAlgebra.pdf

In the matrix eigen analysis section, this code snippet is mentioned:

TMatrixDSym mtm(TMatrixDBase::kAtA,m);
const TMatrixDSymEigen eigen(mtm);
const TVectorD eigenVal = eigen.GetEigenValues();

Here a symmetric matrix m^T m is created; next line the constructor of the TMatrixDSymEigen is created, followed by a call to retrieve the eigen-values.

Eddy



From: Ajinkya Kamat <ask1710_at_gmail.com>
To: roottalk_at_root.cern.ch
Sent: Tuesday, September 22, 2009 6:29:43 PM Subject: [ROOT] Solving eigenvalue problem with root

Hi all,

I have to solve an eigenvalue problem using ROOT. So basically i need to diagonalize a matrix. I don't know how to do that. I checked the user guide for ROOT 5.24, but I couldn't figure it out.

Should I declare the matrix M that is to be diagonalize as

TMatrixDSym(N) M;

if M is an N X N matrix? What happens is when I execute the code any line after this declaration of M is not executed and the pointer comes back to root promt ( root$ )

Then I did the following:

TVectorD eigen;

eigen = M.GetEigenVaues();

Is that correct?

Please guide me. I'm using ROOT 5.22.

Thanks,
Ajinkya
Graduate Student
University of Virginia. Received on Wed Sep 23 2009 - 13:20:13 CEST

This archive was generated by hypermail 2.2.0 : Wed Sep 23 2009 - 23:50:02 CEST