Class BidiagonalDecompositionRow_FDRM

All Implemented Interfaces:
BidiagonalDecomposition<FMatrixRMaj>, BidiagonalDecomposition_F32<FMatrixRMaj>, DecompositionInterface<FMatrixRMaj>
Direct Known Subclasses:

public class BidiagonalDecompositionRow_FDRM
extends Object
implements BidiagonalDecomposition_F32<FMatrixRMaj>

Performs a BidiagonalDecomposition_F32 using householder reflectors. This is efficient on wide or square matrices.

  • Field Details

    • b

      protected float[] b
    • u

      protected float[] u
  • Constructor Details

    • BidiagonalDecompositionRow_FDRM

      public BidiagonalDecompositionRow_FDRM​(int numElements)
      Creates a decompose that defines the specified amount of memory.
      numElements - number of elements in the matrix.
    • BidiagonalDecompositionRow_FDRM

      public BidiagonalDecompositionRow_FDRM()
  • Method Details

    • decompose

      public boolean decompose​(FMatrixRMaj A)
      Computes the decomposition of the provided matrix. If no errors are detected then true is returned, false otherwise.
      Specified by:
      decompose in interface DecompositionInterface<FMatrixRMaj>
      A - The matrix that is being decomposed. Not modified.
      If it detects any errors or not.
    • init

      protected void init​(FMatrixRMaj A)
      Sets up internal data structures and creates a copy of the input matrix.
      A - The input matrix. Not modified.
    • getUBV

      public FMatrixRMaj getUBV()
      The raw UBV matrix that is stored internally.
      UBV matrix.
    • getDiagonal

      public void getDiagonal​(float[] diag, float[] off)
      Description copied from interface: BidiagonalDecomposition_F32
      Extracts the diagonal and off diagonal elements from the decomposition.
      Specified by:
      getDiagonal in interface BidiagonalDecomposition_F32<FMatrixRMaj>
      diag - diagonal elements from B.
      off - off diagonal elements form B.
    • getB

      public FMatrixRMaj getB​(@Nullable @Nullable FMatrixRMaj B, boolean compact)
      Returns the bidiagonal matrix.
      Specified by:
      getB in interface BidiagonalDecomposition<FMatrixRMaj>
      B - If not null the results are stored here, if null a new matrix is created.
      The bidiagonal matrix.
    • handleB

      public static FMatrixRMaj handleB​(@Nullable @Nullable FMatrixRMaj B, boolean compact, int m, int n, int min)
    • getU

      public FMatrixRMaj getU​(@Nullable @Nullable FMatrixRMaj U, boolean transpose, boolean compact)
      Returns the orthogonal U matrix.
      Specified by:
      getU in interface BidiagonalDecomposition<FMatrixRMaj>
      U - If not null then the results will be stored here. Otherwise a new matrix will be created.
      The extracted Q matrix.
    • handleU

      public static FMatrixRMaj handleU​(@Nullable @Nullable FMatrixRMaj U, boolean transpose, boolean compact, int m, int n, int min)
    • getV

      public FMatrixRMaj getV​(@Nullable @Nullable FMatrixRMaj V, boolean transpose, boolean compact)
      Returns the orthogonal V matrix.
      Specified by:
      getV in interface BidiagonalDecomposition<FMatrixRMaj>
      V - If not null then the results will be stored here. Otherwise a new matrix will be created.
      The extracted Q matrix.
    • handleV

      public static FMatrixRMaj handleV​(@Nullable @Nullable FMatrixRMaj V, boolean transpose, boolean compact, int m, int n, int min)
    • computeU

      protected void computeU​(int k)
    • rank1UpdateMultL

      protected void rank1UpdateMultL​(FMatrixRMaj A, float gamma, int colA0, int w0, int w1)
    • rank1UpdateMultR

      protected void rank1UpdateMultR​(FMatrixRMaj A, float gamma, int colA0, int w0, int w1)
    • computeV

      protected void computeV​(int k)
    • getGammasU

      public float[] getGammasU()
      Returns gammas from the householder operations for the U matrix.
    • getGammasV

      public float[] getGammasV()
      Returns gammas from the householder operations for the V matrix.
    • inputModified

      public boolean inputModified()
      Description copied from interface: DecompositionInterface
      Is the input matrix to DecompositionInterface.decompose( is modified during the decomposition process.
      Specified by:
      inputModified in interface DecompositionInterface<FMatrixRMaj>
      true if the input matrix to decompose() is modified.