drasys.or.linear.algebra
Class CroutPivot

java.lang.Object
  |
  +--drasys.or.linear.algebra.CroutPivot

public class CroutPivot
extends java.lang.Object
implements LUDecompositionI, java.io.Serializable

An implementation of LU decomposition using Crout's algorithm with partial pivoting.

References:

Linear Algebra and Its Applications
    Gilbert Strang / Hardcover / Published 1988
Matrix Computations (Johns Hopkins Studies in the Mathematical Sciences)
    Gene H. Golub, Charles F. Van Loan (Contributor) / Paperback / Published 1996
Numerical Recipes in C : The Art of Scientific Computing
    William H. Press, et al / Hardcover / Published 1993
Parallel Algorithms for Matrix Computations
    K.A. Gallivan / Paperback / Published 1990

See Also:
Serialized Form

Constructor Summary
CroutPivot()
           
CroutPivot(MatrixI matrix)
           
 
Method Summary
 double computeDeterminate()
          Computes the determinate of the original matrix from the components.
 DenseMatrix computeInverse()
          Uses backsubstitution on each column to solve for the inverse.
 MatrixI computeInverse(MatrixI results)
          Uses backsubstitution on each column to solve for the inverse.
 void decompose(MatrixI m)
          Decompose a matrix into lower and upper triangular matrices.
 DenseMatrix getL()
          Get the permuted lower triangular matrix.
 MatrixI getL(MatrixI results)
          Get the permuted lower triangular matrix.
 int[] getRowPermutations()
          Returns the row permutations.
 DenseMatrix getU()
          Get the permuted upper triangular matrix.
 MatrixI getU(MatrixI results)
          Get the permuted upper triangular matrix.
 DenseVector solveEquations(VectorI rightHandSides)
          Uses backsubstitution to solve the simultaneous equations.
 VectorI solveEquations(VectorI rightHandSides, VectorI results)
          Uses backsubstitution to solve the simultaneous equations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CroutPivot

public CroutPivot()

CroutPivot

public CroutPivot(MatrixI matrix)
           throws AlgebraException,
                  SingularException
Method Detail

decompose

public void decompose(MatrixI m)
               throws AlgebraException,
                      SingularException
Decompose a matrix into lower and upper triangular matrices.
Specified by:
decompose in interface LUDecompositionI

getL

public DenseMatrix getL()
Get the permuted lower triangular matrix.
Specified by:
getL in interface LUDecompositionI

getL

public MatrixI getL(MatrixI results)
Get the permuted lower triangular matrix.
Specified by:
getL in interface LUDecompositionI

getU

public DenseMatrix getU()
Get the permuted upper triangular matrix.
Specified by:
getU in interface LUDecompositionI

getU

public MatrixI getU(MatrixI results)
Get the permuted upper triangular matrix.
Specified by:
getU in interface LUDecompositionI

getRowPermutations

public int[] getRowPermutations()
Returns the row permutations.
Specified by:
getRowPermutations in interface LUDecompositionI
Tags copied from interface: LUDecompositionI
Returns:
null if the rows were not permuted in the decomposition.

solveEquations

public DenseVector solveEquations(VectorI rightHandSides)
                           throws AlgebraException
Uses backsubstitution to solve the simultaneous equations.
Specified by:
solveEquations in interface LUDecompositionI
Returns:
the solution vector.

solveEquations

public VectorI solveEquations(VectorI rightHandSides,
                              VectorI results)
                       throws AlgebraException
Uses backsubstitution to solve the simultaneous equations.
Specified by:
solveEquations in interface LUDecompositionI
Returns:
the solution vector.

computeInverse

public DenseMatrix computeInverse()
                           throws AlgebraException
Uses backsubstitution on each column to solve for the inverse.
Specified by:
computeInverse in interface LUDecompositionI
Returns:
the inverse matrix.

computeInverse

public MatrixI computeInverse(MatrixI results)
                       throws AlgebraException
Uses backsubstitution on each column to solve for the inverse.
Specified by:
computeInverse in interface LUDecompositionI
Returns:
the inverse matrix.

computeDeterminate

public double computeDeterminate()
                          throws AlgebraException
Computes the determinate of the original matrix from the components.
Specified by:
computeDeterminate in interface LUDecompositionI
Returns:
the inverse matrix.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com