Class RealDenseMatMult

java.lang.Object
org.flag4j.linalg.ops.dense.real.RealDenseMatMult

public final class RealDenseMatMult extends Object
This class contains several low level methods for computing matrix-matrix multiplications.
WARNING: These methods do not perform any sanity checks.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    blocked(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication of two real dense matrices using a blocked algorithm.
    static double[]
    blockedReordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication of two real dense matrices using a blocked algorithm with the j-k loops swapped.
    static double[]
    blockedVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the multiplication of a real dense matrix with a real dense vector using a blocked algorithm.
    static double[]
    concurrentBlocked(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication of two real dense matrices using a concurrent implementation of a blocked algorithm.
    static double[]
    concurrentBlockedReordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication of two real dense matrices using a concurrent implementation of a blocked algorithm with the j-k loops swapped.
    static double[]
    concurrentBlockedVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the multiplication of a real dense matrix with a real dense vector using a concurrent implementation of a blocked algorithm.
    static double[]
    concurrentReordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication of two real dense matrices using a concurrent implementation of the standard matrix multiplication algorithm with j-k loops swapped.
    static double[]
    concurrentStandard(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication of two real dense matrices using a concurrent implementation of the standard matrix multiplication algorithm.
    static double[]
    concurrentStandardVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the multiplication of a real dense matrix with a real dense vector using a concurrent implementation of the standard matrix multiplication algorithm.
    static double[]
    reordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication between two real dense matrices using the standard algorithm with j-k loops swapped.
    static double[]
    standard(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication between two real dense matrices using the standard algorithm.
    static double[]
    standardVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
    Computes the multiplication of a real dense matrix with a real dense vector using the standard algorithm.

    Methods inherited from class java.lang.Object

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

    • standard

      public static double[] standard(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication between two real dense matrices using the standard algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • reordered

      public static double[] reordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication between two real dense matrices using the standard algorithm with j-k loops swapped.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • blocked

      public static double[] blocked(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication of two real dense matrices using a blocked algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • blockedReordered

      public static double[] blockedReordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication of two real dense matrices using a blocked algorithm with the j-k loops swapped.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • concurrentStandard

      public static double[] concurrentStandard(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication of two real dense matrices using a concurrent implementation of the standard matrix multiplication algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • concurrentReordered

      public static double[] concurrentReordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication of two real dense matrices using a concurrent implementation of the standard matrix multiplication algorithm with j-k loops swapped.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • concurrentBlocked

      public static double[] concurrentBlocked(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication of two real dense matrices using a concurrent implementation of a blocked algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • concurrentBlockedReordered

      public static double[] concurrentBlockedReordered(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication of two real dense matrices using a concurrent implementation of a blocked algorithm with the j-k loops swapped.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • standardVector

      public static double[] standardVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the multiplication of a real dense matrix with a real dense vector using the standard algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • blockedVector

      public static double[] blockedVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the multiplication of a real dense matrix with a real dense vector using a blocked algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • concurrentStandardVector

      public static double[] concurrentStandardVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the multiplication of a real dense matrix with a real dense vector using a concurrent implementation of the standard matrix multiplication algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.
    • concurrentBlockedVector

      public static double[] concurrentBlockedVector(double[] src1, Shape shape1, double[] src2, Shape shape2)
      Computes the multiplication of a real dense matrix with a real dense vector using a concurrent implementation of a blocked algorithm.
      Parameters:
      src1 - Entries of the first matrix.
      shape1 - Shape of the first matrix.
      src2 - Entries of the second matrix.
      shape2 - Shape fo the second matrix.
      Returns:
      The result of matrix multiplying the two matrices.