Class RealDenseCooTensorOps
java.lang.Object
org.flag4j.linalg.ops.dense_sparse.coo.real.RealDenseCooTensorOps
This class contains methods to apply common binary ops to a real dense matrix and to a real sparse matrix.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TensorAdds a real dense tensor to a real sparse tensor.static TensorAdds a scalar to a real sparse COO tensor.static voidAdds a real dense tensor to a real sparse tensor and stores the result in the first tensor.static CooTensorComputes the element-wise division between a real dense tensor and a real sparse tensor.static CooTensorComputes the element-wise multiplication between a real dense tensor and a real sparse tensor.static TensorSubtracts a real sparse tensor from a real dense tensor.static TensorSubtracts a scalar from each entry of a real sparse COO tensor.static TensorSubtracts a real dense tensor from a real sparse tensor.static voidSubtracts a real sparse tensor from a real dense tensor and stores the result in the dense tensor.
-
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 of element-wise multiplication.
- Throws:
IllegalArgumentException- If the tensors do not have the same shape.
-
elemDiv
Computes the element-wise division between a real dense tensor and a real sparse tensor.- Parameters:
src1- Real sparse tensor.src2- Real dense tensor.- Returns:
- The result of element-wise division.
- 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
-
sub
Subtracts a scalar from each entry of a real sparse COO tensor.- Parameters:
src1- Sparse tensor in difference.b- Scalar in difference.- Returns:
- A dense tensor which is the difference of
src1andbsuch thatbis subtracted from each element ofsrc1.
-