@@ -128,25 +128,41 @@ end
128
128
end
129
129
end
130
130
131
- @testset " NaN in findmin/findmax/minimum/maximum " begin
131
+ @testset " NaN in findmin/findmax" begin
132
132
A = [1.0 NaN 6.0 ;
133
133
NaN 2.0 4.0 ]
134
134
A′ = [- 1.0 NaN - 6.0 ;
135
135
NaN - 2.0 4.0 ]
136
136
for (tup, rval, rind) in [((1 ,), [1.0 2.0 4.0 ], [CartesianIndex (1 ,1 ) CartesianIndex (2 ,2 ) CartesianIndex (2 ,3 )]),
137
137
((2 ,), reshape ([1.0 , 2.0 ], 2 , 1 ), reshape ([CartesianIndex (1 ,1 ),CartesianIndex (2 ,2 )], 2 , 1 )),
138
138
((1 ,2 ), fill (1.0 ,1 ,1 ),fill (CartesianIndex (1 ,1 ),1 ,1 ))]
139
- @test isequal (vfindmin1 (A, dims= tup), (rval, rind))
140
- @test isequal (vfindmin1 (abs, A′, dims= tup), (rval, rind))
139
+ @test isequal (vtfindmin1 (A, dims= tup), (rval, rind))
140
+ @test isequal (vtfindmin1 (abs, A′, dims= tup), (rval, rind))
141
+ end
142
+
143
+ for (tup, rval, rind) in [((1 ,), [1.0 2.0 6.0 ], [CartesianIndex (1 ,1 ) CartesianIndex (2 ,2 ) CartesianIndex (1 ,3 )]),
144
+ ((2 ,), reshape ([6.0 , 4.0 ], 2 , 1 ), reshape ([CartesianIndex (1 ,3 ),CartesianIndex (2 ,3 )], 2 , 1 )),
145
+ ((1 ,2 ), fill (6.0 ,1 ,1 ),fill (CartesianIndex (1 ,3 ),1 ,1 ))]
146
+ @test isequal (vtfindmax1 (A, dims= tup), (rval, rind))
147
+ @test isequal (vtfindmax1 (abs, A′, dims= tup), (rval, rind))
148
+ end
149
+ end
150
+
151
+ @testset " NaN in minimum/maximum" begin
152
+ A = [1.0 NaN 6.0 ;
153
+ NaN 2.0 4.0 ]
154
+ A′ = [- 1.0 NaN - 6.0 ;
155
+ NaN - 2.0 4.0 ]
156
+ for (tup, rval, rind) in [((1 ,), [NaN 2.0 4.0 ], [CartesianIndex (1 ,1 ) CartesianIndex (2 ,2 ) CartesianIndex (2 ,3 )]),
157
+ ((2 ,), reshape ([6.0 , 2.0 ], 2 , 1 ), reshape ([CartesianIndex (1 ,1 ),CartesianIndex (2 ,2 )], 2 , 1 )),
158
+ ((1 ,2 ), fill (1.0 ,1 ,1 ),fill (CartesianIndex (1 ,1 ),1 ,1 ))]
141
159
@test isequal (vtminimum (A, dims= tup), rval)
142
160
@test isequal (vtminimum (abs, A′, dims= tup), rval)
143
161
end
144
162
145
- for (tup, rval, rind) in [((1 ,), [1.0 2.0 6.0 ], [CartesianIndex (1 ,1 ) CartesianIndex (2 ,2 ) CartesianIndex (1 ,3 )]),
163
+ for (tup, rval, rind) in [((1 ,), [NaN 2.0 6.0 ], [CartesianIndex (1 ,1 ) CartesianIndex (2 ,2 ) CartesianIndex (1 ,3 )]),
146
164
((2 ,), reshape ([6.0 , 4.0 ], 2 , 1 ), reshape ([CartesianIndex (1 ,3 ),CartesianIndex (2 ,3 )], 2 , 1 )),
147
165
((1 ,2 ), fill (6.0 ,1 ,1 ),fill (CartesianIndex (1 ,3 ),1 ,1 ))]
148
- @test isequal (vfindmax1 (A, dims= tup), (rval, rind))
149
- @test isequal (vfindmax1 (abs, A′, dims= tup), (rval, rind))
150
166
@test isequal (vtmaximum (A, dims= tup), rval)
151
167
@test isequal (vtmaximum (abs, A′, dims= tup), rval)
152
168
end
0 commit comments