Interface QRDecomposition<T extends Matrix>

All Superinterfaces:
DecompositionInterface<T>
All Known Subinterfaces:
QRPDecomposition<T>, QRPDecomposition_F32<T>, QRPDecomposition_F64<T>, QrpSparseDecomposition<T>, QRSparseDecomposition<T>
All Known Implementing Classes:
QRColPivDecompositionHouseholderColumn_DDRM, QRColPivDecompositionHouseholderColumn_FDRM, QRDecomposition_DDRB_to_DDRM, QRDecomposition_FDRB_to_FDRM, QRDecompositionHouseholder_CDRM, QRDecompositionHouseholder_DDRB, QRDecompositionHouseholder_DDRM, QRDecompositionHouseholder_FDRB, QRDecompositionHouseholder_FDRM, QRDecompositionHouseholder_MT_DDRB, QRDecompositionHouseholder_MT_FDRB, QRDecompositionHouseholder_ZDRM, QRDecompositionHouseholderColumn_CDRM, QRDecompositionHouseholderColumn_DDRM, QRDecompositionHouseholderColumn_FDRM, QRDecompositionHouseholderColumn_MT_DDRM, QRDecompositionHouseholderColumn_MT_FDRM, QRDecompositionHouseholderColumn_ZDRM, QRDecompositionHouseholderTran_CDRM, QRDecompositionHouseholderTran_DDRM, QRDecompositionHouseholderTran_FDRM, QRDecompositionHouseholderTran_ZDRM, QrLeftLookingDecomposition_DSCC, QrLeftLookingDecomposition_FSCC

public interface QRDecomposition<T extends Matrix> extends DecompositionInterface<T>

QR decompositions decompose a rectangular matrix 'A' such that 'A=QR'. Where A ∈ ℜ n × m , n ≥ m, Q ∈ ℜ n × n is an orthogonal matrix, and R ∈ ℜ n × m is an upper triangular matrix. Some implementations of QR decomposition require that A has full rank.

Some features of QR decompositions:
  • Can decompose rectangular matrices.
  • Numerically stable solutions to least-squares problem, but not as stable as SVD
  • Can incrementally add and remove columns from the decomposed matrix. See AdjLinearSolverQr_DDRM
Orthogonal matrices have the following properties:
  • QQT=I
  • QT=Q-1
  • Method Summary

    Modifier and Type
    Method
    Description
    getQ(T Q, boolean compact)
    Returns the Q matrix from the decomposition.
    getR(T R, boolean compact)
    Returns the R matrix from the decomposition.

    Methods inherited from interface org.ejml.interfaces.decomposition.DecompositionInterface

    decompose, inputModified
  • Method Details

    • getQ

      T getQ(@Nullable T Q, boolean compact)

      Returns the Q matrix from the decomposition. Should only be called after DecompositionInterface.decompose(org.ejml.data.Matrix) has been called.

      Parameters:
      Q - (Input) Storage for Q. Reshaped to correct size automatically. If null a new matrix is created.
      compact - If true an m by n matrix is created, otherwise n by n.
      Returns:
      The Q matrix.
    • getR

      T getR(@Nullable T R, boolean compact)

      Returns the R matrix from the decomposition. Should only be called after DecompositionInterface.decompose(org.ejml.data.Matrix) has been.

      If setZeros is true then an n × m matrix is required and all the elements are set. If setZeros is false then the matrix must be at least m × m and only the upper triangular elements are set.

      Parameters:
      R - (Input) Storage for R. Reshaped to correct size automatically. If null a new matrix is created.
      compact - If true only the upper triangular elements are set
      Returns:
      The R matrix.