fhm.edu.fem.calc.objects.algorithm
Class Rayleigh

java.lang.Object
  extended by fhm.edu.fem.calc.objects.algorithm.Rayleigh

public class Rayleigh
extends java.lang.Object

Class Description: This class offers methods to calculate Eigenvalues and Eigenvectors via the Rayleigh Algorithm. The algorithms used in this class are Copyright by Ewe Leonties taken from the C-Classes he wrote as diploma thesis. The conversion to Java and the percentage displays have been done by the authors mentioned below.

Author:
Thomas Woellert (thomas@woellert.net), Stefan Weissbach (weissbst@gmx.de)

Field Summary
protected  Vector eigenvalueVector
           
protected  double[][] EV
           
protected static Logger localLogger
           
 
Constructor Summary
Rayleigh()
          Constructor
 
Method Summary
protected  void abpz(int n, double[] A, double[] B, int[] D, double[] P, double[] Z2, double[] Z1)
          Calculates the products A*p = z2 and B*p = z1 (by Ewe Leonties)
protected  int cholesky(int n, double[] A, int[] D)
          Calculate the Cholesky (by Ewe Leonties) A is changed in the progress containing the result
 boolean compute(int n, double[] A, double[] B, int[] D, int neig, double tol, double d)
          Calculates the Eigenvalues and Eigenvectors via the preconditioned Rayleigh-Quotient-Minimization via konjugented Gradients of the general EWA A * x = lambda * B * x Only works with HULL MATRICES !
 Vector getEigenvalueVector()
          Grab the vector holding the calculated eigenvalues (you need to call compute()) first
 double[][] getEigenvectorArray()
          Grab the double array holding the calculated eigenvectors (you need to call compute()) first
protected  double randomx(int ini)
          Generated pseudo random numbers (0 <= x <= 1) (by Ewe Leonties)
protected  void vrenv(int n, double[] L, int[] D, double[] B, double[] X)
          Calculate L*LT*x=b via "Vorwaerts- und Rueckwaertseinsetzen" (by Ewe Leonties)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eigenvalueVector

protected Vector eigenvalueVector

EV

protected double[][] EV

localLogger

protected static Logger localLogger
Constructor Detail

Rayleigh

public Rayleigh()
Constructor

Method Detail

abpz

protected void abpz(int n,
                    double[] A,
                    double[] B,
                    int[] D,
                    double[] P,
                    double[] Z2,
                    double[] Z1)
Calculates the products A*p = z2 and B*p = z1 (by Ewe Leonties)

Parameters:
n, - size of matrix A and B
A, - Matrix A in HullMatrix style
B, - Matrix B in HullMatrix style
D, - the diagonal pointer vector
P, - Constantsvector
Z2, - RETURN VALUE
Z1, - RETURN VALUE

cholesky

protected int cholesky(int n,
                       double[] A,
                       int[] D)
Calculate the Cholesky (by Ewe Leonties) A is changed in the progress containing the result

Parameters:
n, - size of Matrix A
A, - Matrix A in HullMatrix style
D, - diagonal pointer vector
Returns:
int, 0 = ERROR, 1 = SUCCESS

compute

public boolean compute(int n,
                       double[] A,
                       double[] B,
                       int[] D,
                       int neig,
                       double tol,
                       double d)
Calculates the Eigenvalues and Eigenvectors via the preconditioned Rayleigh-Quotient-Minimization via konjugented Gradients of the general EWA A * x = lambda * B * x Only works with HULL MATRICES ! After completing this calculation you can also grab all calculated Eigenvalues via the associated Getter-Method in this class

Parameters:
n, - size of the Matrix A and B as Hull
A, - the Matrix A in the Hull Matrix format
B, - the Matrix B in the Hull Matrix format
D, - the diagonal pointer vector (both A and B have the same)
neig, - the number of eigenvalues and eigenvectors to calculate
tol, - the calculation precision
d, - the "Spektralverschiebung"
Returns:
bool, true if all went well, false otherwise

getEigenvalueVector

public Vector getEigenvalueVector()
Grab the vector holding the calculated eigenvalues (you need to call compute()) first

Returns:
Vector, the vector holding all eigenvalues

getEigenvectorArray

public double[][] getEigenvectorArray()
Grab the double array holding the calculated eigenvectors (you need to call compute()) first

Returns:
double[][], the array holding all eigenvectors

randomx

protected double randomx(int ini)
Generated pseudo random numbers (0 <= x <= 1) (by Ewe Leonties)

Parameters:
ini, - initialisation value
Returns:
double, a random number

vrenv

protected void vrenv(int n,
                     double[] L,
                     int[] D,
                     double[] B,
                     double[] X)
Calculate L*LT*x=b via "Vorwaerts- und Rueckwaertseinsetzen" (by Ewe Leonties)

Parameters:
n, - size of Matrix L
L, - Matrix L in HullMatrix style
D, - the diagonal pointer vector
B, - Constantsvector
X, - RETURN VALUE