Skip to content

inverse of symmetric matrix is not guaranteed to be symmetric #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
imLew opened this issue Mar 6, 2021 · 1 comment
Closed

inverse of symmetric matrix is not guaranteed to be symmetric #72

imLew opened this issue Mar 6, 2021 · 1 comment

Comments

@imLew
Copy link

imLew commented Mar 6, 2021

Is this the right place for issues with LinearAlgebra.jl
Here is an MWE

while true
    R = randn((3,3))
    R[2,1] = R[1,2]; R[3,1] = R[1,3]; R[2,3]=R[3,2]
    @assert R == R'
    @assert inv(R) == inv(R)'
end
@imLew
Copy link
Author

imLew commented Mar 6, 2021

I learned that the way to deal with this is to tell inv() that it is a symmetric matrix by passing it to Symmetric() first.
This was an annoying bug to hunt down so I'm inclined to suggest the inv() function should check for symmetry, but then again I don't know how much overhead that would introduce.

@imLew imLew closed this as completed Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant