File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -141,21 +141,21 @@ Returns the largest element of a tuple
141
141
142
142
143
143
"""
144
- indmin (t::Tuple)
144
+ argmin (t::Tuple)
145
145
146
146
Returns the index of the minimum element in a tuple. If there are multiple
147
147
minimal elements, then the first one will be returned.
148
148
"""
149
- indmin (t:: Tuple ) = findmin (t)[2 ]
149
+ argmin (t:: Tuple ) = findmin (t)[2 ]
150
150
151
151
152
152
"""
153
- indmax (t::Tuple)
153
+ argmax (t::Tuple)
154
154
155
155
Returns the index of the maximum element in a tuple. If there are multiple
156
156
minimal elements, then the first one will be returned.
157
157
"""
158
- indmax (t:: Tuple ) = findmax (t)[2 ]
158
+ argmax (t:: Tuple ) = findmax (t)[2 ]
159
159
160
160
"""
161
161
findmin(t::Tuple)
Original file line number Diff line number Diff line change 1
1
if VERSION < v " 0.7.0-DEV.2005"
2
2
const Test = Base. Test
3
3
end
4
+ if VERSION >= v " 0.7.0-DEV.3406"
5
+ using Random
6
+ end
7
+ if VERSION < v " 0.7.0-DEV.3516"
8
+ const argmin = Base. indmin
9
+ const argmax = Base. indmax
10
+ end
4
11
5
12
using Test
6
13
using TupleTools
@@ -35,10 +42,12 @@ i = rand(1:n)
35
42
@test @inferred (TupleTools. findmax (t)) == findmax (t)
36
43
@test @inferred (TupleTools. minimum (t)) == minimum (t)
37
44
@test @inferred (TupleTools. maximum (t)) == maximum (t)
38
- @test @inferred (TupleTools. indmin (t)) == indmin (t)
39
- @test @inferred (TupleTools. indmax (t)) == indmax (t)
45
+ @test @inferred (TupleTools. argmin (t)) == argmin (t)
46
+ @test @inferred (TupleTools. argmax (t)) == argmax (t)
40
47
41
48
@test @inferred (TupleTools. sort (t; rev = true )) == (sort (p; rev = true )... ,)
42
49
@test @inferred (TupleTools. sortperm (t)) == (sortperm (p)... ,)
43
50
@test @inferred (TupleTools. invperm (t)) == (ip... ,)
51
+ @test @inferred (TupleTools. isperm (t)) == true
52
+ @test @inferred (TupleTools. isperm ((1 ,2 ,1 ))) == false
44
53
@test @inferred (TupleTools. permute (t, t)) == (p[p]. .. ,)
You can’t perform that action at this time.
0 commit comments