org.ejml.alg.dense.decompose.qr
Class QRDecompositionHouseholderTran_CD64
- java.lang.Object
-
- org.ejml.alg.dense.decompose.qr.QRDecompositionHouseholderTran_CD64
-
- All Implemented Interfaces:
- DecompositionInterface<CDenseMatrix64F>, QRDecomposition<CDenseMatrix64F>
public class QRDecompositionHouseholderTran_CD64 extends java.lang.Object implements QRDecomposition<CDenseMatrix64F>
Householder QR decomposition is rich in operations along the columns of the matrix. This can be taken advantage of by solving for the Q matrix in a column major format to reduce the number of CPU cache misses and the number of copies that are performed.
- See Also:
QRDecompositionHouseholder_D64
-
-
Constructor Summary
Constructors Constructor and Description QRDecompositionHouseholderTran_CD64()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyQ(CDenseMatrix64F A)A = Q*AvoidapplyTranQ(CDenseMatrix64F A)A = QH*Abooleandecompose(CDenseMatrix64F A)To decompose the matrix 'A' it must have full rank.double[]getGammas()CDenseMatrix64FgetQ(CDenseMatrix64F Q, boolean compact)Computes the Q matrix from the information stored in the QR matrix.CDenseMatrix64FgetQR()Inner matrix that stores the decompositionCDenseMatrix64FgetR(CDenseMatrix64F R, boolean compact)Returns an upper triangular matrix which is the R in the QR decomposition.booleaninputModified()Is the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.voidsetExpectedMaxSize(int numRows, int numCols)
-
-
-
Method Detail
-
setExpectedMaxSize
public void setExpectedMaxSize(int numRows, int numCols)
-
getQR
public CDenseMatrix64F getQR()
Inner matrix that stores the decomposition
-
getQ
public CDenseMatrix64F getQ(CDenseMatrix64F Q, boolean compact)
Computes the Q matrix from the information stored in the QR matrix. This operation requires about 4(mn-mn2+n3/3) flops. - Specified by:
getQin interfaceQRDecomposition<CDenseMatrix64F>- Parameters:
Q- The orthogonal Q matrix.compact- If true an m by n matrix is created, otherwise n by n.- Returns:
- The Q matrix.
-
applyQ
public void applyQ(CDenseMatrix64F A)
A = Q*A- Parameters:
A- Matrix that is being multiplied by Q. Is modified.
-
applyTranQ
public void applyTranQ(CDenseMatrix64F A)
A = QH*A- Parameters:
A- Matrix that is being multiplied by QT. Is modified.
-
getR
public CDenseMatrix64F getR(CDenseMatrix64F R, boolean compact)
Returns an upper triangular matrix which is the R in the QR decomposition.- Specified by:
getRin interfaceQRDecomposition<CDenseMatrix64F>- Parameters:
R- An upper triangular matrix.compact-- Returns:
- The R matrix.
-
decompose
public boolean decompose(CDenseMatrix64F A)
To decompose the matrix 'A' it must have full rank. 'A' is a 'm' by 'n' matrix. It requires about 2n*m2-2m2/3 flops.
The matrix provided here can be of different dimension than the one specified in the constructor. It just has to be smaller than or equal to it.
- Specified by:
decomposein interfaceDecompositionInterface<CDenseMatrix64F>- Parameters:
A- 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:DecompositionInterfaceIs the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.- Specified by:
inputModifiedin interfaceDecompositionInterface<CDenseMatrix64F>- Returns:
- true if the input matrix to decompose() is modified.
-
getGammas
public double[] getGammas()
-
-
DMelt 3.0 © DataMelt by jWork.ORG