Class AggregateDenseReal
java.lang.Object
org.flag4j.linalg.ops.dense.real.AggregateDenseReal
This class contains several low-level methods useful for computing aggregation ops on dense tensors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
argEq
(double[] entries, double value) Computes the index of the first entry in a tensor which is equal to the specifiedvalue
.static int
argEq
(int[] entries, int value) Computes the index of the first entry in a tensor which is equal to the specifiedvalue
.static int
argmax
(double[] entries) Computes the index of the maximum value in this tensor.static int
argmaxAbs
(double[] entries) Computes the index of the maximum absolute value in this tensor.static int
argmin
(double[] entries) Computes the index of the minimum value in this tensor.static int
argminAbs
(double[] entries) Computes the index of the minimum absolute value in this tensor.
-
Method Details
-
argmin
public static int argmin(double[] entries) Computes the index of the minimum value in this tensor. If the minimum value occurs at more than one index, the index of the first occurrence is taken.- Parameters:
entries
- Entries of the tensor.- Returns:
- The index of the minimum value in this tensor. If there are zero data in the array, -1 is returned.
-
argminAbs
public static int argminAbs(double[] entries) Computes the index of the minimum absolute value in this tensor. If the minimum absolute value occurs at more than one index, the index of the first occurrence is taken.- Parameters:
entries
- Entries of the tensor.- Returns:
- The index of the minimum absolute value in this tensor. If there are zero data in the array, -1 is returned.
-
argmax
public static int argmax(double[] entries) Computes the index of the maximum value in this tensor. If the maximum value occurs at more than one index, the index of the first occurrence is taken.- Parameters:
entries
- Entries of the tensor.- Returns:
- The index of the maximum value in this tensor. If there are zero data in the array, -1 is returned.
-
argmaxAbs
public static int argmaxAbs(double[] entries) Computes the index of the maximum absolute value in this tensor. If the maximum absolute value occurs at more than one index, the index of the first occurrence is taken.- Parameters:
entries
- Entries of the tensor.- Returns:
- The index of the maximum absolute value in this tensor. If there are zero data in the array, -1 is returned.
-
argEq
public static int argEq(double[] entries, double value) Computes the index of the first entry in a tensor which is equal to the specifiedvalue
.- Parameters:
entries
- Entries of this tensor.value
- Value to find index of.- Returns:
- The index of the first entry in
data
which is equal tovalue
. If no such value exists, then -1 is returned.
-
argEq
public static int argEq(int[] entries, int value) Computes the index of the first entry in a tensor which is equal to the specifiedvalue
.- Parameters:
entries
- Entries of this tensor.value
- Value to find index of.- Returns:
- The index of the first entry in
data
which is equal tovalue
. If no such value exists, then -1 is returned.
-