Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TMatrixDSymEigen.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_TMatrixDSymEigen
0013 #define ROOT_TMatrixDSymEigen
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TMatrixDSymEigen                                                     //
0018 //                                                                      //
0019 // Eigenvalues and eigenvectors of a real symmetric matrix.             //
0020 //                                                                      //
0021 //////////////////////////////////////////////////////////////////////////
0022 
0023 #include "TMatrixD.h"
0024 #include "TMatrixDSym.h"
0025 #include "TVectorD.h"
0026 
0027 class TMatrixDSymEigen
0028 {
0029 protected :
0030 
0031    static void MakeTridiagonal (TMatrixD &v,TVectorD &d,TVectorD &e);
0032    static void MakeEigenVectors(TMatrixD &v,TVectorD &d,TVectorD &e);
0033 
0034    TMatrixD fEigenVectors; // Eigen-vectors of matrix
0035    TVectorD fEigenValues;  // Eigen-values
0036 
0037 public :
0038 
0039    enum {kWorkMax = 100}; // size of work array
0040 
0041    TMatrixDSymEigen() : fEigenVectors(), fEigenValues() {};
0042    TMatrixDSymEigen(const TMatrixDSym      &a);
0043    TMatrixDSymEigen(const TMatrixDSymEigen &another);
0044    virtual ~TMatrixDSymEigen() {}
0045 
0046 // If matrix A has shape (rowLwb,rowUpb,rowLwb,rowUpb), then each eigen-vector
0047 // must have an index running between (rowLwb,rowUpb) .
0048 // For convenience, the column index of the eigen-vector matrix
0049 // also runs from rowLwb to rowUpb so that the returned matrix
0050 // has also index/shape (rowLwb,rowUpb,rowLwb,rowUpb) .
0051 // The same is true for the eigen-value vector .
0052 
0053    const TMatrixD &GetEigenVectors() const { return fEigenVectors; }
0054    const TVectorD &GetEigenValues () const { return fEigenValues; }
0055 
0056    TMatrixDSymEigen &operator= (const TMatrixDSymEigen &source);
0057 
0058    ClassDef(TMatrixDSymEigen,1) // Eigen-Vectors/Values of a Matrix
0059 };
0060 #endif