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(BlockDiagonal(Diagonal)) is broken #109

Closed
mzgubic opened this issue Jul 1, 2022 · 0 comments · Fixed by #110
Closed

cholesky(BlockDiagonal(Diagonal)) is broken #109

mzgubic opened this issue Jul 1, 2022 · 0 comments · Fixed by #110
Labels
bug Something isn't working

Comments

@mzgubic
Copy link
Collaborator

mzgubic commented Jul 1, 2022

In #106 we didn't think we'd need this (because why not just use Diagonal rather than BlockDiagonal(Diagonal)), but it came up in one of the nightly tests. Since we can support it relatively easily, I suggest we do

julia> s1 = BlockDiagonal([Diagonal(rand(5))])
5×5 BlockDiagonal{Float64, Diagonal{Float64, Vector{Float64}}}:
 0.373779  0.0       0.0       0.0       0.0
 0.0       0.315302  0.0       0.0       0.0
 0.0       0.0       0.266955  0.0       0.0
 0.0       0.0       0.0       0.686252  0.0
 0.0       0.0       0.0       0.0       0.0014181

julia> cholesky(s1)
ERROR: MethodError: no method matching BlockDiagonal(::Vector{Vector{Float64}})
Closest candidates are:
  BlockDiagonal(::BlockDiagonal) at ~/JuliaEnvs/GPForecasting.jl/dev/BlockDiagonals/src/blockdiagonal.jl:20
  BlockDiagonal(::Vector{V}) where {T, V<:AbstractMatrix{T}} at ~/JuliaEnvs/GPForecasting.jl/dev/BlockDiagonals/src/blockdiagonal.jl:16
Stacktrace:
 [1] cholesky(B::BlockDiagonal{Float64, Diagonal{Float64, Vector{Float64}}})
   @ BlockDiagonals ~/JuliaEnvs/GPForecasting.jl/dev/BlockDiagonals/src/linalg.jl:108
 [2] top-level scope
   @ REPL[80]:1
@mzgubic mzgubic added the bug Something isn't working label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant