org.jmol.util
Class Eigen

java.lang.Object
  extended by org.jmol.util.Eigen

public class Eigen
extends java.lang.Object

Eigenvalues and eigenvectors of a real (n x n) symmetric matrix. adapted by Bob Hanson from http://math.nist.gov/javanumerics/jama/ (public domain)

If A is symmetric, then A = V*D*V' where the eigenvalue matrix D is diagonal and the eigenvector matrix V is orthogonal. I.e. A = V.times(D.times(V.transpose())) and V.times(V.transpose()) equals the identity matrix. output is as a set of double[n] columns, but for Jmol we use getEigenvectorsFloatTransformed to return them as a set of rows for easier use as A[0], A[1], etc.


Field Summary
private  double[] d
          Arrays for internal storage of eigenvalues.
private  double[] e
          Arrays for internal storage of eigenvalues.
private  int n
          Row and column dimension (square matrix).
private  double[][] V
          Array for internal storage of eigenvectors.
 
Constructor Summary
Eigen(double[][] A)
           
 
Method Summary
 double[] getEigenvalues()
           
 double[][] getEigenvectors()
           
 float[][] getEigenvectorsFloatTransposed()
          transpose V and turn into floats
private static double hypot(double a, double b)
           
private  void tql2()
           
private  void tred2()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

n

private int n
Row and column dimension (square matrix).


d

private double[] d
Arrays for internal storage of eigenvalues.


e

private double[] e
Arrays for internal storage of eigenvalues.


V

private double[][] V
Array for internal storage of eigenvectors.

Constructor Detail

Eigen

public Eigen(double[][] A)
Method Detail

tred2

private void tred2()

tql2

private void tql2()

getEigenvectors

public double[][] getEigenvectors()

getEigenvalues

public double[] getEigenvalues()

getEigenvectorsFloatTransposed

public float[][] getEigenvectorsFloatTransposed()
transpose V and turn into floats

Returns:
ROWS of eigenvectors f[0], f[1], f[2], etc.

hypot

private static double hypot(double a,
                            double b)