@@ -877,11 +877,12 @@ end
877
877
"""
878
878
findmax(f, domain) -> (f(x), index)
879
879
880
- Return a pair of a value in the codomain (outputs of `f`) and the index of
880
+ Return a pair of a value in the codomain (outputs of `f`) and the index or key of
881
881
the corresponding value in the `domain` (inputs to `f`) such that `f(x)` is maximised.
882
882
If there are multiple maximal points, then the first one will be returned.
883
883
884
- `domain` must be a non-empty iterable.
884
+ `domain` must be a non-empty iterable supporting [`keys`](@ref). Indices
885
+ are of the same type as those returned by [`keys(domain)`](@ref).
885
886
886
887
Values are compared with `isless`.
887
888
@@ -915,6 +916,9 @@ Return the maximal element of the collection `itr` and its index or key.
915
916
If there are multiple maximal elements, then the first one will be returned.
916
917
Values are compared with `isless`.
917
918
919
+ Indices are of the same type as those returned by [`keys(itr)`](@ref)
920
+ and [`pairs(itr)`](@ref).
921
+
918
922
See also: [`findmin`](@ref), [`argmax`](@ref), [`maximum`](@ref).
919
923
920
924
# Examples
@@ -936,12 +940,15 @@ _findmax(a, ::Colon) = findmax(identity, a)
936
940
"""
937
941
findmin(f, domain) -> (f(x), index)
938
942
939
- Return a pair of a value in the codomain (outputs of `f`) and the index of
943
+ Return a pair of a value in the codomain (outputs of `f`) and the index or key of
940
944
the corresponding value in the `domain` (inputs to `f`) such that `f(x)` is minimised.
941
945
If there are multiple minimal points, then the first one will be returned.
942
946
943
947
`domain` must be a non-empty iterable.
944
948
949
+ Indices are of the same type as those returned by [`keys(domain)`](@ref)
950
+ and [`pairs(domain)`](@ref).
951
+
945
952
`NaN` is treated as less than all other values except `missing`.
946
953
947
954
!!! compat "Julia 1.7"
@@ -975,6 +982,9 @@ Return the minimal element of the collection `itr` and its index or key.
975
982
If there are multiple minimal elements, then the first one will be returned.
976
983
`NaN` is treated as less than all other values except `missing`.
977
984
985
+ Indices are of the same type as those returned by [`keys(itr)`](@ref)
986
+ and [`pairs(itr)`](@ref).
987
+
978
988
See also: [`findmax`](@ref), [`argmin`](@ref), [`minimum`](@ref).
979
989
980
990
# Examples
@@ -1027,6 +1037,9 @@ If there are multiple maximal elements, then the first one will be returned.
1027
1037
1028
1038
The collection must not be empty.
1029
1039
1040
+ Indices are of the same type as those returned by [`keys(itr)`](@ref)
1041
+ and [`pairs(itr)`](@ref).
1042
+
1030
1043
Values are compared with `isless`.
1031
1044
1032
1045
See also: [`argmin`](@ref), [`findmax`](@ref).
@@ -1082,6 +1095,9 @@ If there are multiple minimal elements, then the first one will be returned.
1082
1095
1083
1096
The collection must not be empty.
1084
1097
1098
+ Indices are of the same type as those returned by [`keys(itr)`](@ref)
1099
+ and [`pairs(itr)`](@ref).
1100
+
1085
1101
`NaN` is treated as less than all other values except `missing`.
1086
1102
1087
1103
See also: [`argmax`](@ref), [`findmin`](@ref).
0 commit comments