Skip to content

Commit 38f70e2

Browse files
andreasnoackKristofferC
authored and
KristofferC
committed
Reduce number of test combinations in test/triangular.jl (#1123)
(cherry picked from commit aecb714)
1 parent b790783 commit 38f70e2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/triangular.jl

+9-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ Base.getindex(A::MyTriangular, i::Int, j::Int) = A.data[i,j]
349349
(UnitUpperTriangular, :U),
350350
(LowerTriangular, :L),
351351
(UnitLowerTriangular, :L))
352-
352+
if !(elty1 == elty2 || elty1 (ComplexF32, Int) || elty1 (ComplexF32, Int))
353+
continue
354+
end
353355
debug && println("elty1: $elty1, A1: $t1, elty2: $elty2, A2: $t2")
354356

355357
A2 = t2(elty2 == Int ? rand(1:7, n, n) : convert(Matrix{elty2}, (elty2 <: Complex ? complex.(randn(n, n), randn(n, n)) : randn(n, n)) |> t -> cholesky(t't).U |> t -> uplo2 === :U ? t : copy(t')))
@@ -436,6 +438,12 @@ Base.getindex(A::MyTriangular, i::Int, j::Int) = A.data[i,j]
436438
end
437439

438440
for eltyB in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat})
441+
# Only test methods for the same element type and a single combination of mixed element types
442+
# to avoid too much compilation
443+
if !(elty1 == eltyB || elty1 (ComplexF32, Int) || eltyB (ComplexF32, Int))
444+
continue
445+
end
446+
439447
B = convert(Matrix{eltyB}, (elty1 <: Complex ? real(A1) : A1)*fill(1., n, n))
440448

441449
debug && println("elty1: $elty1, A1: $t1, B: $eltyB")

0 commit comments

Comments
 (0)