OpenMD  2.5 Molecular Dynamics in the Open
JAMA::Eigenvalue< Real > Class Template Reference

`#include <Eigenvalue.hpp>`

## Public Member Functions

Eigenvalue (const DynamicRectMatrix< Real > &A)

void getV (DynamicRectMatrix< Real > &V_)

void getRealEigenvalues (DynamicVector< Real > &d_)

void getImagEigenvalues (DynamicVector< Real > &e_)

void getD (DynamicRectMatrix< 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

DynamicVector< Real > d

DynamicVector< Real > e

DynamicRectMatrix< Real > V

DynamicRectMatrix< Real > H

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

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 66 of file Eigenvalue.hpp.

## ◆ Eigenvalue()

template<class Real>
 JAMA::Eigenvalue< Real >::Eigenvalue ( const DynamicRectMatrix< Real > & A )
inline

Check for symmetry, then construct the eigenvalue decomposition

Parameters
 A Square real (non-complex) matrix

Definition at line 896 of file Eigenvalue.hpp.

References OpenMD::DynamicRectMatrix< Real >::getNCol().

## ◆ cdiv()

template<class Real>
 void JAMA::Eigenvalue< Real >::cdiv ( Real xr, Real xi, Real yr, Real yi )
inlineprivate

Definition at line 432 of file Eigenvalue.hpp.

## ◆ getD()

template<class Real>
 void JAMA::Eigenvalue< Real >::getD ( DynamicRectMatrix< 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.```

Definition at line 1001 of file Eigenvalue.hpp.

## ◆ getImagEigenvalues()

template<class Real>
 void JAMA::Eigenvalue< Real >::getImagEigenvalues ( DynamicVector< Real > & e_ )
inline

Return the imaginary parts of the eigenvalues in parameter e_.

Parameters
 e_ new matrix with imaginary parts of the eigenvalues.

Definition at line 962 of file Eigenvalue.hpp.

## ◆ getRealEigenvalues()

template<class Real>
 void JAMA::Eigenvalue< Real >::getRealEigenvalues ( DynamicVector< Real > & d_ )
inline

Return the real parts of the eigenvalues

Returns
real(diag(D))

Definition at line 952 of file Eigenvalue.hpp.

## ◆ getV()

template<class Real>
 void JAMA::Eigenvalue< Real >::getV ( DynamicRectMatrix< Real > & V_ )
inline

Return the eigenvector matrix

Returns
V

Definition at line 944 of file Eigenvalue.hpp.

Referenced by OpenMD::ContactAngle2::doFrame().

## ◆ hqr2()

template<class Real>
 void JAMA::Eigenvalue< Real >::hqr2 ( )
inlineprivate

Definition at line 450 of file Eigenvalue.hpp.

## ◆ orthes()

template<class Real>
 void JAMA::Eigenvalue< Real >::orthes ( )
inlineprivate

Definition at line 337 of file Eigenvalue.hpp.

## ◆ tql2()

template<class Real>
 void JAMA::Eigenvalue< Real >::tql2 ( )
inlineprivate

Definition at line 214 of file Eigenvalue.hpp.

## ◆ tred2()

template<class Real>
 void JAMA::Eigenvalue< Real >::tred2 ( )
inlineprivate

Definition at line 97 of file Eigenvalue.hpp.

## ◆ cdivi

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

Definition at line 431 of file Eigenvalue.hpp.

## ◆ cdivr

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

Definition at line 431 of file Eigenvalue.hpp.

## ◆ d

template<class Real>
 DynamicVector JAMA::Eigenvalue< Real >::d
private

Arrays for internal storage of eigenvalues.

Definition at line 77 of file Eigenvalue.hpp.

## ◆ e

template<class Real>
 DynamicVector JAMA::Eigenvalue< Real >::e
private

Definition at line 78 of file Eigenvalue.hpp.

## ◆ H

template<class Real>
 DynamicRectMatrix JAMA::Eigenvalue< Real >::H
private

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

Definition at line 86 of file Eigenvalue.hpp.

## ◆ issymmetric

template<class Real>
 int JAMA::Eigenvalue< Real >::issymmetric
private

Definition at line 73 of file Eigenvalue.hpp.

## ◆ n

template<class Real>
 int JAMA::Eigenvalue< Real >::n
private

Row and column dimension (square matrix).

Definition at line 71 of file Eigenvalue.hpp.

## ◆ ort

template<class Real>
 DynamicVector JAMA::Eigenvalue< Real >::ort
private

Working storage for nonsymmetric algorithm. working storage for nonsymmetric algorithm.

Definition at line 92 of file Eigenvalue.hpp.

## ◆ V

template<class Real>
 DynamicRectMatrix JAMA::Eigenvalue< Real >::V
private

Array for internal storage of eigenvectors.

Definition at line 81 of file Eigenvalue.hpp.

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