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 CMatrix
add
(Matrix src1, CooCMatrix src2) Adds a real dense matrix to a complex sparse matrix.static CooCMatrix
Computes the element-wise division between a real sparse matrix and a complex dense matrix.static CooCMatrix
Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.static CooCMatrix
elemMult
(Matrix src1, CooCMatrix src2) Computes the element-wise multiplication between a complex dense matrix and a real sparse matrix.static CMatrix
sub
(Matrix src1, CooCMatrix src2) Subtracts a real sparse matrix from a real dense matrix.static CMatrix
sub
(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
src1
withsrc2
. - 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_INFINITY
orDouble.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
src1
andsrc2
. - Throws:
TensorShapeException
- Ifsrc1
andsrc2
do not have the same shape.
-