Skip to content

Commit

Permalink
Reduce number of test combinations in test/triangular.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored and KristofferC committed Nov 28, 2024
1 parent ff78c38 commit 424c350
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ Base.getindex(A::MyTriangular, i::Int, j::Int) = A.data[i,j]

# Begin loop for second Triangular matrix
@testset for elty2 in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}, Int)
# Only test methods for the same element type and a single combination of mixed element types
# to avoid too much compilation
if !(elty1 == elty2 || elty1 (ComplexF32, Int) || elty1 (ComplexF32, Int))
continue
end
@testset for (t2, uplo2) in ((UpperTriangular, :U),
(UnitUpperTriangular, :U),
(LowerTriangular, :L),
Expand Down Expand Up @@ -438,6 +443,12 @@ Base.getindex(A::MyTriangular, i::Int, j::Int) = A.data[i,j]
end

for eltyB in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat})
# Only test methods for the same element type and a single combination of mixed element types
# to avoid too much compilation
if !(elty1 == eltyB || elty1 (ComplexF32, Int) || eltyB (ComplexF32, Int))
continue
end

B = convert(Matrix{eltyB}, (elty1 <: Complex ? real(A1) : A1)*fill(1., n, n))

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

0 comments on commit 424c350

Please sign in to comment.