Class RealDenseSparseTensorOperations
java.lang.Object
org.flag4j.operations.dense_sparse.coo.real.RealDenseSparseTensorOperations
This class contains methods to apply common binary operations to a real dense matrix and to a real sparse matrix.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Tensor
Adds a real dense tensor to a real sparse tensor.static Tensor
Adds a scalar to a real sparse COO tensor.static void
Adds a real dense tensor to a real sparse tensor and stores the result in the first tensor.static CooTensor
Computes the element-wise multiplication between a real dense tensor and a real sparse tensor.static Tensor
Subtracts a real sparse tensor from a real dense tensor.static Tensor
Subtracts a real dense tensor from a real sparse tensor.static void
Subtracts a real sparse tensor from a real dense tensor and stores the result in the dense tensor.
-
Constructor Details
-
RealDenseSparseTensorOperations
private RealDenseSparseTensorOperations()
-
-
Method Details
-
add
Adds a real dense tensor to a real sparse tensor.- Parameters:
src1
- First tensor in sum.src2
- Second tensor in sum.- Returns:
- The result of the tensor addition.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
elemMult
Computes the element-wise multiplication between a real dense tensor and a real sparse tensor.- Parameters:
src1
- Real dense tensor.src2
- Real sparse tensor.- Returns:
- The result ofm element-wise multiplication.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
sub
Subtracts a real sparse 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
-
sub
Subtracts a real 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
-
addEq
Adds a real dense tensor to a real sparse tensor and stores the result in the first tensor.- Parameters:
src1
- First tensor in sum. Also, storage of result.src2
- Second tensor in sum.- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
subEq
Subtracts a real sparse tensor from a real dense tensor and stores the result in the dense tensor.- Parameters:
src1
- First tensor in difference. Also, storage of result.src2
- Second tensor in difference.- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
add
-