jass.utils
Class ThomasAlg

java.lang.Object
  extended by jass.utils.ThomasAlg

public class ThomasAlg
extends java.lang.Object

Implement Thomas alg. forthe solution of tridiagonal linear systems.

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Constructor Summary
ThomasAlg()
           
 
Method Summary
static boolean thomas(double[] a, double[] b, double[] c, double[] d, int n)
          Solve tridiagonal system a(i)x(i-1) + b(i)x(i) + c(i)x(i+1) = d(i), i = 0,..,n-1 a(0) = 0 and c(n-1) = 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThomasAlg

public ThomasAlg()
Method Detail

thomas

public static final boolean thomas(double[] a,
                                   double[] b,
                                   double[] c,
                                   double[] d,
                                   int n)
Solve tridiagonal system a(i)x(i-1) + b(i)x(i) + c(i)x(i+1) = d(i), i = 0,..,n-1 a(0) = 0 and c(n-1) = 0. (Note that x(-1) and x(n) are unused.) d holds the solution, b is modified. Return false if there is a problem.