Class DenseCsrSemiringMatMult
java.lang.Object
org.flag4j.linalg.ops.dense_sparse.csr.semiring_ops.DenseCsrSemiringMatMult
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Semiring<T>>
AbstractDenseSemiringMatrix<?, ?, T> standard(AbstractCsrSemiringMatrix<?, ?, ?, T> src1, AbstractDenseSemiringMatrix<?, ?, T> src2) Computes the matrix multiplication between a sparse CSR matrix and a dense field matrix.static <T extends Semiring<T>>
AbstractDenseSemiringMatrix<?, ?, T> standard(AbstractDenseSemiringMatrix<?, ?, T> src1, AbstractCsrSemiringMatrix<?, ?, ?, T> src2) Computes the matrix multiplication between a dense matrix and a sparse CSR field matrix.static <T extends Semiring<T>>
AbstractDenseSemiringVector<?, ?, T> standardVector(AbstractCsrSemiringMatrix<?, ?, ?, T> src1, AbstractDenseSemiringVector<?, ?, T> src2) Computes the matrix-vector multiplication between a real sparse CSR matrix and a dense field vector.
-
Method Details
-
standard
public static <T extends Semiring<T>> AbstractDenseSemiringMatrix<?,?, standardT> (AbstractCsrSemiringMatrix<?, ?, ?, T> src1, AbstractDenseSemiringMatrix<?, ?, T> src2) Computes the matrix multiplication between a sparse CSR matrix and a dense field matrix. WARNING: If the first matrix is very large but not very sparse, this method may be slower than converting the first matrix to a dense matrix and computed the dense-dense matrix multiplication.- Parameters:
src1- First matrix in the matrix multiplication.src2- Second matrix in the matrix multiplication.- Returns:
- The result of the matrix multiplication between
src1andsrc2. - Throws:
IllegalArgumentException- Ifsrc1does not have the same number of columns assrc2has rows.
-
standard
public static <T extends Semiring<T>> AbstractDenseSemiringMatrix<?,?, standardT> (AbstractDenseSemiringMatrix<?, ?, T> src1, AbstractCsrSemiringMatrix<?, ?, ?, T> src2) Computes the matrix multiplication between a dense matrix and a sparse CSR field matrix. WARNING: If the first matrix is very large but not very sparse, this method may be slower than converting the first matrix to a dense matrix and computed the dense-dense matrix multiplication.- Parameters:
src1- First matrix in the matrix multiplication (dense matrix).src2- Second matrix in the matrix multiplication (sparse CSR matrix).- Returns:
- The result of the matrix multiplication between
src1andsrc2. - Throws:
IllegalArgumentException- Ifsrc1does not have the same number of columns assrc2has rows.
-
standardVector
public static <T extends Semiring<T>> AbstractDenseSemiringVector<?,?, standardVectorT> (AbstractCsrSemiringMatrix<?, ?, ?, T> src1, AbstractDenseSemiringVector<?, ?, T> src2) Computes the matrix-vector multiplication between a real sparse CSR matrix and a dense field vector.- Parameters:
src1- The matrix in the multiplication.src2- Vector in multiplication. Treated as a column vector.- Returns:
- The result of the matrix-vector multiplication.
- Throws:
IllegalArgumentException- If the number of columns insrc1does not equal the length ofsrc2.
-