Package org.flag4j.operations.dense.real
Class RealDenseElemDiv
java.lang.Object
org.flag4j.operations.dense.real.RealDenseElemDiv
This class contains low level implementations of element-wise division algorithms for real dense tensors.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
Minimum number of entries in each tensor to apply concurrent algorithm. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
Dynamically chooses and applies element-wise division algorithm to use based on the number of entries in the tensors.static double[]
Computes the element-wise division of two tensors.static double[]
elemDivConcurrent
(double[] src1, Shape shape1, double[] src2, Shape shape2) Computes the element-wise division of two tensors using a concurrent algorithm.
-
Field Details
-
CONCURRENT_THRESHOLD
private static final int CONCURRENT_THRESHOLDMinimum number of entries in each tensor to apply concurrent algorithm.- See Also:
-
-
Constructor Details
-
RealDenseElemDiv
private RealDenseElemDiv()
-
-
Method Details
-
elemDiv
Computes the element-wise division of two tensors.- Parameters:
src1
- First tensor in element-wise division.shape1
- Shape of the first tensor.src2
- Second tensor in element-wise division.shape2
- Shape of the second tensor.- Returns:
- The element-wise division of the two tensors.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
elemDivConcurrent
Computes the element-wise division of two tensors using a concurrent algorithm.- Parameters:
src1
- First tensor in element-wise division.shape1
- Shape of the first tensor.src2
- Second tensor in element-wise division.shape2
- Shape of the second tensor.- Returns:
- The element-wise division of the two tensors.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
dispatch
Dynamically chooses and applies element-wise division algorithm to use based on the number of entries in the tensors.- Parameters:
src1
- Entries of first tensor.shape1
- Shape of first tensor.src2
- Entries of second tensor.shape2
- Shape of second tensor.- Returns:
- The element-wise division of the two tensors.
-