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

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

public class SVI1
extends java.lang.Object

Class Description: This class offers methods to calculate Eigenvalues and Eigenvectors via the SVI1 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
SVI1()
          Constructor
 
Method Summary
protected  void asch(int p, int n, double[][] Z, double[][] Y, double[][] AS)
          Multiplies the matrices ZT * Y = AS
protected  void bxvb(int p, int n, double[] B, int[] D, double[][] X, double[][] VB)
          Multiplies the matrices X * B = VB
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[] LA, double[] B, int[] D, int p1, int p2, double tol, int maxit)
          Simultane vector-iteration to solve 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 jacobi(int n, double gen, double[][] A, double[][] V, int ord)
          Calculates the Eigenvalues and Eigenvectors of the symmetric Matrix A
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 zgkdkz(int p, int n, double[][] Z, double[][] G, double[][] D, double[][] H)
          Multiplies the matrices Z * G * D = 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

SVI1

public SVI1()
Constructor

Method Detail

asch

protected void asch(int p,
                    int n,
                    double[][] Z,
                    double[][] Y,
                    double[][] AS)
Multiplies the matrices ZT * Y = AS

Parameters:
p, - dimension of Y
n, - dimension of Y
Z, - the matrix Z
Y, - the matrix Y
AS, - RETURN VALUE

bxvb

protected void bxvb(int p,
                    int n,
                    double[] B,
                    int[] D,
                    double[][] X,
                    double[][] VB)
Multiplies the matrices X * B = VB

Parameters:
p, - dimension of X
n, - dimension of X
B, - matrix B in HullMatrix style
D, - diagonal pointer vector
X, - Iteration-Vector-Matrix
VB, - RETURN VALUE, Product-Matrix

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[] LA,
                       double[] B,
                       int[] D,
                       int p1,
                       int p2,
                       double tol,
                       int maxit)
Simultane vector-iteration to solve A*x=lam*B*x

Parameters:
n, - dimension of matrix
LA, - Matrix A in HullMatrix style
B, - Matrix B in HullMatrix style
D, - diagonal pointer vector
p1, - needed amount of eigenvectors
p2, - simultane iterated eigenvectors
tol, - calculation precision
maxit, - maximum number of steps
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

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

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

zgkdkz

protected void zgkdkz(int p,
                      int n,
                      double[][] Z,
                      double[][] G,
                      double[][] D,
                      double[][] H)
Multiplies the matrices Z * G * D = X

Parameters:
p, - dimension of Z
n, - dimension of Z
Z, - nxp
G, - pxp
D, - diagonalmatrix pxp
H, - RETURN VALUE