Package com.irurueta.algebra
Class RQDecomposer
java.lang.Object
com.irurueta.algebra.Decomposer
com.irurueta.algebra.RQDecomposer
This decomposer computes RQ decomposition, which consists on factoring
provided input matrix into an upper triangular matrix (R) and an orthogonal
matrix (Q). In other words, if input matrix is A, then A = R * Q
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final QRDecomposer
Internal QR decomposer used behind the scenes to compute RQ decomposition.Fields inherited from class com.irurueta.algebra.Decomposer
inputMatrix, locked
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor of this class.RQDecomposer
(Matrix inputMatrix) Constructor of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method computes RQ matrix decomposition, which consists on factoring provided input matrix into an upper triangular matrix (R) and an orthogonal matrix (Q).Returns decomposer type corresponding to RQ decomposition.getQ()
Returns the economy-sized orthogonal factor matrix.getR()
Returns upper triangular factor matrix.boolean
Returns boolean indicating whether decomposition has been computed and results can be retrieved.void
setInputMatrix
(Matrix inputMatrix) Sets reference to input matrix to be decomposed.Methods inherited from class com.irurueta.algebra.Decomposer
getInputMatrix, isLocked, isReady
-
Field Details
-
internalDecomposer
Internal QR decomposer used behind the scenes to compute RQ decomposition. Notice that QR and RQ decompositions are related and for that reason QRDecomposer is used
-
-
Constructor Details
-
RQDecomposer
public RQDecomposer()Constructor of this class. -
RQDecomposer
Constructor of this class.- Parameters:
inputMatrix
- Reference to input matrix to be decomposed.
-
-
Method Details
-
getDecomposerType
Returns decomposer type corresponding to RQ decomposition.- Specified by:
getDecomposerType
in classDecomposer
- Returns:
- Decomposer type.
-
setInputMatrix
Sets reference to input matrix to be decomposed.- Overrides:
setInputMatrix
in classDecomposer
- Parameters:
inputMatrix
- Reference to input matrix to be decomposed.- Throws:
LockedException
- Exception thrown if attempting to call this method while this instance remains locked.
-
isDecompositionAvailable
public boolean isDecompositionAvailable()Returns boolean indicating whether decomposition has been computed and results can be retrieved. Attempting to retrieve decomposition results when not available, will probably raise a NotAvailableException.- Specified by:
isDecompositionAvailable
in classDecomposer
- Returns:
- Boolean indicating whether decomposition has been computed and results can be retrieved.
-
decompose
This method computes RQ matrix decomposition, which consists on factoring provided input matrix into an upper triangular matrix (R) and an orthogonal matrix (Q). In other words, if input matrix is A, then: A = R * Q Note: During execution of this method, this instance will be locked, and hence attempting to set some parameters might raise a LockedException. Note: After execution of this method, RQ decomposition will be available and operations such as retrieving R and Q matrices will be able to be done. Attempting to call any of such operations before calling this method wil raise a NotAvailableException because they require computation of QR decomposition first.- Specified by:
decompose
in classDecomposer
- Throws:
NotReadyException
- Exception thrown if attempting to call this method when this instance is not ready (i.e. no input matrix has been provided).LockedException
- Exception thrown if this decomposer is already locked before calling this method. Notice that this method will actually lock this instance while it is being executed.DecomposerException
- Exception thrown if for any reason decomposition fails while being executed, like when provided input matrix has fewer rows than columns.
-
getR
Returns upper triangular factor matrix. RQ decomposition decomposes input matrix into R (upper triangular matrix), and Q, which is an orthogonal matrix.- Returns:
- Upper triangular factor matrix.
- Throws:
NotAvailableException
- Exception thrown if attempting to call this method before computing RQ decomposition. To avoid this exception call decompose() method first.- See Also:
-
getQ
Returns the economy-sized orthogonal factor matrix. RQ decomposition decomposes input matrix into R, which is an upper triangular matrix and Q (orthogonal matrix)- Returns:
- Orthogonal factor matrix.
- Throws:
NotAvailableException
- Exception thrown if attempting to call this method before computing RQ decomposition. To avoid this exception call decompose() method first.- See Also:
-