Skip to content

Commit 63aeb4a

Browse files
committed
Revert "Select types randomly"
This reverts commit d8530d7.
1 parent d8530d7 commit 63aeb4a

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

test/testtriag.jl

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3-
function rand_except(elty2_list, elty1)
4-
v = copy(elty2_list)
5-
ind_match = findfirst(==(elty1), v)
6-
if !isnothing(ind_match)
7-
deleteat!(v, ind_match)
8-
end
9-
rand(v)
10-
end
11-
123
# The following test block tries to call all methods in base/linalg/triangular.jl in order for a combination of input element types. Keep the ordering when adding code.
134
function test_triangular(elty1_types)
145
n = 9
@@ -323,10 +314,12 @@ function test_triangular(elty1_types)
323314
@test ((A1 \ A1)::t1) M1 \ M1
324315

325316
# Begin loop for second Triangular matrix
326-
# Only test methods for the same element type and a single combination of mixed element types
327-
# to avoid too much compilation
328-
elty2_list = [Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}, Int]
329-
@testset for elty2 in (elty1, rand_except(elty2_list, elty1))
317+
@testset for elty2 in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}, Int)
318+
# Only test methods for the same element type and a single combination of mixed element types
319+
# to avoid too much compilation
320+
if !(elty1 == elty2 || elty1 (ComplexF32, Int) || elty2 (ComplexF32, Int))
321+
continue
322+
end
330323
@testset for (t2, uplo2) in ((UpperTriangular, :U),
331324
(UnitUpperTriangular, :U),
332325
(LowerTriangular, :L),
@@ -416,10 +409,13 @@ function test_triangular(elty1_types)
416409
end
417410
end
418411

419-
# Only test methods for the same element type and a single combination of mixed element types
420-
# to avoid too much compilation
421-
eltyB_list = [Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}]
422-
@testset for eltyB in (elty1, rand_except(eltyB_list, elty1))
412+
@testset for eltyB in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat})
413+
# Only test methods for the same element type and a single combination of mixed element types
414+
# to avoid too much compilation
415+
if !(elty1 == eltyB || elty1 (ComplexF32, Int) || eltyB (ComplexF32, Int))
416+
continue
417+
end
418+
423419
B = convert(Matrix{eltyB}, (elty1 <: Complex ? real(A1) : A1) * fill(1.0, n, n))
424420

425421
Tri = Tridiagonal(rand(eltyB, n - 1), rand(eltyB, n), rand(eltyB, n - 1))

0 commit comments

Comments
 (0)