fhm.edu.fem.calc.objects.matrix
Class SVI2

java.lang.Object
  extended by fhm.edu.fem.calc.objects.matrix.SVI2

public class SVI2
extends java.lang.Object

Class Description: This class offers methods to calculate Eigenvalues and Eigenvectors via the SVI2 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
SVI2()
          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, int p, int[] D, double[] LA, double[] LB, double eps, int maxit)
          Simultane vector-iteration to solve the general EWA A * x = lam * B * x
 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 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 mvrenv(int n, int p, double[] L, int[] D, double[][] B, double[][] X)
          Solves the matrix calculation L * LT * X = B via "Vorwaerts- und Rueckwaertseinsetzen"
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
 
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

SVI2

public SVI2()
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,
                       int p,
                       int[] D,
                       double[] LA,
                       double[] LB,
                       double eps,
                       int maxit)
Simultane vector-iteration to solve the general EWA A * x = lam * B * x

Parameters:
n, - size of matrix A and B
p, - number of wanted eigenvalues and eigenvectors
D, - diagonal pointer vector
LA, - matrix A in HullMatrix style
LB, - matrix B in hullMatrix style
eps, - calculation precision
maxit, - maximum number of iterations
Returns:
boolean, 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

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

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

mvrenv

protected void mvrenv(int n,
                      int p,
                      double[] L,
                      int[] D,
                      double[][] B,
                      double[][] X)
Solves the matrix calculation L * LT * X = B via "Vorwaerts- und Rueckwaertseinsetzen"

Parameters:
n, - dimension of X
p, - dimension of X
L, - left-triangle-matrix in HullMatrix style
D, - diagonal pointer vector
B, - right side matrix
X, - 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