Package org.flag4j.operations.dense.real
Class AggregateDenseReal
java.lang.Object
org.flag4j.operations.dense.real.AggregateDenseReal
This class contains several low-level methods useful for computing aggregation operations on dense tensors.
-
Constructor Summary
-
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
argMin
(double[] entries) Computes the index of the minimum value in this tensor.
-
Constructor Details
-
AggregateDenseReal
private AggregateDenseReal()
-
-
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 entries 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 entries 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
entries
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
entries
which is equal tovalue
. If no such value exists, then -1 is returned.
-