Class DenseCsrSemiringMatMult

java.lang.Object
org.flag4j.linalg.ops.dense_sparse.csr.semiring_ops.DenseCsrSemiringMatMult

public final class DenseCsrSemiringMatMult extends Object
This class contains low-level implementations of semiring sparse-dense matrix multiplication where the sparse matrices are in CSR format.
  • Method Details

    • standard

      public static <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. 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 src1 and src2.
      Throws:
      IllegalArgumentException - If src1 does not have the same number of columns as src2 has rows.
    • standard

      public 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. 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 src1 and src2.
      Throws:
      IllegalArgumentException - If src1 does not have the same number of columns as src2 has rows.
    • standardVector

      public 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.
      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 in src1 does not equal the length of src2.