Skip to content

Commit

Permalink
LinearAlgebra: use
Browse files Browse the repository at this point in the history
After investigating #54090, I found that the issue was
not caused by the effects of `checksquare`, but by the use of the
`@simd` macro within `tr(::Matrix)`:
https://github.com/JuliaLang/julia/blob/0945b9d7740855c82a09fed42fbf6bc561e02c77/stdlib/LinearAlgebra/src/dense.jl#L373-L380

While simply removing the `@simd` macro was considered, the strict
left-to-right summation without `@simd` otherwise is not necessarily
more accurate, so I concluded that the problem lies in the test code,
which tests the (strict) equality of two different `tr` execution
results. I have modified the test code to use `≈` instead of `==`.

- fixes #54090
  • Loading branch information
aviatesk committed Jul 16, 2024
1 parent 0945b9d commit 326ec72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/LinearAlgebra/test/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ end

@testset "linalg unary ops" begin
@testset "tr" begin
@test tr(asym) == tr(Symmetric(asym))
@test tr(aherm) == tr(Hermitian(aherm))
@test tr(asym) tr(Symmetric(asym))
@test tr(aherm) tr(Hermitian(aherm))
end

@testset "isposdef[!]" begin
Expand Down

0 comments on commit 326ec72

Please sign in to comment.