ROOT  6.06/09
Reference Guide
TMatrixDEigen.h
Go to the documentation of this file.
1 // @(#)root/matrix:$Id$
2 // Authors: Fons Rademakers, Eddy Offermann Dec 2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TMatrixDEigen
13 #define ROOT_TMatrixDEigen
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TMatrixDEigen //
18 // //
19 // Eigenvalues and eigenvectors of a real matrix. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #ifndef ROOT_TMatrixD
24 #include "TMatrixD.h"
25 #endif
26 #ifndef ROOT_TVectorD
27 #include "TVectorD.h"
28 #endif
29 
31 {
32 protected :
33 
34  static void MakeHessenBerg (TMatrixD &v,TVectorD &ortho,TMatrixD &H);
35  static void MakeSchurr (TMatrixD &v,TVectorD &d, TVectorD &e,TMatrixD &H);
36  static void Sort (TMatrixD &v,TVectorD &d, TVectorD &e);
37 
38  TMatrixD fEigenVectors; // Eigen-vectors of matrix
39  TVectorD fEigenValuesRe; // Eigen-values
40  TVectorD fEigenValuesIm; // Eigen-values
41 
42 public :
43 
44  enum {kWorkMax = 100}; // size of work array
45 
47  : fEigenVectors(), fEigenValuesRe(), fEigenValuesIm() {};
48  TMatrixDEigen(const TMatrixD &a);
49  TMatrixDEigen(const TMatrixDEigen &another);
50  virtual ~TMatrixDEigen() {}
51 
52 // If matrix A has shape (rowLwb,rowUpb,rowLwb,rowUpb), then each eigen-vector
53 // must have an index running between (rowLwb,rowUpb) .
54 // For convenience, the column index of the eigen-vector matrix
55 // also runs from rowLwb to rowUpb so that the returned matrix
56 // has also index/shape (rowLwb,rowUpb,rowLwb,rowUpb) .
57 // The same is true for the eigen-value vectors an matrix .
58 
59  const TMatrixD &GetEigenVectors () const { return fEigenVectors; }
60  const TVectorD &GetEigenValuesRe() const { return fEigenValuesRe; }
61  const TVectorD &GetEigenValuesIm() const { return fEigenValuesIm; }
62  const TMatrixD GetEigenValues () const;
63 
64  TMatrixDEigen &operator= (const TMatrixDEigen &source);
65 
66  ClassDef(TMatrixDEigen,1) // Eigen-Vectors/Values of a Matrix
67 };
68 #endif
TMatrixD fEigenVectors
Definition: TMatrixDEigen.h:38
const TMatrixD & GetEigenVectors() const
Definition: TMatrixDEigen.h:59
#define H(x, y, z)
static void MakeHessenBerg(TMatrixD &v, TVectorD &ortho, TMatrixD &H)
Nonsymmetric reduction to Hessenberg form.
TArc * a
Definition: textangle.C:12
TVectorD fEigenValuesRe
Definition: TMatrixDEigen.h:39
TVectorD fEigenValuesIm
Definition: TMatrixDEigen.h:40
#define ClassDef(name, id)
Definition: Rtypes.h:254
const TMatrixD GetEigenValues() const
Computes the block diagonal eigenvalue matrix.
SVector< double, 2 > v
Definition: Dict.h:5
static void MakeSchurr(TMatrixD &v, TVectorD &d, TVectorD &e, TMatrixD &H)
Nonsymmetric reduction from Hessenberg to real Schur form.
static void Sort(TMatrixD &v, TVectorD &d, TVectorD &e)
Sort eigenvalues and corresponding vectors in descending order of Re^2+Im^2 of the complex eigenvalue...
virtual ~TMatrixDEigen()
Definition: TMatrixDEigen.h:50
const TVectorD & GetEigenValuesIm() const
Definition: TMatrixDEigen.h:61
TMatrixDEigen & operator=(const TMatrixDEigen &source)
Assignment operator.
const TVectorD & GetEigenValuesRe() const
Definition: TMatrixDEigen.h:60