00001 // @(#)root/matrix:$Id: TMatrixDSymEigen.h 22428 2008-03-03 18:17:03Z brun $ 00002 // Authors: Fons Rademakers, Eddy Offermann Dec 2003 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TMatrixDSymEigen 00013 #define ROOT_TMatrixDSymEigen 00014 00015 ////////////////////////////////////////////////////////////////////////// 00016 // // 00017 // TMatrixDSymEigen // 00018 // // 00019 // Eigenvalues and eigenvectors of a real symmetric matrix. // 00020 // // 00021 ////////////////////////////////////////////////////////////////////////// 00022 00023 #ifndef ROOT_TMatrixD 00024 #include "TMatrixD.h" 00025 #endif 00026 #ifndef ROOT_TMatrixDSym 00027 #include "TMatrixDSym.h" 00028 #endif 00029 #ifndef ROOT_TVectorD 00030 #include "TVectorD.h" 00031 #endif 00032 00033 class TMatrixDSymEigen 00034 { 00035 protected : 00036 00037 static void MakeTridiagonal (TMatrixD &v,TVectorD &d,TVectorD &e); 00038 static void MakeEigenVectors(TMatrixD &v,TVectorD &d,TVectorD &e); 00039 00040 TMatrixD fEigenVectors; // Eigen-vectors of matrix 00041 TVectorD fEigenValues; // Eigen-values 00042 00043 public : 00044 00045 enum {kWorkMax = 100}; // size of work array 00046 00047 TMatrixDSymEigen() : fEigenVectors(), fEigenValues() {}; 00048 TMatrixDSymEigen(const TMatrixDSym &a); 00049 TMatrixDSymEigen(const TMatrixDSymEigen &another); 00050 virtual ~TMatrixDSymEigen() {} 00051 00052 // If matrix A has shape (rowLwb,rowUpb,rowLwb,rowUpb), then each eigen-vector 00053 // must have an index running between (rowLwb,rowUpb) . 00054 // For convenience, the column index of the eigen-vector matrix 00055 // also runs from rowLwb to rowUpb so that the returned matrix 00056 // has also index/shape (rowLwb,rowUpb,rowLwb,rowUpb) . 00057 // The same is true for the eigen-value vector . 00058 00059 const TMatrixD &GetEigenVectors() const { return fEigenVectors; } 00060 const TVectorD &GetEigenValues () const { return fEigenValues; } 00061 00062 TMatrixDSymEigen &operator= (const TMatrixDSymEigen &source); 00063 00064 ClassDef(TMatrixDSymEigen,1) // Eigen-Vectors/Values of a Matrix 00065 }; 00066 #endif