org.ejml.alg.dense.decomposition.lu
Class LUDecompositionBase

java.lang.Object
  extended by org.ejml.alg.dense.decomposition.lu.LUDecompositionBase
All Implemented Interfaces:
DecompositionInterface<DenseMatrix64F>, LUDecomposition<DenseMatrix64F>
Direct Known Subclasses:
LUDecompositionAlt, LUDecompositionNR

public abstract class LUDecompositionBase
extends Object
implements LUDecomposition<DenseMatrix64F>

Contains common data structures and operations for LU decomposition algorithms.

Author:
Peter Abeles

Field Summary
protected  double[] dataLU
           
protected  int[] indx
           
protected  DenseMatrix64F LU
           
protected  int m
           
protected  int maxWidth
           
protected  int n
           
protected  int[] pivot
           
protected  double pivsign
           
protected  double[] vv
           
 
Constructor Summary
LUDecompositionBase()
           
 
Method Summary
 double[] _getVV()
           
 void _solveVectorInternal(double[] vv)
          a specialized version of solve that avoid additional checks that are not needed.
 double computeDeterminant()
          Computes the determinant from the LU decomposition.
protected  void decomposeCommonInit(DenseMatrix64F a)
           
 int[] getIndx()
           
 DenseMatrix64F getLower(DenseMatrix64F lower)
          Writes the lower triangular matrix into the specified matrix.
 DenseMatrix64F getLU()
           
 int[] getPivot()
           
 DenseMatrix64F getPivot(DenseMatrix64F pivot)
           For numerical stability there are often row interchanges.
 DenseMatrix64F getUpper(DenseMatrix64F upper)
          Writes the upper triangular matrix into the specified matrix.
 boolean inputModified()
          Is the input matrix to DecompositionInterface.decompose(org.ejml.data.Matrix64F) is modified during the decomposition process.
 boolean isSingular()
          Determines if the decomposed matrix is singular.
 double quality()
           
 void setExpectedMaxSize(int numRows, int numCols)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ejml.alg.dense.decomposition.DecompositionInterface
decompose
 

Field Detail

LU

protected DenseMatrix64F LU

maxWidth

protected int maxWidth

m

protected int m

n

protected int n

dataLU

protected double[] dataLU

vv

protected double[] vv

indx

protected int[] indx

pivot

protected int[] pivot

pivsign

protected double pivsign
Constructor Detail

LUDecompositionBase

public LUDecompositionBase()
Method Detail

setExpectedMaxSize

public void setExpectedMaxSize(int numRows,
                               int numCols)

getLU

public DenseMatrix64F getLU()

getIndx

public int[] getIndx()

getPivot

public int[] getPivot()

inputModified

public boolean inputModified()
Description copied from interface: DecompositionInterface
Is the input matrix to DecompositionInterface.decompose(org.ejml.data.Matrix64F) is modified during the decomposition process.

Specified by:
inputModified in interface DecompositionInterface<DenseMatrix64F>
Returns:
true if the input matrix to decompose() is modified.

getLower

public DenseMatrix64F getLower(DenseMatrix64F lower)
Writes the lower triangular matrix into the specified matrix.

Specified by:
getLower in interface LUDecomposition<DenseMatrix64F>
Parameters:
lower - Where the lower triangular matrix is writen to.
Returns:
The L matrix.

getUpper

public DenseMatrix64F getUpper(DenseMatrix64F upper)
Writes the upper triangular matrix into the specified matrix.

Specified by:
getUpper in interface LUDecomposition<DenseMatrix64F>
Parameters:
upper - Where the upper triangular matrix is writen to.
Returns:
The U matrix.

getPivot

public DenseMatrix64F getPivot(DenseMatrix64F pivot)
Description copied from interface: LUDecomposition

For numerical stability there are often row interchanges. This computes a pivot matrix that will undo those changes.

Specified by:
getPivot in interface LUDecomposition<DenseMatrix64F>

decomposeCommonInit

protected void decomposeCommonInit(DenseMatrix64F a)

isSingular

public boolean isSingular()
Determines if the decomposed matrix is singular. This function can return false and the matrix be almost singular, which is still bad.

Specified by:
isSingular in interface LUDecomposition<DenseMatrix64F>
Returns:
true if singular false otherwise.

computeDeterminant

public double computeDeterminant()
Computes the determinant from the LU decomposition.

Specified by:
computeDeterminant in interface LUDecomposition<DenseMatrix64F>
Returns:
The matrix's determinant.

quality

public double quality()

_solveVectorInternal

public void _solveVectorInternal(double[] vv)
a specialized version of solve that avoid additional checks that are not needed.


_getVV

public double[] _getVV()


Copyright © 2012. All Rights Reserved.