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

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

public class SVI3
extends java.lang.Object

Class Description: This class offers methods to calculate Eigenvalues and Eigenvectors via the SVI3 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 static Logger localLogger
           
protected  double[][] X
           
 
Constructor Summary
SVI3()
          Constructor
 
Method Summary
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 p, int pt, int nitm, double eps)
          Simultamne vector-iteration with Rayleigh-Ritz-Step
protected  void ewev(int n, int pt, double[] B, double[] A, int[] D, double[] H1, double[] LAM, double[][] X, double[][] Y)
          Solves LBT * H = X via "Rueckwaertseinsetzen" Calculation of p-Eigenvectors and Eigenvalues as rayleigh's Quotients
 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  void initx(int p, int n, double[][] X)
          Init the Matrix X with random numbers 0 <= xij <= 1
protected  void jacobi(int n, double gen, double[][] A, double[][] V, int ord)
          Calculates the Eigenvalues and Eigenvectors of the symmetric Matrix A
protected  void mlenv(int n, int p, double[] L, int[] D, double[][] X, double[][] Y)
          Multiplies the left-triangle-matrix L with matrix X
protected  void mltenv(int n, int p, double[] L, int[] D, double[][] X, double[][] Y)
          Multiplies the left-triangle-matrix LT with Matrix X
protected  void ortnor(int n, int p, double[][] Z, double[] Q)
          Orthonormizes the Matrix Z
protected  void renv(int n, int p, int[] D, double[] L, double[][] X)
          Solves LT * H = X
protected  void storeEigenvalues(double[] LAM)
          Special method to help store the eigenvalues after they have been calculated
protected  void vrenv(int n, double[] L, int[] D, double[] B, double[] X)
          Solves L * LT * x = b via "Vorwaerts- und Rueckwaertseinsetzen"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eigenvalueVector

protected Vector eigenvalueVector

localLogger

protected static Logger localLogger

X

protected double[][] X
Constructor Detail

SVI3

public SVI3()
Constructor

Method Detail

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 p,
                       int pt,
                       int nitm,
                       double eps)
Simultamne vector-iteration with Rayleigh-Ritz-Step

Parameters:
n, - dimension of matrix A and B
A, - matrix A in HullMatrix style
B, - matrix B in HullMatrix style
D, - diagonal pointer vector
p, - number of wanted eigen-pairs
pt, - number of simultane iterated eigen-pairs
nitm, - maximum number of iterations
eps, - calculation precision
Returns:
boolean, true if all went well, false otherwise

ewev

protected void ewev(int n,
                    int pt,
                    double[] B,
                    double[] A,
                    int[] D,
                    double[] H1,
                    double[] LAM,
                    double[][] X,
                    double[][] Y)
Solves LBT * H = X via "Rueckwaertseinsetzen" Calculation of p-Eigenvectors and Eigenvalues as rayleigh's Quotients

Parameters:
n, - dimension of matrix X and Y
pt, - dimension of matrix X and Y
B, - left-triangle-matrix B in HullMatrix style
A, - left-triangle-matrix A in HullMatrix style
D, - diagonal pointer vector
H1, - helper-vector
LAM, - RETURN VALUE, Vector of p-Eigenvalues
X, - RETURN VALUE, Matrix of p-Eigenvectors
Y, - helper-matrix

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

initx

protected void initx(int p,
                     int n,
                     double[][] X)
Init the Matrix X with random numbers 0 <= xij <= 1

Parameters:
p, - the dimension of X
n, - the dimension of X
X, - RETURN VALUE, linear independent start vectors

jacobi

protected void jacobi(int n,
                      double gen,
                      double[][] A,
                      double[][] V,
                      int ord)
Calculates the Eigenvalues and Eigenvectors of the symmetric Matrix A

Parameters:
n, - size of Matrix A
gen, - machine precision
A, - double[][] array of Matrix A
V, - RETURN VALUE, matrix of eigenvectors
ord, - if >0 the eigenvalues and associated eigenvectors are sorted from upwards, else downwards

mlenv

protected void mlenv(int n,
                     int p,
                     double[] L,
                     int[] D,
                     double[][] X,
                     double[][] Y)
Multiplies the left-triangle-matrix L with matrix X

Parameters:
n, - dimension of matrix x
p, - dimension of matrix x
L, - left-triangle-matrix in HullMatrix style
D, - diagonal pointer vector
X, - matrix X
Y, - RETURN VALUE

mltenv

protected void mltenv(int n,
                      int p,
                      double[] L,
                      int[] D,
                      double[][] X,
                      double[][] Y)
Multiplies the left-triangle-matrix LT with Matrix X

Parameters:
n, - dimension of X
p, - dimension of X
L, - left-triangle-matrix in HullMatrix style
D, - diagonal pointer vector
X, - matrix X
Y, - RETURN VALUE

ortnor

protected void ortnor(int n,
                      int p,
                      double[][] Z,
                      double[] Q)
Orthonormizes the Matrix Z

Parameters:
n, - dimension of Z
p, - dimension of Z
Z, - matrix Z with p linear independent vectors, RETURN VALUE
Q -

renv

protected void renv(int n,
                    int p,
                    int[] D,
                    double[] L,
                    double[][] X)
Solves LT * H = X

Parameters:
n, - dimension of matrix X
p, - dimension of matrix X
D, - diagonal pointer vector
L, - left-triangle-matrix in HullMatrix style
X, - RETURN VALUE, result matrix H replaces X

storeEigenvalues

protected void storeEigenvalues(double[] LAM)
Special method to help store the eigenvalues after they have been calculated

Parameters:
LAM, - the vector holding all calculated eigenvalues

vrenv

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

Parameters:
n, - dimension of L
L, - matrix L in HullMatrix style
D, - diagonal pointer vector
B, - constants-vector
X, - RETURN VALUE