Skip to content

Commit

Permalink
Make test tolerance dependent on condition number in Bunch-Kaufman test
Browse files Browse the repository at this point in the history
Fixes #25096
  • Loading branch information
andreasnoack committed Dec 15, 2017
1 parent 5e1418b commit 6130eee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/linalg/bunchkaufman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ a2img = randn(n,n)/2
breal = randn(n,2)/2
bimg = randn(n,2)/2

@testset "$eltya argument A" for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int)
@testset "$eltya argument A" for eltya in (Float32, Float64, Complex64, Complex128, Int)
a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal)
a2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real)
asym = a.'+ a # symmetric indefinite
Expand Down Expand Up @@ -71,7 +71,7 @@ bimg = randn(n,2)/2
end
end

@testset "$eltyb argument B" for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int)
@testset "$eltyb argument B" for eltyb in (Float32, Float64, Complex64, Complex128, Int)
b = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal)
for b in (b, view(b, 1:n, 1:2))
εb = eps(abs(float(one(eltyb))))
Expand All @@ -95,7 +95,7 @@ bimg = randn(n,2)/2
@test logabsdet(bc2)[1] log(abs(det(bc2)))
@test logabsdet(bc2)[2] == sign(det(bc2))
@test inv(bc2)*apd Matrix(I, n, n)
@test apd*(bc2\b) b atol=150000ε
@test apd*(bc2\b) b rtol=eps(cond(apd))
@test ishermitian(bc2) == !issymmetric(bc2)
end
end
Expand Down Expand Up @@ -130,7 +130,7 @@ end
@testset "test example due to @timholy in PR 15354" begin
A = rand(6,5); A = complex(A'*A) # to avoid calling the real-lhs-complex-rhs method
F = cholfact(A);
v6 = rand(ComplexF64, 6)
v6 = rand(Complex128, 6)
v5 = view(v6, 1:5)
@test F\v5 == F\v6[1:5]
end
Expand Down

0 comments on commit 6130eee

Please sign in to comment.