Class ComplexQR

All Implemented Interfaces:
Decomposition<CMatrix>

public class ComplexQR extends ComplexUnitaryDecomposition

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 Details

    • reduced

      protected final boolean reduced
      Flag indicating if the reduced (true) or full (false) QR decomposition should be computed.
  • Constructor Details

    • ComplexQR

      public ComplexQR()
      Creates a QR decomposer. This decomposer will compute the reduced QR decomposition.
      See Also:
    • ComplexQR

      public ComplexQR(boolean reduced)
      Creates a QR decomposer to compute either the full or reduced QR decomposition.
      Parameters:
      reduced - Flag indicating if this decomposer should compute the full or reduced QR decomposition.
  • Method Details

    • decompose

      public ComplexQR decompose(CMatrix src)
      Computes the QR decomposition of a real dense matrix.
      Parameters:
      src - The source matrix to decompose.
      Returns:
      A reference to this decomposer.
    • initQ

      protected CMatrix initQ()
      Creates and initializes Q to the appropriately sized identity matrix.
      Specified by:
      initQ in class UnitaryDecomposition<CMatrix,Complex128[]>
      Returns:
      An identity matrix with the appropriate size.
    • getUpper

      public CMatrix getUpper()
      Gets the upper triangular matrix R from the last decomposition.
      Specified by:
      getUpper in class UnitaryDecomposition<CMatrix,Complex128[]>
      Returns:
      The upper triangular matrix R from the last decomposition.
    • getR

      public CMatrix getR()
      Gets the upper triangular matrix R from the QR decomposition.
      Returns:
      The upper triangular matrix R from the QR decomposition.