Class BandMatrix

java.lang.Object
  extended byBandMatrix

public class BandMatrix
extends java.lang.Object

BandMatrix - Linear algebra package for band matrices


Field Summary
(package private)  int c
           
(package private)  double[] d
           
(package private)  double det
           
(package private)  int diagos
           
(package private)  boolean isDecomposed
           
(package private)  int l
           
(package private)  int lines
           
(package private)  double[][] m
           
(package private)  int n
           
(package private)  int r
           
 
Constructor Summary
BandMatrix(int diagos, int lines)
          Constructor
 
Method Summary
 double[] dot(double[] v)
          Matrix times vector
 double get(int j, int i)
          Retrieve value of matrix elements
 double getD(int i)
           
 double getL(int i)
           
 double getR(int i)
           
 boolean isEqual(double[] sol, double[] ini, double precision)
          Decide whether two vectors are equal to a certain degree of precision
 void set(int i, int j, double v)
          Store matrix elements
 void setD(int i, double v)
           
 void setL(int i, double v)
           
 void setR(int i, double v)
           
 double[] solve3(double[] rhs)
          Direct LU solver for 3-banded matrix with multiple RHS and BC The matrix is decomposed once only for the first rhs vector Periodic boundary conditions are taken care of by the upper-left lower-right most matrix elements
 double[] ssor3(double[] rhs, double[] ini)
          Projected Symmetric Over Relaxation for 3-banded matrix Periodic boundary conditions are taken care of by the upper-left lower-right most matrix elements
 double[] ssor3(double[] rhs, double[] ini, double[] min, double[] max, double precision, double w, int maxIterations)
          Projected Symmetric Over Relaxation for 3-banded matrix Periodic boundary conditions are taken care of by the upper-left lower-right most matrix elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m

double[][] m

d

double[] d

det

double det

diagos

int diagos

lines

int lines

n

int n

isDecomposed

boolean isDecomposed

l

int l

c

int c

r

int r
Constructor Detail

BandMatrix

public BandMatrix(int diagos,
                  int lines)
Constructor

Method Detail

set

public void set(int i,
                int j,
                double v)
Store matrix elements


setL

public void setL(int i,
                 double v)

setD

public void setD(int i,
                 double v)

setR

public void setR(int i,
                 double v)

get

public double get(int j,
                  int i)
Retrieve value of matrix elements


getL

public double getL(int i)

getD

public double getD(int i)

getR

public double getR(int i)

dot

public double[] dot(double[] v)
Matrix times vector


solve3

public double[] solve3(double[] rhs)
Direct LU solver for 3-banded matrix with multiple RHS and BC The matrix is decomposed once only for the first rhs vector Periodic boundary conditions are taken care of by the upper-left lower-right most matrix elements

Parameters:
rhs - Right hand side vector
Returns:
Solution of the linear system

ssor3

public double[] ssor3(double[] rhs,
                      double[] ini,
                      double[] min,
                      double[] max,
                      double precision,
                      double w,
                      int maxIterations)
Projected Symmetric Over Relaxation for 3-banded matrix Periodic boundary conditions are taken care of by the upper-left lower-right most matrix elements

Parameters:
rhs - Right hand side vector
ini - Initial iterate
min - Lower limit for obstacle problems
max - Upper limit for obstacle problems
precision - Relative precision required
w - Relaxation parameter to be chosen within [0;2]
maxIterations - Maximum number of iterations
Returns:
Solution of the linear system

ssor3

public double[] ssor3(double[] rhs,
                      double[] ini)
Projected Symmetric Over Relaxation for 3-banded matrix Periodic boundary conditions are taken care of by the upper-left lower-right most matrix elements

Parameters:
rhs - Right hand side vector
ini - Initial iterate
Returns:
Solution of the linear system

isEqual

public boolean isEqual(double[] sol,
                       double[] ini,
                       double precision)
Decide whether two vectors are equal to a certain degree of precision

Parameters:
sol - First vector
ini - Second vector
precision - Absolute precision
Returns:
true is both vectors are equal