DESY ACOP Beans Home

de.desy.acop.video.analysis
Class LUDecomposition

java.lang.Object
  extended by de.desy.acop.video.analysis.LUDecomposition

public class LUDecomposition
extends java.lang.Object

LUDecomposition provides a method to solve a n-by-n system of linear equations. It makes a LU decomposition of the matrix (lower triangle L and upper triangle U) and provides a solution to an arbitrary system A*x=b, where b is given by the user and x is returned. The implementation supports pivotting.

Author:
Jaka Bobnar

Constructor Summary
LUDecomposition(double[][] A)
          Creates a new LUDecomposition object.
 
Method Summary
 boolean isSingular()
          Returns true if the given matrix is singular or false if not.
 double[] solve(double[] b)
          Solves A*x = b
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LUDecomposition

public LUDecomposition(double[][] A)
                throws MathException
Creates a new LUDecomposition object.

Parameters:
A - the matrix to be decomposed
Throws:
MathException - if the matrix is singular
Method Detail

isSingular

public boolean isSingular()
Returns true if the given matrix is singular or false if not.

Returns:
true if matrix is singular

solve

public double[] solve(double[] b)
               throws MathException
Solves A*x = b

Parameters:
b - vector of the dimension of this LU
Returns:
x so that L*U*x = b
Throws:
MathException - if the dimensions are not equal


Copyright © 2010. All Rights Reserved.