Class BidiagonalDecompositionRow_DDRM
java.lang.Object
org.ejml.dense.row.decomposition.bidiagonal.BidiagonalDecompositionRow_DDRM
- All Implemented Interfaces:
BidiagonalDecomposition<DMatrixRMaj>
,BidiagonalDecomposition_F64<DMatrixRMaj>
,DecompositionInterface<DMatrixRMaj>
- Direct Known Subclasses:
BidiagonalDecompositionRow_MT_DDRM
public class BidiagonalDecompositionRow_DDRM
extends Object
implements BidiagonalDecomposition_F64<DMatrixRMaj>
Performs a BidiagonalDecomposition_F64
using
householder reflectors. This is efficient on wide or square matrices.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBidiagonalDecompositionRow_DDRM
(int numElements) Creates a decompose that defines the specified amount of memory. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
computeU
(int k) protected void
computeV
(int k) boolean
Computes the decomposition of the provided matrix.getB
(@Nullable DMatrixRMaj B, boolean compact) Returns the bidiagonal matrix.void
getDiagonal
(double[] diag, double[] off) Extracts the diagonal and off diagonal elements from the decomposition.double[]
Returns gammas from the householder operations for the U matrix.double[]
Returns gammas from the householder operations for the V matrix.getU
(@Nullable DMatrixRMaj U, boolean transpose, boolean compact) Returns the orthogonal U matrix.getUBV()
The raw UBV matrix that is stored internally.getV
(@Nullable DMatrixRMaj V, boolean transpose, boolean compact) Returns the orthogonal V matrix.static DMatrixRMaj
handleB
(@Nullable DMatrixRMaj B, boolean compact, int m, int n, int min) static DMatrixRMaj
handleU
(@Nullable DMatrixRMaj U, boolean transpose, boolean compact, int m, int n, int min) static DMatrixRMaj
handleV
(@Nullable DMatrixRMaj V, boolean transpose, boolean compact, int m, int n, int min) protected void
init
(DMatrixRMaj A) Sets up internal data structures and creates a copy of the input matrix.boolean
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.protected void
rank1UpdateMultL
(DMatrixRMaj A, double gamma, int colA0, int w0, int w1) protected void
rank1UpdateMultR
(DMatrixRMaj A, double gamma, int colA0, int w0, int w1)
-
Field Details
-
b
protected double[] b -
u
protected double[] u
-
-
Constructor Details
-
BidiagonalDecompositionRow_DDRM
public BidiagonalDecompositionRow_DDRM(int numElements) Creates a decompose that defines the specified amount of memory.- Parameters:
numElements
- number of elements in the matrix.
-
BidiagonalDecompositionRow_DDRM
public BidiagonalDecompositionRow_DDRM()
-
-
Method Details
-
decompose
Computes the decomposition of the provided matrix. If no errors are detected then true is returned, false otherwise.- Specified by:
decompose
in interfaceDecompositionInterface<DMatrixRMaj>
- Parameters:
A
- The matrix that is being decomposed. Not modified.- Returns:
- If it detects any errors or not.
-
init
Sets up internal data structures and creates a copy of the input matrix.- Parameters:
A
- The input matrix. Not modified.
-
getUBV
The raw UBV matrix that is stored internally.- Returns:
- UBV matrix.
-
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 interfaceBidiagonalDecomposition_F64<DMatrixRMaj>
- Parameters:
diag
- diagonal elements from B.off
- off diagonal elements form B.
-
getB
Returns the bidiagonal matrix.- Specified by:
getB
in interfaceBidiagonalDecomposition<DMatrixRMaj>
- Parameters:
B
- If not null the results are stored here, if null a new matrix is created.- Returns:
- The bidiagonal matrix.
-
handleB
public static DMatrixRMaj handleB(@Nullable @Nullable DMatrixRMaj B, boolean compact, int m, int n, int min) -
getU
Returns the orthogonal U matrix.- Specified by:
getU
in interfaceBidiagonalDecomposition<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.
-
handleU
public static DMatrixRMaj handleU(@Nullable @Nullable DMatrixRMaj U, boolean transpose, boolean compact, int m, int n, int min) -
getV
Returns the orthogonal V matrix.- Specified by:
getV
in interfaceBidiagonalDecomposition<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.
-
handleV
public static DMatrixRMaj handleV(@Nullable @Nullable DMatrixRMaj V, boolean transpose, boolean compact, int m, int n, int min) -
computeU
protected void computeU(int k) -
rank1UpdateMultL
-
rank1UpdateMultR
-
computeV
protected void computeV(int k) -
getGammasU
public double[] getGammasU()Returns gammas from the householder operations for the U matrix. -
getGammasV
public double[] getGammasV()Returns gammas from the householder operations for the V matrix. -
inputModified
public boolean inputModified()Description copied from interface:DecompositionInterface
Checks if the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)
is modified during the decomposition process.- Specified by:
inputModified
in interfaceDecompositionInterface<DMatrixRMaj>
- Returns:
- true if the input matrix to decompose() is modified.
-