Class RealDenseSparseMatrixMultiplication
java.lang.Object
org.flag4j.operations.dense_sparse.coo.real.RealDenseSparseMatrixMultiplication
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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
RealDenseSparseMatrixMultiplication
private RealDenseSparseMatrixMultiplication()
-
-
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 entries of the sparse matrix.rowIndices
- Row indices for non-zero entries of the sparse matrix.colIndices
- Column indices for non-zero entries 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 entries of the sparse matrix.rowIndices
- Row indices for non-zero entries of the sparse matrix.colIndices
- Column indices for non-zero entries 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 entries of the sparse matrix.rowIndices
- Row indices for non-zero entries of the sparse matrix.colIndices
- Column indices for non-zero entries 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 entries of the sparse matrix.rowIndices
- Row indices for non-zero entries of the sparse matrix.colIndices
- Column indices for non-zero entries 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
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 entries of the sparse vector.indices
- Indices of non-zero entries 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 entries in sparse matrix.colIndices
- Column indices of non-zero entries 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
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 entries of the sparse vector.indices
- Indices of non-zero entries 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 entries of the sparse vector.indices
- Indices of non-zero entries 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 entries in sparse matrix.colIndices
- Column indices of non-zero entries 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 entries of the sparse vector.indices
- Indices of non-zero entries in sparse vector.- Returns:
- Entries of the dense matrix resulting from the matrix vector multiplication.
-