Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# LA::Eigenvalues Class Reference

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

`#include <LA_Eigenvalues.h>`

Collaboration diagram for LA::Eigenvalues:

[legend]
List of all members.

## Public Member Functions
| Eigenvalues (const Matrix &A)
| Check for symmetry, then construct the eigenvalue decomposition.
const Matrix & | getV () const
| Returns a reference to the matrix with the eigenvectors.
const Vector & | getRealEigenvalues () const
| Returns a reference to the vector with the real eigenvalues.
const Vector & | getImagEigenvalues () const
| Returns a reference to the vector with the real eigenvalues.
Matrix | getD () const
| Computes the block diagonal eigenvalue matrix.
## Private Member Functions
| Eigenvalues (const Eigenvalues &ev)
Eigenvalues & | operator= (const Eigenvalues &ev)
void | tred2 ()
void | tql2 ()
void | orthes ()
void | cdiv (double xr, double xi, double yr, double yi)
void | hqr2 ()
## Private Attributes
int | n
| Row and column dimension (square matrix).
int | issymmetric
Vector | d
| Arrays for internal storage of eigenvalues.
Vector | e
Matrix | V
| Array for internal storage of eigenvectors.
Matrix | H
| Array for internal storage of nonsymmetric Hessenberg form.
Vector | ort
| Working storage for nonsymmetric algorithm.
double | cdivr
double | cdivi

## Detailed Description

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

Definition at line 67 of file LA_Eigenvalues.h.

## Constructor & Destructor Documentation

LA::Eigenvalues::Eigenvalues | ( | const Matrix & | A | ) |

  | Check for symmetry, then construct the eigenvalue decomposition. Parameters:
  A | Square real (non-complex) matrix
Definition at line 8 of file LA_Eigenvalues.cpp. References LA::Matrix::columns(), LA::Vector::create(), LA::Matrix::create(), e, H, hqr2(), issymmetric, ort, orthes(), tql2(), tred2(), and V.

Here is the call graph for this function:

LA::Eigenvalues::Eigenvalues | ( | const Eigenvalues & | ev | ) | `[inline, private]`

| Definition at line 77 of file LA_Eigenvalues.h.

## Member Function Documentation

Eigenvalues& LA::Eigenvalues::operator= | ( | const Eigenvalues & | ev | ) | `[inline, private]`

| Definition at line 78 of file LA_Eigenvalues.h.

const Matrix & LA::Eigenvalues::getV | ( |  | ) | const

| Returns a reference to the matrix with the eigenvectors. Returns: Reference to a matrix with the eigenvectors. Definition at line 64 of file LA_Eigenvalues.cpp. References V.

const Vector & LA::Eigenvalues::getRealEigenvalues | ( |  | ) | const

| Returns a reference to the vector with the real eigenvalues. Returns: Reference to the vector with the real eigenvalues. Definition at line 69 of file LA_Eigenvalues.cpp.

const Vector & LA::Eigenvalues::getImagEigenvalues | ( |  | ) | const

| Returns a reference to the vector with the real eigenvalues. Returns: Reference to the vector with the real eigenvalues. Definition at line 74 of file LA_Eigenvalues.cpp. References e.

Matrix LA::Eigenvalues::getD | ( |  | ) | const

| 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. Returns: upon return, the matrix is filled with the block diagonal eigenvalue matrix. Definition at line 79 of file LA_Eigenvalues.cpp. References e.

void LA::Eigenvalues::tred2 | ( |  | ) | `[private]`

| Definition at line 101 of file LA_Eigenvalues.cpp. References e, e, V(), and V. Referenced by Eigenvalues().

Here is the call graph for this function:

void LA::Eigenvalues::tql2 | ( |  | ) | `[private]`

| Definition at line 236 of file LA_Eigenvalues.cpp. References e, e, V(), and V. Referenced by Eigenvalues().

Here is the call graph for this function:

void LA::Eigenvalues::orthes | ( |  | ) | `[private]`

| Definition at line 375 of file LA_Eigenvalues.cpp. References H, ort, and V. Referenced by Eigenvalues().

void LA::Eigenvalues::cdiv | ( | double | xr,
|  | double | xi,
|  | double | yr,
|  | double | yi
| ) | `[private]`

| Definition at line 482 of file LA_Eigenvalues.cpp. References cdivi, and cdivr. Referenced by hqr2().

void LA::Eigenvalues::hqr2 | ( |  | ) | `[private]`

| Definition at line 501 of file LA_Eigenvalues.cpp. References cdiv(), cdivi, cdivr, e, e, H, V(), and V. Referenced by Eigenvalues().

Here is the call graph for this function:

## Member Data Documentation

int LA::Eigenvalues::n`[private]`

| Row and column dimension (square matrix). Definition at line 151 of file LA_Eigenvalues.h.

int LA::Eigenvalues::issymmetric`[private]`

| Definition at line 153 of file LA_Eigenvalues.h. Referenced by Eigenvalues().

Vector LA::Eigenvalues::d`[private]`

| Arrays for internal storage of eigenvalues. Definition at line 156 of file LA_Eigenvalues.h.

Vector LA::Eigenvalues::e`[private]`

| Definition at line 157 of file LA_Eigenvalues.h. Referenced by Eigenvalues(), getD(), getImagEigenvalues(), hqr2(), tql2(), and tred2().

Matrix LA::Eigenvalues::V`[private]`

| Array for internal storage of eigenvectors. Definition at line 160 of file LA_Eigenvalues.h. Referenced by Eigenvalues(), getV(), hqr2(), orthes(), tql2(), and tred2().

Matrix LA::Eigenvalues::H`[private]`

| Array for internal storage of nonsymmetric Hessenberg form. internal storage of nonsymmetric Hessenberg form. Definition at line 165 of file LA_Eigenvalues.h. Referenced by Eigenvalues(), hqr2(), and orthes().

Vector LA::Eigenvalues::ort`[private]`

| Working storage for nonsymmetric algorithm. working storage for nonsymmetric algorithm. Definition at line 170 of file LA_Eigenvalues.h. Referenced by Eigenvalues(), and orthes().

double LA::Eigenvalues::cdivr`[private]`

| Definition at line 172 of file LA_Eigenvalues.h. Referenced by cdiv(), and hqr2().

double LA::Eigenvalues::cdivi`[private]`

| Definition at line 172 of file LA_Eigenvalues.h. Referenced by cdiv(), and hqr2().

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

- Tools/Math/LA_Eigenvalues.h
- Tools/Math/LA_Eigenvalues.cpp