Class RealDenseSparseMatMult

java.lang.Object
org.flag4j.linalg.ops.dense_sparse.coo.real.RealDenseSparseMatMult

public class RealDenseSparseMatMult extends Object
This class contains low level methods for computing the matrix multiplication (and matrix vector multiplication) between a real dense/sparse matrix and a real sparse/dense matrix or vector.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    blockedVector(double[] src1, Shape shape1, double[] src2, int[] indices)
    Computes the dense matrix sparse vector multiplication using a blocked algorithm.
    static double[]
    concurrentBlockedVector(double[] src1, Shape shape1, double[] src2, int[] indices)
    Computes the dense matrix sparse vector multiplication using a blocked algorithm.
    static double[]
    concurrentStandard(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication between a real sparse matrix and a real dense matrix using a concurrent standard algorithm.
    static double[]
    concurrentStandard(double[] src1, Shape shape1, double[] src2, int[] rowIndices, int[] colIndices, Shape shape2)
    Computes the matrix multiplication between a real dense matrix and a real sparse matrix using a concurrent standard algorithm.
    static double[]
    concurrentStandardVector(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
    Computes the sparse matrix dense vector multiplication using a concurrent standard algorithm.
    static double[]
    concurrentStandardVector(double[] src1, Shape shape1, double[] src2, int[] indices)
    Computes the dense matrix sparse vector multiplication using a concurrent standard algorithm.
    static double[]
    standard(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
    Computes the matrix multiplication between a real sparse matrix and a real dense matrix using a standard algorithm.
    static double[]
    standard(double[] src1, Shape shape1, double[] src2, int[] rowIndices, int[] colIndices, Shape shape2)
    Computes the matrix multiplication between a real dense matrix and a real sparse matrix using a standard algorithm.
    static double[]
    standardVector(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
    Computes the sparse matrix dense vector multiplication using a standard algorithm.
    static double[]
    standardVector(double[] src1, Shape shape1, double[] src2, int[] indices)
    Computes the dense matrix sparse vector multiplication using a 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, int[] rowIndices, int[] colIndices, Shape shape2)
      Computes the matrix multiplication between a real dense matrix and a real sparse matrix using a standard algorithm.
      Parameters:
      src1 - Entries of the dense matrix.
      shape1 - Shape of the dense matrix.
      src2 - Non-zero data of the sparse matrix.
      rowIndices - Row indices for non-zero data of the sparse matrix.
      colIndices - Column indices for non-zero data of the sparse matrix.
      shape2 - Shape of the sparse matrix.
      Returns:
      The result of the matrix multiplication.
    • standard

      public static double[] standard(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication between a real sparse matrix and a real dense matrix using a standard algorithm.
      Parameters:
      src1 - Non-zero data of the sparse matrix.
      rowIndices - Row indices for non-zero data of the sparse matrix.
      colIndices - Column indices for non-zero data of the sparse matrix.
      shape1 - Shape of the sparse matrix.
      src2 - Entries of the dense matrix.
      shape2 - Shape of the dense matrix.
      Returns:
      The result of the matrix multiplication.
    • concurrentStandard

      public static double[] concurrentStandard(double[] src1, Shape shape1, double[] src2, int[] rowIndices, int[] colIndices, Shape shape2)
      Computes the matrix multiplication between a real dense matrix and a real sparse matrix using a concurrent standard algorithm.
      Parameters:
      src1 - Entries of the dense matrix.
      shape1 - Shape of the dense matrix.
      src2 - Non-zero data of the sparse matrix.
      rowIndices - Row indices for non-zero data of the sparse matrix.
      colIndices - Column indices for non-zero data of the sparse matrix.
      shape2 - Shape of the sparse matrix.
      Returns:
      The result of the matrix multiplication.
    • concurrentStandard

      public static double[] concurrentStandard(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
      Computes the matrix multiplication between a real sparse matrix and a real dense matrix using a concurrent standard algorithm.
      Parameters:
      src1 - Non-zero data of the sparse matrix.
      rowIndices - Row indices for non-zero data of the sparse matrix.
      colIndices - Column indices for non-zero data of the sparse matrix.
      shape1 - Shape of the sparse matrix.
      src2 - Entries of the dense matrix.
      shape2 - Shape of the dense matrix.
      Returns:
      The result of the matrix multiplication.
    • standardVector

      public static double[] standardVector(double[] src1, Shape shape1, double[] src2, int[] indices)
      Computes the dense matrix sparse vector multiplication using a standard algorithm.
      Parameters:
      src1 - Entries of the dense matrix.
      shape1 - Shape of the dense matrix.
      src2 - Non-zero data of the sparse vector.
      indices - Indices of non-zero data in sparse vector.
      Returns:
      Entries of the dense matrix resulting from the matrix vector multiplication.
    • standardVector

      public static double[] standardVector(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
      Computes the sparse matrix dense vector multiplication using a standard algorithm.
      Parameters:
      src1 - Entries of the sparse matrix.
      rowIndices - Row indices of non-zero data in sparse matrix.
      colIndices - Column indices of non-zero data in sparse matrix.
      shape1 - Shape of the sparse matrix.
      src2 - Entries of the dense vector.
      shape2 - Shape of the dense vector.
      Returns:
      Entries of the dense matrix resulting from the matrix vector multiplication.
    • blockedVector

      public static double[] blockedVector(double[] src1, Shape shape1, double[] src2, int[] indices)
      Computes the dense matrix sparse vector multiplication using a blocked algorithm.
      Parameters:
      src1 - Entries of the dense matrix.
      shape1 - Shape of the dense matrix.
      src2 - Non-zero data of the sparse vector.
      indices - Indices of non-zero data in sparse vector.
      Returns:
      Entries of the dense matrix resulting from the matrix vector multiplication.
    • concurrentStandardVector

      public static double[] concurrentStandardVector(double[] src1, Shape shape1, double[] src2, int[] indices)
      Computes the dense matrix sparse vector multiplication using a concurrent standard algorithm.
      Parameters:
      src1 - Entries of the dense matrix.
      shape1 - Shape of the dense matrix.
      src2 - Non-zero data of the sparse vector.
      indices - Indices of non-zero data in sparse vector.
      Returns:
      Entries of the dense matrix resulting from the matrix vector multiplication.
    • concurrentStandardVector

      public static double[] concurrentStandardVector(double[] src1, int[] rowIndices, int[] colIndices, Shape shape1, double[] src2, Shape shape2)
      Computes the sparse matrix dense vector multiplication using a concurrent standard algorithm.
      Parameters:
      src1 - Entries of the sparse matrix.
      rowIndices - Row indices of non-zero data in sparse matrix.
      colIndices - Column indices of non-zero data in sparse matrix.
      shape1 - Shape of the sparse matrix.
      src2 - Entries of the dense vector.
      shape2 - Shape of the dense vector.
      Returns:
      Entries of the dense matrix resulting from the matrix vector multiplication.
    • concurrentBlockedVector

      public static double[] concurrentBlockedVector(double[] src1, Shape shape1, double[] src2, int[] indices)
      Computes the dense matrix sparse vector multiplication using a blocked algorithm.
      Parameters:
      src1 - Entries of the dense matrix.
      shape1 - Shape of the dense matrix.
      src2 - Non-zero data of the sparse vector.
      indices - Indices of non-zero data in sparse vector.
      Returns:
      Entries of the dense matrix resulting from the matrix vector multiplication.