Class RQDecomposer

java.lang.Object
com.irurueta.algebra.Decomposer
com.irurueta.algebra.RQDecomposer

public class RQDecomposer extends Decomposer
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 Details

    • internalDecomposer

      private final QRDecomposer 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

      public RQDecomposer(Matrix inputMatrix)
      Constructor of this class.
      Parameters:
      inputMatrix - Reference to input matrix to be decomposed.
  • Method Details

    • getDecomposerType

      public DecomposerType getDecomposerType()
      Returns decomposer type corresponding to RQ decomposition.
      Specified by:
      getDecomposerType in class Decomposer
      Returns:
      Decomposer type.
    • setInputMatrix

      public void setInputMatrix(Matrix inputMatrix) throws LockedException
      Sets reference to input matrix to be decomposed.
      Overrides:
      setInputMatrix in class Decomposer
      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 class Decomposer
      Returns:
      Boolean indicating whether decomposition has been computed and results can be retrieved.
    • decompose

      public void decompose() throws NotReadyException, LockedException, DecomposerException
      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 class Decomposer
      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

      public Matrix getR() throws NotAvailableException
      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

      public Matrix getQ() throws NotAvailableException
      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: