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 fails for Hermitian{.., Diagonal} #44053

Closed
baggepinnen opened this issue Feb 6, 2022 · 1 comment · Fixed by #44076
Closed

Cholesky fails for Hermitian{.., Diagonal} #44053

baggepinnen opened this issue Feb 6, 2022 · 1 comment · Fixed by #44076
Labels
linear algebra Linear algebra

Comments

@baggepinnen
Copy link
Contributor

There appears to be some missing method that handles Hermitian/Symmetric wrappers around special matrices.

julia> cholesky((1.0I(3)))
Cholesky{Float64, Diagonal{Float64, Vector{Float64}}}
U factor:
3×3 Diagonal{Float64, Vector{Float64}}:
 1.0        
     1.0    
         1.0

julia> cholesky(Hermitian(1.0I(3)))
ERROR: MethodError: no method matching cholesky(::Hermitian{Float64, Diagonal{Float64, Vector{Float64}}})

julia> cholesky(Symmetric(1.0I(3)))
ERROR: MethodError: no method matching cholesky(::Symmetric{Float64, Diagonal{Float64, Vector{Float64}}})

I assume the pattern cholesky(Hermitian(Σ)), i.e., automatically wrapping symmetric matrices in a Hermitian wrapper is quite common, so it would be great if it worked for all AbstractMatrix.

Tested on Julia v1.7.1

@dkarrasch
Copy link
Member

The simplest solution is perhaps to remove the restriction to StridedMatrixs in out-of-place cholesky methods that form a cholcopy anyway, and make that cholcopy form a mutable copy via 3-arg similar, and specialize some structured matrix types to improve memory consumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants