Essentia  2.1-beta6-dev
Eigenvalue< Real > Class Template Reference

#include <jama_eig.h>

Public Member Functions

 Eigenvalue (const TNT::Array2D< Real > &A)
 
void getV (TNT::Array2D< Real > &V_)
 
void getRealEigenvalues (TNT::Array1D< Real > &d_)
 
void getImagEigenvalues (TNT::Array1D< Real > &e_)
 
void getD (TNT::Array2D< Real > &D)
 

Private Member Functions

void tred2 ()
 
void tql2 ()
 
void orthes ()
 
void cdiv (Real xr, Real xi, Real yr, Real yi)
 
void hqr2 ()
 

Private Attributes

int n
 
int issymmetric
 
TNT::Array1D< Real > d
 
TNT::Array1D< Real > e
 
TNT::Array2D< Real > V
 
TNT::Array2D< Real > H
 
TNT::Array1D< Real > ort
 
Real cdivr
 
Real cdivi
 

Detailed Description

template<class Real>
class JAMA::Eigenvalue< Real >

Computes eigenvalues and eigenvectors of a real (non-complex) matrix.

If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is diagonal and the eigenvector matrix V is orthogonal. That is, the diagonal values of D are the eigenvalues, and V*V' = I, where I is the identity matrix. The columns of V represent the eigenvectors in the sense that A*V = V*D.

If A is not symmetric, then the eigenvalue matrix D is block diagonal with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues, a + i*b, in 2-by-2 blocks, [a, b; -b, a]. That is, if the complex eigenvalues look like


          u + iv     .        .          .      .    .
            .      u - iv     .          .      .    .
            .        .      a + ib       .      .    .
            .        .        .        a - ib   .    .
            .        .        .          .      x    .
            .        .        .          .      .    y

then D looks like


            u        v        .          .      .    .
           -v        u        .          .      .    .
            .        .        a          b      .    .
            .        .       -b          a      .    .
            .        .        .          .      x    .
            .        .        .          .      .    y

This keeps V a real matrix in both symmetric and non-symmetric cases, and A*V = V*D.

<p>
The matrix V may be badly
conditioned, or even singular, so the validity of the equation
A = V*D*inverse(V) depends upon the condition number of V.

(Adapted from JAMA, a Java Matrix Library, developed by jointly by the Mathworks and NIST; see http://math.nist.gov/javanumerics/jama).

Constructor & Destructor Documentation

◆ Eigenvalue()

Eigenvalue ( const TNT::Array2D< Real > &  A)
inline

Check for symmetry, then construct the eigenvalue decomposition

Parameters
ASquare real (non-complex) matrix

References Array2D< T >::dim2().

Member Function Documentation

◆ cdiv()

void cdiv ( Real  xr,
Real  xi,
Real  yr,
Real  yi 
)
inlineprivate

◆ getD()

void getD ( TNT::Array2D< Real > &  D)
inline
    Computes the block diagonal eigenvalue matrix.
If the original matrix A is not symmetric, then the eigenvalue
    matrix D is block diagonal with the real eigenvalues in 1-by-1
    blocks and any complex eigenvalues,
a + i*b, in 2-by-2 blocks, [a, b; -b, a].  That is, if the complex
eigenvalues look like

          u + iv     .        .          .      .    .
            .      u - iv     .          .      .    .
            .        .      a + ib       .      .    .
            .        .        .        a - ib   .    .
            .        .        .          .      x    .
            .        .        .          .      .    y

then D looks like


            u        v        .          .      .    .
           -v        u        .          .      .    .
            .        .        a          b      .    .
            .        .       -b          a      .    .
            .        .        .          .      x    .
            .        .        .          .      .    y

This keeps V a real matrix in both symmetric and non-symmetric cases, and A*V = V*D.

@param D: upon return, the matrix is filled with the block diagonal
eigenvalue matrix.

◆ getImagEigenvalues()

void getImagEigenvalues ( TNT::Array1D< Real > &  e_)
inline

Return the imaginary parts of the eigenvalues in parameter e_.

@pararm e_: new matrix with imaginary parts of the eigenvalues.

◆ getRealEigenvalues()

void getRealEigenvalues ( TNT::Array1D< Real > &  d_)
inline

Return the real parts of the eigenvalues

Returns
real(diag(D))

◆ getV()

void getV ( TNT::Array2D< Real > &  V_)
inline

Return the eigenvector matrix

Returns
V

◆ hqr2()

void hqr2 ( )
inlineprivate

References essentia::norm().

◆ orthes()

void orthes ( )
inlineprivate

◆ tql2()

void tql2 ( )
inlineprivate

References TNT::hypot().

◆ tred2()

void tred2 ( )
inlineprivate

Member Data Documentation

◆ cdivi

Real cdivi
private

◆ cdivr

Real cdivr
private

◆ d

TNT::Array1D<Real> d
private

Arrays for internal storage of eigenvalues.

◆ e

TNT::Array1D<Real> e
private

◆ H

TNT::Array2D<Real> H
private

Array for internal storage of nonsymmetric Hessenberg form. @serial internal storage of nonsymmetric Hessenberg form.

◆ issymmetric

int issymmetric
private

◆ n

int n
private

Row and column dimension (square matrix).

◆ ort

TNT::Array1D<Real> ort
private

Working storage for nonsymmetric algorithm. @serial working storage for nonsymmetric algorithm.

◆ V

TNT::Array2D<Real> V
private

Array for internal storage of eigenvectors.


The documentation for this class was generated from the following file: