Skip to content

Commit

Permalink
Fix LAPACK.posv! tests (#1192)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ViralBShah authored Feb 3, 2025
2 parents c9ad828 + 5c9cebd commit e7da19f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,13 @@ end
@testset "posv and some errors for friends" begin
@testset for elty in (Float32, Float64, ComplexF32, ComplexF64)
local n = 10
A = randn(elty,n,n)
A = A'*A
B = rand(elty,n,n)
a = randn(elty, n, n)
A = a'*a
B = rand(elty, n, n)
D = copy(A)
C = copy(B)
D,C = LAPACK.posv!('U',D,C)
@test A\B C
D, C = LAPACK.posv!('U', D, C)
@test A\B C rtol=cond(A)*eps(real(elty))
offsizemat = Matrix{elty}(undef, n+1, n+1)
@test_throws DimensionMismatch LAPACK.posv!('U', D, offsizemat)
@test_throws DimensionMismatch LAPACK.potrs!('U', D, offsizemat)
Expand Down

0 comments on commit e7da19f

Please sign in to comment.