Class ComplexSparseMatrixMultiplication
java.lang.Object
org.flag4j.operations.sparse.coo.complex.ComplexSparseMatrixMultiplication
This class contains low level methods for computing the matrix multiplication of sparse complex matrices/vectors.
WARNING: The methods in this class do not perform any sanity checks.
WARNING: The methods in this class do not perform any sanity checks.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CNumber[]
concurrentStandard
(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] rowIndices2, int[] colIndices2, Shape shape2) Computes the matrix multiplication between two sparse matrices using a concurrent implementation of the standard algorithm.static CNumber[]
concurrentStandardVector
(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] indices) Computes the multiplication between a sparse matrix and a sparse vector using a concurrent implementation of the standard algorithm.static CNumber[]
standard
(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] rowIndices2, int[] colIndices2, Shape shape2) Computes the matrix multiplication between two sparse matrices using a standard algorithm.static CNumber[]
standardVector
(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] indices) Computes the multiplication between a sparse matrix and a sparse vector using a standard algorithm.
-
Constructor Details
-
ComplexSparseMatrixMultiplication
private ComplexSparseMatrixMultiplication()
-
-
Method Details
-
standard
public static CNumber[] standard(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] rowIndices2, int[] colIndices2, Shape shape2) Computes the matrix multiplication between two sparse matrices using a standard algorithm.- Parameters:
src1
- Non-zero entries of the first sparse matrix.rowIndices1
- Row indices of non-zero entries for the first sparse matrix.colIndices1
- Column indices of non-zero entries for the first sparse matrix.shape1
- Shape of the first sparse matrix.src2
- Non-zero entries of the second sparse matrix.rowIndices2
- Row indices of non-zero entries for the second sparse matrix.colIndices2
- column indices of non-zero entries for the second sparse matrix.shape2
- Shape of the second sparse matrix.- Returns:
- The result of the matrix multiplication stored in a dense matrix.
-
concurrentStandard
public static CNumber[] concurrentStandard(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] rowIndices2, int[] colIndices2, Shape shape2) Computes the matrix multiplication between two sparse matrices using a concurrent implementation of the standard algorithm.
NOTE: Caution should be exercised when using this method. It is rarely faster thanstandard(CNumber[], int[], int[], Shape, CNumber[], int[], int[], Shape)
- Parameters:
src1
- Non-zero entries of the first sparse matrix.rowIndices1
- Row indices of non-zero entries for the first sparse matrix.colIndices1
- Column indices of non-zero entries for the first sparse matrix.shape1
- Shape of the first sparse matrix.src2
- Non-zero entries of the second sparse matrix.rowIndices2
- Row indices of non-zero entries for the second sparse matrix.colIndices2
- column indices of non-zero entries for the second sparse matrix.shape2
- Shape of the second sparse matrix.- Returns:
- The result of the matrix multiplication stored in a dense matrix.
-
standardVector
public static CNumber[] standardVector(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] indices) Computes the multiplication between a sparse matrix and a sparse vector using a standard algorithm.- Parameters:
src1
- Non-zero entries of the first sparse matrix.rowIndices1
- Row indices of non-zero entries for the first sparse matrix.colIndices1
- Column indices of non-zero entries for the first sparse matrix.shape1
- Shape of the first sparse matrix.src2
- Non-zero entries of the second sparse matrix.indices
- Indices of non-zero entries in the sparse vector.- Returns:
- The result of the matrix-vector multiplication stored in a dense matrix.
-
concurrentStandardVector
public static CNumber[] concurrentStandardVector(CNumber[] src1, int[] rowIndices1, int[] colIndices1, Shape shape1, CNumber[] src2, int[] indices) Computes the multiplication between a sparse matrix and a sparse vector using a concurrent implementation of the standard algorithm.- Parameters:
src1
- Non-zero entries of the first sparse matrix.rowIndices1
- Row indices of non-zero entries for the first sparse matrix.colIndices1
- Column indices of non-zero entries for the first sparse matrix.shape1
- Shape of the first sparse matrix.src2
- Non-zero entries of the second sparse matrix.indices
- Indices of non-zero entries in the sparse vector.- Returns:
- The result of the matrix-vector multiplication stored in a dense matrix.
-