Class ComplexQR


public class ComplexQR extends ComplexUnitaryDecomposition

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:
  1. Instantiate an instance of ComplexQR.
  2. Call decompose(CMatrix) to perform the factorization.
  3. Retrieve the resulting matrices using ComplexUnitaryDecomposition.getQ() and getR().
See Also:
  • Field Details

    • reduced

      protected final boolean reduced
      Flag 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.
  • 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.
      Overrides:
      decompose in class UnitaryDecomposition<CMatrix,Complex128[]>
      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.