org.grinvin.util

Class Tridiagonal


public class Tridiagonal
extends java.lang.Object

This class represents a symmetric tridiagonal real matrix. The main purpose of this class is to provide information related to eigenvalues and eigenvectors of such matrices.

Field Summary

protected double[]
d
Diagonal elements of this matrix.
protected double[]
e
Subdiagonal elements of this matrix.
protected int
order
Order of this matrix.

Constructor Summary

Tridiagonal(double[][] a)
Create a tridiagonal matrix which is equivalent to the given symmetric real matrix a by some orthogonal transformation.

Method Summary

double[]
eigenvalues()
Compute the eigenvalues of this symmetric tridiagonal matrix using the QL algorithm with implicit shifts.

Field Details

d

protected double[] d
Diagonal elements of this matrix. Element d[i] contains the matrix element at position (i,i).

e

protected double[] e
Subdiagonal elements of this matrix. Element e[i] contains the matrix element at position (i,i-1). Element e[0] is set to zero.

order

protected int order
Order of this matrix.

Constructor Details

Tridiagonal

public Tridiagonal(double[][] a)
Create a tridiagonal matrix which is equivalent to the given symmetric real matrix a by some orthogonal transformation. Uses Householder reduction.

Note: This implementation is almost a literal copy of the algorithm tred2 from Numerical recipes in C, ISBN 0-521-43108-5.

Method Details

eigenvalues

public double[] eigenvalues()
Compute the eigenvalues of this symmetric tridiagonal matrix using the QL algorithm with implicit shifts.

Note: This implementation is almost a literal copy of the algorithm tqli from Numerical recipes in C, ISBN 0-521-43108-5.