CEDRIC  Revision_backup-2009-02
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Eigenvalue< ValueType > Class Template Reference

#include <Eigenvalue.h>

Public Types

typedef
boost::numeric::ublas::matrix
< ValueType > 
Matrix
 
typedef
boost::numeric::ublas::vector
< ValueType > 
Vector
 

Public Member Functions

 Eigenvalue (const Matrix &A)
 
const Matrix & getV () const
 
const Vector & getRealEigenvalues () const
 
const Vector & getImagEigenvalues () const
 
void getD (Matrix &D)
 

Static Public Member Functions

static bool isSymmetric (const Matrix &A)
 

Detailed Description

template<class ValueType>
class Eigenvalue< ValueType >

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.

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).

Member Typedef Documentation

template<class ValueType>
typedef boost::numeric::ublas::matrix<ValueType> Eigenvalue< ValueType >::Matrix
template<class ValueType>
typedef boost::numeric::ublas::vector<ValueType> Eigenvalue< ValueType >::Vector

Constructor & Destructor Documentation

template<class ValueType>
Eigenvalue< ValueType >::Eigenvalue ( const Matrix &  A)
inline

Check for symmetry, then construct the eigenvalue decomposition

Parameters
ASquare real (non-complex) matrix

References Eigenvalue< ValueType >::isSymmetric().

Member Function Documentation

template<class ValueType>
void Eigenvalue< ValueType >::getD ( Matrix &  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.

Parameters
Dupon return, the matrix is filled with the block diagonal eigenvalue matrix.
template<class ValueType>
const Vector& Eigenvalue< ValueType >::getImagEigenvalues ( ) const
inline

Return the imaginary parts of the eigenvalues

Returns
: imaginary parts of the eigenvalues
template<class ValueType>
const Vector& Eigenvalue< ValueType >::getRealEigenvalues ( ) const
inline

Return the real parts of the eigenvalues

Returns
real(diag(D))

Referenced by CMDS< ValueType >::CMDS().

template<class ValueType>
const Matrix& Eigenvalue< ValueType >::getV ( ) const
inline

Return the eigenvector matrix

Returns
V

Referenced by CMDS< ValueType >::CMDS().

template<class ValueType>
static bool Eigenvalue< ValueType >::isSymmetric ( const Matrix &  A)
inlinestatic

This function is used to decide wether the procedure for symmetric matrices can be used.

Referenced by Eigenvalue< ValueType >::Eigenvalue().