Class ComplexQR
java.lang.Object
org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition<CMatrix,CNumber[]>
org.flag4j.linalg.decompositions.unitary.ComplexUnitaryDecomposition
org.flag4j.linalg.decompositions.qr.ComplexQR
- All Implemented Interfaces:
Decomposition<CMatrix>
Instances of this class compute the QR
decomposition of a complex dense matrix.
The QR
decomposition, decomposes a matrix A
into a unitary matrix Q
and an upper triangular matrix R
such that A=QR
.
Much of this code has been adapted from the EJML library.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
Flag indicating if the reduced (true) or full (false)QR
decomposition should be computed.Fields inherited from class org.flag4j.linalg.decompositions.unitary.ComplexUnitaryDecomposition
norm, normRe
Fields inherited from class org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition
applyUpdate, householderVector, minAxisSize, numCols, numRows, qFactors, storeReflectors, subDiagonal, transformData, transformMatrix, workArray
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionComputes theQR
decomposition of a real dense matrix.getR()
Gets the upper triangular matrixR
from theQR
decomposition.getUpper()
Gets the upper triangular matrixR
from the last decomposition.protected CMatrix
initQ()
Creates and initializes Q to the appropriately sized identity matrix.Methods inherited from class org.flag4j.linalg.decompositions.unitary.ComplexUnitaryDecomposition
computeHouseholder, computePhasedNorm, findMaxAndInit, getQ, getUpper, initWorkArrays, updateData
Methods inherited from class org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition
decomposeBase, setUp
-
Field Details
-
reduced
protected final boolean reducedFlag indicating if the reduced (true) or full (false)QR
decomposition should be computed.
-
-
Constructor Details
-
ComplexQR
public ComplexQR()Creates aQR
decomposer. This decomposer will compute the reducedQR
decomposition.- See Also:
-
ComplexQR
public ComplexQR(boolean reduced) Creates aQR
decomposer to compute either the full or reducedQR
decomposition.- Parameters:
reduced
- Flag indicating if this decomposer should compute the full or reducedQR
decomposition.
-
-
Method Details
-
decompose
-
initQ
Creates and initializes Q to the appropriately sized identity matrix.- Specified by:
initQ
in classUnitaryDecomposition<CMatrix,
CNumber[]> - Returns:
- An identity matrix with the appropriate size.
-
getUpper
Gets the upper triangular matrixR
from the last decomposition.- Specified by:
getUpper
in classUnitaryDecomposition<CMatrix,
CNumber[]> - Returns:
- The upper triangular matrix
R
from the last decomposition.
-
getR
Gets the upper triangular matrixR
from theQR
decomposition.- Returns:
- The upper triangular matrix
R
from theQR
decomposition.
-