org.ejml.alg.dense.decomposition.bidiagonal
Class BidiagonalDecompositionTall

java.lang.Object
  extended by org.ejml.alg.dense.decomposition.bidiagonal.BidiagonalDecompositionTall
All Implemented Interfaces:
BidiagonalDecomposition<DenseMatrix64F>, DecompositionInterface<DenseMatrix64F>

public class BidiagonalDecompositionTall
extends Object
implements BidiagonalDecomposition<DenseMatrix64F>

BidiagonalDecomposition specifically designed for tall matrices. First step is to perform QR decomposition on the input matrix. Then R is decomposed using a bidiagonal decomposition. By performing the bidiagonal decomposition on the smaller matrix computations can be saved if m/n > 5/3 and if U is NOT needed.

A = [Q1 Q2][U1 0; 0 I] [B1;0] VT
U=[Q1*U1 Q2]
B=[B1;0]
A = U*B*VT

See page 404 in "Fundamentals of Matrix Computations", 2nd by David S. Watkins.

Author:
Peter Abeles

Constructor Summary
BidiagonalDecompositionTall()
           
 
Method Summary
 boolean decompose(DenseMatrix64F orig)
          Computes the decomposition of the input matrix.
 DenseMatrix64F getB(DenseMatrix64F B, boolean compact)
          Returns the bidiagonal matrix.
 void getDiagonal(double[] diag, double[] off)
          Extracts the diagonal and off diagonal elements from the decomposition.
 DenseMatrix64F getU(DenseMatrix64F U, boolean transpose, boolean compact)
          Returns the orthogonal U matrix.
 DenseMatrix64F getV(DenseMatrix64F V, boolean transpose, boolean compact)
          Returns the orthogonal V matrix.
 boolean inputModified()
          Is the input matrix to DecompositionInterface.decompose(org.ejml.data.Matrix64F) is modified during the decomposition process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BidiagonalDecompositionTall

public BidiagonalDecompositionTall()
Method Detail

getDiagonal

public void getDiagonal(double[] diag,
                        double[] off)
Description copied from interface: BidiagonalDecomposition
Extracts the diagonal and off diagonal elements from the decomposition.

Specified by:
getDiagonal in interface BidiagonalDecomposition<DenseMatrix64F>
Parameters:
diag - diagonal elements from B.
off - off diagonal elements form B.

getB

public DenseMatrix64F getB(DenseMatrix64F B,
                           boolean compact)
Description copied from interface: BidiagonalDecomposition
Returns the bidiagonal matrix.

Specified by:
getB in interface BidiagonalDecomposition<DenseMatrix64F>
Parameters:
B - If not null the results are stored here, if null a new matrix is created.
Returns:
The bidiagonal matrix.

getU

public DenseMatrix64F getU(DenseMatrix64F U,
                           boolean transpose,
                           boolean compact)
Description copied from interface: BidiagonalDecomposition
Returns the orthogonal U matrix.

Specified by:
getU in interface BidiagonalDecomposition<DenseMatrix64F>
Parameters:
U - If not null then the results will be stored here. Otherwise a new matrix will be created.
Returns:
The extracted Q matrix.

getV

public DenseMatrix64F getV(DenseMatrix64F V,
                           boolean transpose,
                           boolean compact)
Description copied from interface: BidiagonalDecomposition
Returns the orthogonal V matrix.

Specified by:
getV in interface BidiagonalDecomposition<DenseMatrix64F>
Parameters:
V - If not null then the results will be stored here. Otherwise a new matrix will be created.
Returns:
The extracted Q matrix.

decompose

public boolean decompose(DenseMatrix64F orig)
Description copied from interface: DecompositionInterface
Computes the decomposition of the input matrix. Depending on the implementation the input matrix might be stored internally or modified. If it is modified then the function DecompositionInterface.inputModified() will return true and the matrix should not be modified until the decomposition is no longer needed.

Specified by:
decompose in interface DecompositionInterface<DenseMatrix64F>
Parameters:
orig - The matrix which is being decomposed. Modification is implementation dependent.
Returns:
Returns if it was able to decompose the matrix.

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.


Copyright © 2012. All Rights Reserved.