org.ejml.dense.row.decomposition.bidiagonal

## Class BidiagonalDecompositionTall_DDRM

• java.lang.Object
• org.ejml.dense.row.decomposition.bidiagonal.BidiagonalDecompositionTall_DDRM
• All Implemented Interfaces:
BidiagonalDecomposition<DMatrixRMaj>, BidiagonalDecomposition_F64<DMatrixRMaj>, DecompositionInterface<DMatrixRMaj>

```public class BidiagonalDecompositionTall_DDRM
extends java.lang.Object
implements BidiagonalDecomposition_F64<DMatrixRMaj>```

`BidiagonalDecomposition_F64` 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

A QRP decomposition is used internally. That decomposition relies an a fixed threshold for selecting singular values and is known to be less stable than SVD. There is the potential for a degregation of stability by using BidiagonalDecompositionTall instead of BidiagonalDecomposition_F64. A few simple tests have shown that loss in stability to be insignificant.

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

• ### Constructor Summary

Constructors
Constructor and Description
`BidiagonalDecompositionTall_DDRM()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`boolean` `decompose(DMatrixRMaj orig)`
Computes the decomposition of the input matrix.
`DMatrixRMaj` ```getB(DMatrixRMaj B, boolean compact)```
Returns the bidiagonal matrix.
`void` ```getDiagonal(double[] diag, double[] off)```
Extracts the diagonal and off diagonal elements from the decomposition.
`DMatrixRMaj` ```getU(DMatrixRMaj U, boolean transpose, boolean compact)```
Returns the orthogonal U matrix.
`DMatrixRMaj` ```getV(DMatrixRMaj V, boolean transpose, boolean compact)```
Returns the orthogonal V matrix.
`boolean` `inputModified()`
Is the input matrix to `DecompositionInterface.decompose(org.ejml.data.Matrix)` 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_DDRM

`public BidiagonalDecompositionTall_DDRM()`
• ### Method Detail

• #### getDiagonal

```public void getDiagonal(double[] diag,
double[] off)```
Description copied from interface: `BidiagonalDecomposition_F64`
Extracts the diagonal and off diagonal elements from the decomposition.
Specified by:
`getDiagonal` in interface `BidiagonalDecomposition_F64<DMatrixRMaj>`
Parameters:
`diag` - diagonal elements from B.
`off` - off diagonal elements form B.
• #### getB

```public DMatrixRMaj getB(DMatrixRMaj B,
boolean compact)```
Description copied from interface: `BidiagonalDecomposition`
Returns the bidiagonal matrix.
Specified by:
`getB` in interface `BidiagonalDecomposition<DMatrixRMaj>`
Parameters:
`B` - If not null the results are stored here, if null a new matrix is created.
Returns:
The bidiagonal matrix.
• #### getU

```public DMatrixRMaj getU(DMatrixRMaj U,
boolean transpose,
boolean compact)```
Description copied from interface: `BidiagonalDecomposition`
Returns the orthogonal U matrix.
Specified by:
`getU` in interface `BidiagonalDecomposition<DMatrixRMaj>`
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 DMatrixRMaj getV(DMatrixRMaj V,
boolean transpose,
boolean compact)```
Description copied from interface: `BidiagonalDecomposition`
Returns the orthogonal V matrix.
Specified by:
`getV` in interface `BidiagonalDecomposition<DMatrixRMaj>`
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(DMatrixRMaj 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<DMatrixRMaj>`
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.Matrix)` is modified during the decomposition process.
Specified by:
`inputModified` in interface `DecompositionInterface<DMatrixRMaj>`
Returns:
true if the input matrix to decompose() is modified.

Copyright © 2009-2018 Peter Abeles