Class ComplexQR
java.lang.Object
org.flag4j.linalg.decompositions.Decomposition<CMatrix>
org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition<CMatrix,Complex128[]>
org.flag4j.linalg.decompositions.unitary.ComplexUnitaryDecomposition
org.flag4j.linalg.decompositions.qr.ComplexQR
Computes the QR decomposition of dense complex matrix.
The QR decomposition factorizes a given matrix \( A \) into the product of an orthogonal matrix \( Q \) and an upper triangular matrix \( R \), such that: \[ A = QR \]
The decomposition can be computed in either the full or reduced form:
- Reduced QR decomposition: When
reduced = true, the decomposition produces a compact form where \( Q \) has the same number of rows as \( A \) but only as many columns as the rank of \( A \). - Full QR decomposition: When
reduced = false, the decomposition produces a square orthogonal matrix \( Q \) with the same number of rows as \( A \).
Usage:
The decomposition workflow typically follows these steps:- Instantiate an instance of
ComplexQR. - Call
decompose(CMatrix)to perform the factorization. - Retrieve the resulting matrices using
ComplexUnitaryDecomposition.getQ()andgetR().
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanFlag indicating if the reduced or full decomposition should be computed.Fields inherited from class org.flag4j.linalg.decompositions.unitary.ComplexUnitaryDecomposition
currentFactor, norm, normReFields inherited from class org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition
applyUpdate, householderVector, iHigh, iLow, inPlace, minAxisSize, numCols, numRows, qFactors, storeReflectors, subDiagonal, transformData, transformMatrix, workArrayFields inherited from class org.flag4j.linalg.decompositions.Decomposition
hasDecomposed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionComputes theQRdecomposition of a real dense matrix.getR()Gets the upper triangular matrix, \( R \), from the QR decomposition.getUpper()Gets the upper triangular matrix, \( R \), from the last decomposition.protected CMatrixinitQ()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, updateDataMethods inherited from class org.flag4j.linalg.decompositions.unitary.UnitaryDecomposition
decompose, setUpMethods inherited from class org.flag4j.linalg.decompositions.Decomposition
ensureHasDecomposed
-
Field Details
-
reduced
protected final boolean reducedFlag indicating if the reduced or full decomposition should be computed.- If
true: the reduced decomposition will be computed. - If
false: the full decomposition will be computed.
- If
-
-
Constructor Details
-
ComplexQR
public ComplexQR()Creates aQRdecomposer. This decomposer will compute the reducedQRdecomposition.- See Also:
-
ComplexQR
public ComplexQR(boolean reduced) Creates aQRdecomposer to compute either the full or reducedQRdecomposition.- Parameters:
reduced- Flag indicating if this decomposer should compute the full or reducedQRdecomposition.
-
-
Method Details
-
decompose
Computes theQRdecomposition of a real dense matrix.- Overrides:
decomposein classUnitaryDecomposition<CMatrix,Complex128[]> - Parameters:
src- The source matrix to decompose.- Returns:
- A reference to this decomposer.
-
initQ
Creates and initializes \( Q \) to the appropriately sized identity matrix.- Specified by:
initQin classUnitaryDecomposition<CMatrix,Complex128[]> - Returns:
- An identity matrix with the appropriate size.
-
getUpper
Gets the upper triangular matrix, \( R \), from the last decomposition.- Specified by:
getUpperin classUnitaryDecomposition<CMatrix,Complex128[]> - Returns:
- The upper triangular matrix, \( R \), from the last decomposition.
-
getR
Gets the upper triangular matrix, \( R \), from the QR decomposition.- Returns:
- The upper triangular matrix, \( R \), from the QR decomposition.
-