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 Details

    • 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 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.
    • 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.