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

Separate parent matrix type from Cholesky parameter #207

Closed
wants to merge 1 commit into from

Conversation

jishnub
Copy link
Contributor

@jishnub jishnub commented Jul 26, 2024

This adds an extra type parameter to PDMat corresponding to the parent matrix type. This lets the PDMat constructor succeed even if the parent type doesn't match those of the Cholesky factors. E.g. the following works after this:

julia> S = SymTridiagonal(fill(4,4), fill(1,3))
4×4 SymTridiagonal{Int64, Vector{Int64}}:
 4  1    
 1  4  1  
   1  4  1
     1  4

julia> PDMat(S)
4×4 PDMat{Float64, Bidiagonal{Float64, Vector{Float64}}, SymTridiagonal{Float64, Vector{Float64}}}:
 4.0  1.0  0.0  0.0
 1.0  4.0  1.0  0.0
 0.0  1.0  4.0  1.0
 0.0  0.0  1.0  4.0

where the Cholesky factors are Bidiagonal, but the parent is a SymTridiagonal.

@andreasnoack
Copy link
Member

Thanks. I'm wondering if this susggests that https://github.com/JuliaLang/julia/blob/197295c84aab217bffde01a4339f1d0e8e95fb98/stdlib/LinearAlgebra/src/tridiag.jl#L957 should use SymTridiagonal instead of Bidiagonal.

@devmotion
Copy link
Member

Is this issue fixed by #188? I think if we make a breaking change to the type structure, we should also address the other problems covered by #188 at the same time.

devmotion added a commit that referenced this pull request Aug 5, 2024
@devmotion
Copy link
Member

I just checked and the example is indeed fixed by #188. I added the test in this PR to #188.

@jishnub
Copy link
Contributor Author

jishnub commented Aug 5, 2024

Thanks, I'll close this in favor of that PR

@jishnub jishnub closed this Aug 5, 2024
@jishnub jishnub deleted the jishnub/matrixtype branch August 5, 2024 10:58
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

Successfully merging this pull request may close these issues.

3 participants