Class RealComplexDenseSparseOperations
java.lang.Object
org.flag4j.operations.dense_sparse.coo.real_complex.RealComplexDenseSparseOperations
This class contains methods to apply common binary operations to a real/complex dense matrix and to a complex/real sparse matrix.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CTensor
Adds a dense complex tensor to a real sparse tensor.static CTensor
add
(Tensor src1, CooCTensor src2) Adds a real dense tensor to a sparse complex tensor.static CTensor
add
(CooCTensor src1, double b) Adds a scalar to a real sparse COO tensor.static CTensor
Adds a scalar to a real sparse COO tensor.static void
Computes element-wise addition between a complex dense tensor and a real sparse tensor.static CooCTensor
Computes the element-wise multiplication between a complex dense tensor and a real sparse matrix.static CooCTensor
elemMult
(Tensor src1, CooCTensor src2) Computes the element-wise multiplication between a real dense tensor and a complex sparse tensor.static CTensor
Adds a dense complex tensor to a real sparse tensor.static CTensor
sub
(Tensor src1, CooCTensor src2) Subtracts a sparse complex tensor from a real dense tensor.static CTensor
sub
(CooCTensor src1, Tensor src2) Subtracts a real dense tensor from a complex sparse tensor.static CTensor
Subtracts a complex dense tensor from a real sparse tensor.static void
Computes element-wise subtraction between a complex dense tensor and a real sparse tensor.
-
Constructor Details
-
RealComplexDenseSparseOperations
private RealComplexDenseSparseOperations()
-
-
Method Details
-
elemMult
Computes the element-wise multiplication between a real dense tensor and a complex sparse tensor.- Parameters:
src1
- Real dense tensor.src2
- Complex sparse tensor.- Returns:
- The result of element-wise multiplication between the two tensors.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
add
Adds a real dense tensor to a sparse complex tensor.- Parameters:
src1
- First tensor in the sum.src2
- Second tensor in the sum.- Returns:
- The result of the tensor addition.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.t
-
sub
Subtracts a sparse complex tensor from a real dense tensor.- Parameters:
src1
- First tensor in the sum.src2
- Second tensor in the sum.- Returns:
- The result of the tensor addition.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.t
-
add
-
sub
-
addEq
Computes element-wise addition between a complex dense tensor and a real sparse tensor. The result is stored in the complex dense tensor.- Parameters:
src1
- The complex dense tensor. Also, the storage for the computation.src2
- The real sparse tensor.
-
subEq
Computes element-wise subtraction between a complex dense tensor and a real sparse tensor. The result is stored in the complex dense tensor.- Parameters:
src1
- The complex dense tensor. Also, the storage for the computation.src2
- The real sparse tensor.
-
elemMult
Computes the element-wise multiplication between a complex dense tensor and a real sparse matrix.- Parameters:
src1
- First tensor in the element-wise multiplication.src2
- Second tensor in the element-wise multiplication.- Returns:
- The result of element-wise multiplication.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
sub
Subtracts a complex dense tensor from a real sparse tensor.- Parameters:
src1
- First tensor in the sum.src2
- Second tensor in the sum.- Returns:
- The result of the tensor addition.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.t
-
sub
Subtracts a real dense tensor from a complex sparse tensor.- Parameters:
src1
- First tensor in the sum.src2
- Second tensor in the sum.- Returns:
- The result of the tensor addition.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.t
-
add
-
add
Adds a scalar to a real sparse COO tensor.- Parameters:
src1
- Sparse tensor in sum.b
- Scalar in sum.- Returns:
- A dense tensor which is the sum of
src1
andb
such thatb
is added to each element ofsrc1
.
-