Skip to content

Commit e7da19f

Browse files
authored
Fix LAPACK.posv! tests (#1192)
The test failures are, unsurprisingly, related to high condition numbers, as can be seen from running the tests many times in a loop and displaying the condition number. We could set an appropriate relative tolerance in the test below, or find a random seed that works. I tried the second option here.
2 parents c9ad828 + 5c9cebd commit e7da19f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/lapack.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -676,13 +676,13 @@ end
676676
@testset "posv and some errors for friends" begin
677677
@testset for elty in (Float32, Float64, ComplexF32, ComplexF64)
678678
local n = 10
679-
A = randn(elty,n,n)
680-
A = A'*A
681-
B = rand(elty,n,n)
679+
a = randn(elty, n, n)
680+
A = a'*a
681+
B = rand(elty, n, n)
682682
D = copy(A)
683683
C = copy(B)
684-
D,C = LAPACK.posv!('U',D,C)
685-
@test A\B C
684+
D, C = LAPACK.posv!('U', D, C)
685+
@test A\B C rtol=cond(A)*eps(real(elty))
686686
offsizemat = Matrix{elty}(undef, n+1, n+1)
687687
@test_throws DimensionMismatch LAPACK.posv!('U', D, offsizemat)
688688
@test_throws DimensionMismatch LAPACK.potrs!('U', D, offsizemat)

0 commit comments

Comments
 (0)