Class MatrixMultiplyDispatcher

java.lang.Object
org.flag4j.linalg.ops.MatrixMultiplyDispatcher

public final class MatrixMultiplyDispatcher extends Object
Dispatches matrix multiplication to the appropriate algorithm based on the size of the matrices to be multiplied.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName
    Dynamically chooses matrix multiply algorithm based on the shapes of the two matrices to multiply.
    static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName
    Dynamically chooses the matrix multiplication-transpose algorithm to used based on the shape of the first matrix.
    static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName
    Dynamically chooses matrix-vector multiply algorithm based on the shapes of the matrix to multiply.
    static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName
    Dynamically chooses matrix multiply algorithm based on the shapes of the two matrices to multiply.
    static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName
    Dynamically chooses the matrix multiplication-transpose algorithm to used based on the shape of the first matrix.
    static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName
    Dynamically chooses matrix-vector multiply algorithm based on the shapes of the matrix to multiply.
    static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName
    Dynamically chooses matrix-vector multiply algorithm based on the shapes of the matrix to multiply.
    static Complex128[]
    Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
    static CVector
    Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
    static <T extends Field<T>>
    T[]
    Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
    static <T extends Field<T>>
    T[]
    Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
    static Complex128[]
    Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
    static Complex128[]
    Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
    static double[]
    Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
    static <T extends Field<T>>
    T[]
    dispatch(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
    static Complex128[]
    Dispatches a matrix multiplication-transpose problem to the appropriate algorithm based on the size.
    static Complex128[]
    Dispatches a matrix multiplication-transpose problem to the appropriate algorithm based on the size.
    static Complex128[]
    Dispatches a matrix multiplication-transpose problem to the appropriate algorithm based on the size.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • dispatch

      public static double[] dispatch(Matrix A, Vector b)
      Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
      Parameters:
      A - Matrix to multiply.
      b - Vector to multiply.
      Returns:
      The result of the matrix-vector multiplication.
    • dispatch

      public static Complex128[] dispatch(Matrix A, CVector b)
      Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
      Parameters:
      A - Matrix to multiply.
      b - Vector to multiply.
      Returns:
      The result of the matrix-vector multiplication.
    • dispatch

      public static CVector dispatch(CMatrix A, Vector b)
      Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
      Parameters:
      A - Matrix to multiply.
      b - Vector to multiply.
      Returns:
      The result of the matrix-vector multiplication.
    • dispatch

      public static <T extends Field<T>> T[] dispatch(FieldMatrix<T> A, FieldVector<T> b)
      Dynamically chooses the appropriate matrix-vector multiplication algorithm based on the shapes of the matrix and vector.
      Parameters:
      A - Matrix to multiply.
      b - Vector to multiply.
      Returns:
      The result of the matrix-vector multiplication.
    • dispatch

      public static <T extends Field<T>> T[] dispatch(FieldMatrix<T> A, FieldMatrix<T> B)
      Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
      Parameters:
      A - First matrix in matrix multiplication.
      B - Second matrix in matrix multiplication.
      Returns:
      The result of the matrix multiplication.
      Throws:
      IllegalArgumentException - If the shapes of the two matrices are not conducive to matrix multiplication.
    • dispatch

      public static <T extends Field<T>> T[] dispatch(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape of the second matrix.
      Returns:
      The result of the matrix multiplication between the two matrices.
    • dispatch

      public static Complex128[] dispatch(Matrix A, CMatrix B)
      Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
      Parameters:
      A - First matrix in matrix multiplication.
      B - Second matrix in matrix multiplication.
      Returns:
      The result of the matrix multiplication.
      Throws:
      IllegalArgumentException - If the shapes of the two matrices are not conducive to matrix multiplication.
    • dispatch

      public static Complex128[] dispatch(CMatrix A, Matrix B)
      Dispatches a matrix multiplication problem to the appropriate algorithm based on the size.
      Parameters:
      A - First matrix in matrix multiplication.
      B - Second matrix in matrix multiplication.
      Returns:
      The result of the matrix multiplication.
      Throws:
      IllegalArgumentException - If the shapes of the two matrices are not conducive to matrix multiplication.
    • dispatchTranspose

      public static Complex128[] dispatchTranspose(CMatrix A, Matrix B)
      Dispatches a matrix multiplication-transpose problem to the appropriate algorithm based on the size. Computes A.mult(B.T()) without explicitly transposing B.
      Parameters:
      A - First matrix in matrix multiplication.
      B - Second matrix in matrix multiplication and the matrix to transpose.
      Returns:
      The result of the matrix multiplication-transpose.
      Throws:
      IllegalArgumentException - If the shapes of the two matrices are not conducive to matrix multiplication-transpose.
    • dispatchTranspose

      public static Complex128[] dispatchTranspose(Matrix A, CMatrix B)
      Dispatches a matrix multiplication-transpose problem to the appropriate algorithm based on the size. Computes A.mult(B.T()) but avoids explicit transposing of B.
      Parameters:
      A - First matrix in matrix multiplication.
      B - Second matrix in matrix multiplication and the matrix to transpose.
      Returns:
      The result of the matrix multiplication-transpose A.mult(B.T()).
      Throws:
      IllegalArgumentException - If the shapes of the two matrices are not conducive to matrix multiplication-transpose.
    • dispatchTranspose

      public static Complex128[] dispatchTranspose(CMatrix A, CMatrix B)
      Dispatches a matrix multiplication-transpose problem to the appropriate algorithm based on the size.
      Parameters:
      A - First matrix in matrix multiplication.
      B - Second matrix in matrix multiplication and the matrix to transpose.
      Returns:
      The result of the matrix multiplication-transpose.
      Throws:
      IllegalArgumentException - If the shapes of the two matrices are not conducive to matrix multiplication-transpose.
    • chooseAlgorithmRealComplexTranspose

      public static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName chooseAlgorithmRealComplexTranspose(Shape shape)
      Dynamically chooses the matrix multiplication-transpose algorithm to used based on the shape of the first matrix.
      Parameters:
      shape - Shape of the first matrix.
    • chooseAlgorithmComplexTranspose

      public static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName chooseAlgorithmComplexTranspose(Shape shape)
      Dynamically chooses the matrix multiplication-transpose algorithm to used based on the shape of the first matrix.
      Parameters:
      shape - Shape of the first matrix.
    • chooseAlgorithmRealVector

      public static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName chooseAlgorithmRealVector(Shape shape)
      Dynamically chooses matrix-vector multiply algorithm based on the shapes of the matrix to multiply.
      Parameters:
      shape - The shape of the matrix.
      Returns:
      The algorithm to use in the matrix multiplication.
    • chooseAlgorithmComplex

      public static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName chooseAlgorithmComplex(Shape shape1, Shape shape2)
      Dynamically chooses matrix multiply algorithm based on the shapes of the two matrices to multiply.
      Parameters:
      shape1 - The shape of the first matrix.
      shape2 - The shape fo the second matrix.
      Returns:
      The algorithm to use in the matrix multiplication.
    • chooseAlgorithmComplexVector

      public static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName chooseAlgorithmComplexVector(Shape shape)
      Dynamically chooses matrix-vector multiply algorithm based on the shapes of the matrix to multiply.
      Parameters:
      shape - The shape of the matrix.
      Returns:
      The algorithm to use in the matrix multiplication.
    • chooseAlgorithmRealComplex

      public static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName chooseAlgorithmRealComplex(Shape shape1, Shape shape2)
      Dynamically chooses matrix multiply algorithm based on the shapes of the two matrices to multiply.
      Parameters:
      shape1 - The shape of the first matrix.
      shape2 - The shape fo the second matrix.
      Returns:
      The algorithm to use in the matrix multiplication.
    • chooseAlgorithmRealComplexVector

      public static org.flag4j.linalg.ops.MatrixMultiplyDispatcher.AlgorithmName chooseAlgorithmRealComplexVector(Shape shape)
      Dynamically chooses matrix-vector multiply algorithm based on the shapes of the matrix to multiply.
      Parameters:
      shape - The shape of the matrix.
      Returns:
      The algorithm to use in the matrix multiplication.