Class CompareSemiring
java.lang.Object
org.flag4j.linalg.ops.common.semiring_ops.CompareSemiring
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Semiring<T>>
intargmax
(T... values) Computes the index of the maximum value in the specified array.static <T extends Semiring<T>>
intargmin
(T... values) Computes the index of the minimum value in the specified array.static <T extends Semiring<T>>
Tmax
(T... values) Computes the maximum value in the specified array.static <T extends Semiring<T>>
Tmin
(T... values) Computes the minimum value in the specified array.
-
Method Details
-
max
Computes the maximum value in the specified array. This is done according to the ordering imposed byinvalid reference
Field#compareTo(Field)
- Parameters:
values
- Values to commute maximum of.- Returns:
- The maximum value in
values
. Ifvalues.length
equals zero, thennull
is returned.
-
min
Computes the minimum value in the specified array. This is done according to the ordering imposed byinvalid reference
Field#compareTo(Field)
- Parameters:
values
- Values to commute minimum of.- Returns:
- The minimum value in
values
. Ifvalues.length
equals zero, thennull
is returned.
-
argmax
Computes the index of the maximum value in the specified array. This is done according to the ordering imposed bySemiring.compareTo(Semiring)
.- Parameters:
values
- Values for which compute index of maximum value.- Returns:
- The index of the maximum value in
values
. If the maximum value occurs more than once, the index of the first occurrence is returned. Ifvalues.length
equals zero, then-1
is returned.
-
argmin
Computes the index of the minimum value in the specified array. This is done according to the ordering imposed bySemiring.compareTo(Semiring)
.- Parameters:
values
- Values for which compute index of the minimum value.- Returns:
- The index of the minimum value in
values
. If the minimum value occurs more than once, the index of the first occurrence is returned. Ifvalues.length
equals zero, then-1
is returned.
-