Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TMatrixDEigen.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/matrix:$Id$
0002 // Authors: Fons Rademakers, Eddy Offermann   Dec 2003
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TMatrixDEigen
0013 #define ROOT_TMatrixDEigen
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TMatrixDEigen                                                        //
0018 //                                                                      //
0019 // Eigenvalues and eigenvectors of a real matrix.                       //
0020 //                                                                      //
0021 //////////////////////////////////////////////////////////////////////////
0022 
0023 #include "TMatrixD.h"
0024 #include "TVectorD.h"
0025 
0026 class TMatrixDEigen
0027 {
0028 protected :
0029 
0030    static void MakeHessenBerg  (TMatrixD &v,TVectorD &ortho,TMatrixD &H);
0031    static void MakeSchurr      (TMatrixD &v,TVectorD &d,    TVectorD &e,TMatrixD &H);
0032    static void Sort            (TMatrixD &v,TVectorD &d,    TVectorD &e);
0033 
0034    TMatrixD fEigenVectors;   // Eigen-vectors of matrix
0035    TVectorD fEigenValuesRe;  // Eigen-values
0036    TVectorD fEigenValuesIm;  // Eigen-values
0037 
0038 public :
0039 
0040    enum {kWorkMax = 100}; // size of work array
0041 
0042    TMatrixDEigen()
0043      : fEigenVectors(), fEigenValuesRe(), fEigenValuesIm() {};
0044    TMatrixDEigen(const TMatrixD &a);
0045    TMatrixDEigen(const TMatrixDEigen &another);
0046    virtual ~TMatrixDEigen() {}
0047 
0048 // If matrix A has shape (rowLwb,rowUpb,rowLwb,rowUpb), then each eigen-vector
0049 // must have an index running between (rowLwb,rowUpb) .
0050 // For convenience, the column index of the eigen-vector matrix
0051 // also runs from rowLwb to rowUpb so that the returned matrix
0052 // has also index/shape (rowLwb,rowUpb,rowLwb,rowUpb) .
0053 // The same is true for the eigen-value vectors an matrix .
0054 
0055    const TMatrixD &GetEigenVectors () const { return fEigenVectors;  }
0056    const TVectorD &GetEigenValuesRe() const { return fEigenValuesRe; }
0057    const TVectorD &GetEigenValuesIm() const { return fEigenValuesIm; }
0058    const TMatrixD  GetEigenValues  () const;
0059 
0060    TMatrixDEigen &operator= (const TMatrixDEigen &source);
0061 
0062    ClassDef(TMatrixDEigen,1) // Eigen-Vectors/Values of a Matrix
0063 };
0064 #endif