Class DenseSemiringMatMult

java.lang.Object
org.flag4j.linalg.ops.dense.semiring_ops.DenseSemiringMatMult

public final class DenseSemiringMatMult extends Object
This utility class provides methods for computing dense matrix multiplication between matrices whose data are members of a Semiring.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends Semiring<T>>
    void
    blocked(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication of two dense matrices using a blocked algorithm.
    static <T extends Semiring<T>>
    void
    blockedReordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication of two dense matrices using a blocked algorithm with the j-k loops swapped.
    static <T extends Semiring<T>>
    void
    blockedVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the multiplication of a dense matrix with a dense vector using a blocked algorithm.
    static <T extends Semiring<T>>
    void
    concurrentBlocked(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication of two dense matrices using a concurrent implementation of a blocked algorithm.
    static <T extends Semiring<T>>
    void
    concurrentBlockedReordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication of two dense matrices using a concurrent implementation of a blocked algorithm with the j-k loops swapped.
    static <T extends Semiring<T>>
    void
    concurrentBlockedVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the multiplication of a dense matrix with a dense vector using a concurrent implementation of a blocked algorithm.
    static <T extends Semiring<T>>
    void
    concurrentReordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication of two dense matrices using a concurrent implementation of the standard matrix multiplication algorithm with j-k loops swapped.
    static <T extends Semiring<T>>
    void
    concurrentStandard(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication of two dense matrices using a concurrent implementation of the standard matrix multiplication algorithm.
    static <T extends Semiring<T>>
    void
    concurrentStandardVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the multiplication of a dense matrix with a dense vector using a concurrent implementation of the standard matrix multiplication algorithm.
    static <T extends Semiring<T>>
    void
    reordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication between two dense matrices using the standard algorithm with j-k loops swapped.
    static <T extends Semiring<T>>
    void
    standard(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the matrix multiplication between two dense matrices using the standard algorithm.
    static <T extends Semiring<T>>
    void
    standardVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
    Computes the multiplication of a dense matrix with a 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 <T extends Semiring<T>> void standard(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication between two 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.
      dest - Array to store resulting matrix multiplication in.
    • reordered

      public static <T extends Semiring<T>> void reordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication between two 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.
      dest - Array to store resulting matrix multiplication in.
    • blocked

      public static <T extends Semiring<T>> void blocked(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication of two 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.
      dest - Array to store resulting matrix multiplication in.
    • blockedReordered

      public static <T extends Semiring<T>> void blockedReordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication of two 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.
      dest - Array to store resulting matrix multiplication in.
    • concurrentStandard

      public static <T extends Semiring<T>> void concurrentStandard(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication of two 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.
      dest - Array to store resulting matrix multiplication in.
    • concurrentReordered

      public static <T extends Semiring<T>> void concurrentReordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication of two 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.
      dest - Array to store resulting matrix multiplication in.
    • concurrentBlocked

      public static <T extends Semiring<T>> void concurrentBlocked(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication of two 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.
      dest - Array to store resulting matrix multiplication in.
    • concurrentBlockedReordered

      public static <T extends Semiring<T>> void concurrentBlockedReordered(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the matrix multiplication of two 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.
      dest - Array to store resulting matrix multiplication in.
    • standardVector

      public static <T extends Semiring<T>> void standardVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the multiplication of a dense matrix with a 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.
      dest - Array to store resulting matrix multiplication in.
    • blockedVector

      public static <T extends Semiring<T>> void blockedVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the multiplication of a dense matrix with a 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.
      dest - Array to store resulting matrix multiplication in.
    • concurrentStandardVector

      public static <T extends Semiring<T>> void concurrentStandardVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the multiplication of a dense matrix with a 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.
      dest - Array to store resulting matrix multiplication in.
    • concurrentBlockedVector

      public static <T extends Semiring<T>> void concurrentBlockedVector(T[] src1, Shape shape1, T[] src2, Shape shape2, T[] dest)
      Computes the multiplication of a dense matrix with a 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.
      dest - Array to store resulting matrix multiplication in.