Skip to content
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

cholesky! does not modify MMatrix #1260

Open
mipals opened this issue Jun 7, 2024 · 0 comments
Open

cholesky! does not modify MMatrix #1260

mipals opened this issue Jun 7, 2024 · 0 comments

Comments

@mipals
Copy link

mipals commented Jun 7, 2024

I am fairly new to using StaticArrays, so I do not know if this is intended or not but it caught me by surprise as this is different behaviour when compared to the standard cholesky! functionality from LinearAlgebra. I believe the reason for this behaviour can be found in the following line

@inline LinearAlgebra._chol!(A::StaticMatrix, ::Type{UpperTriangular}) = (cholesky(A).U, 0)

which can be seen to return a new data.

MWE:

# Standard LinearAlgebra
S = Matrix(2.0I(3))
cholesky!(S)
S # S is changed

# StaticArrays
T = MMatrix{3,3,Float64,9}(2I(3))
cholesky!(T)
T # T has not changed
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