Class RealComplexDenseCooMatOps
java.lang.Object
org.flag4j.linalg.ops.dense_sparse.coo.real_complex.RealComplexDenseCooMatOps
This class contains low level implementations of ops between real/complex and dense/sparse matrices.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CMatrixadd(Matrix src1, CooCMatrix src2) Adds a real dense matrix to a complex sparse matrix.static CooCMatrixComputes the element-wise division between a real sparse matrix and a complex dense matrix.static CooCMatrixComputes the element-wise multiplication between a complex dense matrix and a real sparse matrix.static CooCMatrixelemMult(Matrix src1, CooCMatrix src2) Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.static CMatrixsub(Matrix src1, CooCMatrix src2) Subtracts a real sparse matrix from a real dense matrix.static CMatrixsub(CooCMatrix src2, Matrix src1) Subtracts a real sparse matrix from a real dense matrix.
-
Method Details
-
add
Adds a real dense matrix to a complex sparse matrix.- Parameters:
src1- First matrix.src2- Second matrix.- Returns:
- The result of the matrix addition.
- Throws:
TensorShapeException- If the matrices do not have the same shape.
-
sub
Subtracts a real sparse matrix from a real dense matrix.- Parameters:
src1- First matrix.src2- Second matrix.- Returns:
- The result of the matrix subtraction.
- Throws:
TensorShapeException- If the matrices do not have the same shape.
-
sub
Subtracts a real sparse matrix from a real dense matrix.- Parameters:
src2- Second matrix.src1- First matrix.- Returns:
- The result of the matrix subtraction.
- Throws:
TensorShapeException- If the matrices do not have the same shape.
-
elemMult
Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.- Parameters:
src1- First matrix.src2- Second matrix.- Returns:
- The result of element-wise multiplication.
- Throws:
TensorShapeException- If the matrices do not have the same shape.
-
elemMult
Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.- Parameters:
src1- First matrix in the element-wise product.src2- Second matrix in the element-wise product.- Returns:
- The result of element-wise product of
src1withsrc2. - Throws:
TensorShapeException- If the matrices do not have the same shape.
-
elemDiv
Computes the element-wise division between a real sparse matrix and a complex dense matrix.If the dense matrix contains a zero at the same index the sparse matrix contains a non-zero, the result will be either
Double.POSITIVE_INFINITYorDouble.NEGATIVE_INFINITY.If the dense matrix contains a zero at an index for which the sparse matrix is also zero, the result will be zero. This is done to realize computational benefits from ops with sparse matrices.
- Parameters:
src1- Real sparse matrix and numerator in element-wise quotient.src2- Real Dense matrix and denominator in element-wise quotient.- Returns:
- The element-wise quotient of
src1andsrc2. - Throws:
TensorShapeException- Ifsrc1andsrc2do not have the same shape.
-