Class RealFieldDenseCsrMatMult
java.lang.Object
org.flag4j.linalg.ops.dense_sparse.csr.real_field_ops.RealFieldDenseCsrMatMult
This class contains low-level implementations of real-complex sparse-dense matrix multiplication where the sparse matrix
is in CSR format.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Field<T>>
AbstractDenseFieldMatrix<?, ?, T> standard
(AbstractCsrFieldMatrix<?, ?, ?, T> src1, Matrix src2) Computes the matrix multiplication between a complex sparse CSR matrix and a real dense matrix.static <T extends Field<T>>
AbstractDenseFieldMatrix<?, ?, T> standard
(AbstractDenseFieldMatrix<?, ?, T> src1, CsrMatrix src2) Computes the matrix multiplication between a real dense matrix and a real sparse CSR matrix.static <T extends Field<T>>
AbstractDenseFieldMatrix<?, ?, T> standard
(Matrix src1, AbstractCsrFieldMatrix<?, ?, ?, T> src2) Computes the matrix multiplication between a real dense matrix and a real sparse CSR matrix.static <T extends Field<T>>
AbstractDenseFieldMatrix<?, ?, T> standard
(CsrMatrix src1, AbstractDenseFieldMatrix<?, ?, T> src2) Computes the matrix multiplication between a real sparse CSR matrix and a complex dense matrix.static <T extends Field<T>>
AbstractDenseFieldMatrix<?, ?, T> standardTranspose
(CsrMatrix src1, AbstractDenseFieldMatrix<?, ?, T> src2) Computes the matrix multiplication between a real sparse CSR matrix and the transpose of a complex dense matrix.static <T extends Field<T>>
AbstractDenseFieldVector<?, ?, T> standardVector
(AbstractCsrFieldMatrix<?, ?, ?, T> src1, Vector src2) Computes the matrix-vector multiplication between a real sparse CSR matrix and a complex dense vector.static <T extends Field<T>>
AbstractDenseFieldVector<?, ?, T> standardVector
(CsrMatrix src1, AbstractDenseFieldVector<?, ?, T> src2) Computes the matrix-vector multiplication between a real sparse CSR matrix and a complex dense vector.
-
Method Details
-
standard
public static <T extends Field<T>> AbstractDenseFieldMatrix<?,?, standardT> (CsrMatrix src1, AbstractDenseFieldMatrix<?, ?, T> src2) Computes the matrix multiplication between a real sparse CSR matrix and a complex dense 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 computing a 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
andsrc2
. - Throws:
TensorShapeException
- Ifsrc1
does not have the same number of columns assrc2
has rows.
-
standardTranspose
public static <T extends Field<T>> AbstractDenseFieldMatrix<?,?, standardTransposeT> (CsrMatrix src1, AbstractDenseFieldMatrix<?, ?, T> src2) Computes the matrix multiplication between a real sparse CSR matrix and the transpose of a complex dense matrix. WARNING: This method is likely slower thanstandard(src1, src2.T())
unlesssrc1
has many more columns than rows and is very sparse.- Parameters:
src1
- First matrix in the matrix multiplication.src2
- Second matrix in the matrix multiplication. Will be implicitly transposed.- Returns:
- The result of the matrix multiplication between
src1
andsrc2
. - Throws:
IllegalArgumentException
- Ifsrc1
andsrc2
do not have the same number of rows.
-
standard
public static <T extends Field<T>> AbstractDenseFieldMatrix<?,?, standardT> (Matrix src1, AbstractCsrFieldMatrix<?, ?, ?, T> src2) Computes the matrix multiplication between a real dense matrix and a real sparse CSR matrix. WARNING: If the second matrix is very large but not very sparse, this method may be slower than converting the second matrix to adense
matrix and callingMatrix.mult(Matrix)
.- 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
andsrc2
. - Throws:
TensorShapeException
- Ifsrc1
does not have the same number of columns assrc2
has rows.
-
standard
public static <T extends Field<T>> AbstractDenseFieldMatrix<?,?, standardT> (AbstractDenseFieldMatrix<?, ?, T> src1, CsrMatrix src2) Computes the matrix multiplication between a real dense matrix and a real sparse CSR matrix. WARNING: If the second matrix is very large but not very sparse, this method may be slower than converting the second matrix to adense
matrix and callingMatrix.mult(Matrix)
.- 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
andsrc2
. - Throws:
TensorShapeException
- Ifsrc1
does not have the same number of columns assrc2
has rows.
-
standardVector
public static <T extends Field<T>> AbstractDenseFieldVector<?,?, standardVectorT> (CsrMatrix src1, AbstractDenseFieldVector<?, ?, T> src2) Computes the matrix-vector multiplication between a real sparse CSR matrix and a complex dense 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 insrc1
does not equal the length ofsrc2
.
-
standard
public static <T extends Field<T>> AbstractDenseFieldMatrix<?,?, standardT> (AbstractCsrFieldMatrix<?, ?, ?, T> src1, Matrix src2) Computes the matrix multiplication between a complex sparse CSR matrix and a real dense matrix.- Parameters:
src1
- First matrix in the matrix multiplication.src2
- Second matrix in the matrix multiplication.- Returns:
- The result of the matrix multiplication between
src1
andsrc2
. - Throws:
TensorShapeException
- Ifsrc1
does not have the same number of columns assrc2
has rows.
-
standardVector
public static <T extends Field<T>> AbstractDenseFieldVector<?,?, standardVectorT> (AbstractCsrFieldMatrix<?, ?, ?, T> src1, Vector src2) Computes the matrix-vector multiplication between a real sparse CSR matrix and a complex dense 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 insrc1
does not equal the length ofsrc2
.
-