Class RealDenseElemDiv
java.lang.Object
org.flag4j.linalg.ops.dense.real.RealDenseElemDiv
This class contains low level implementations of element-wise division algorithms for real dense tensors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
dispatch
(double[] src1, double[] src2, double[] dest) Dynamically chooses and applies element-wise division algorithm to use based on the number of data in the tensors.static double[]
elemDiv
(double[] src1, double[] src2, double[] dest) Computes the element-wise division of two tensors.static double[]
elemDivConcurrent
(double[] src1, double[] src2, double[] dest) Computes the element-wise division of two tensors using a concurrent algorithm.
-
Method Details
-
elemDiv
public static double[] elemDiv(double[] src1, double[] src2, double[] dest) Computes the element-wise division of two tensors.- Parameters:
src1
- First tensor in element-wise division.src2
- Second tensor in element-wise division.dest
- Array to store the result in.- Returns:
- If
dest != null
then a reference todest
is returned. Otherwise, a new array of appropriate size will be created and returned. - Throws:
IllegalArgumentException
- Ifsrc1.length != src2.length
.ArrayIndexOutOfBoundsException
- Ifdest != null && dest.length < src2.length
.
-
elemDivConcurrent
public static double[] elemDivConcurrent(double[] src1, double[] src2, double[] dest) Computes the element-wise division of two tensors using a concurrent algorithm.- Parameters:
src1
- First tensor in element-wise division.src2
- Second tensor in element-wise division.dest
- Array to store the result in.- Returns:
- If
dest != null
then a reference todest
is returned. Otherwise, a new array of appropriate size will be created and returned. - Throws:
IllegalArgumentException
- Ifsrc1.length != src2.length
.ArrayIndexOutOfBoundsException
- Ifdest != null && dest.length < src2.length
.IllegalArgumentException
- If the tensors do not have the same shape.
-
dispatch
public static double[] dispatch(double[] src1, double[] src2, double[] dest) Dynamically chooses and applies element-wise division algorithm to use based on the number of data in the tensors.- Parameters:
src1
- Entries of first tensor.src2
- Entries of second tensor.dest
- Array to store the result in.- Returns:
- If
dest != null
then a reference todest
is returned. Otherwise, a new array of appropriate size will be created and returned. - Throws:
IllegalArgumentException
- Ifsrc1.length != src2.length
.ArrayIndexOutOfBoundsException
- Ifdest != null && dest.length < src2.length
.IllegalArgumentException
- If the tensors do not have the same shape.
-