Open MikaelSlevinsky opened 3 years ago
As a side-issue, the infinite Diagonal
doesn't show the block structure.
@dlfivefifty (I guess you should just watch your own repository?)
Looks like a missing convert for Diagonal
. We can add it to ArrayLayouts.jl for all LayoutVector
Can you try adding
Base.convert(::Type{<:Diagonal{<:Any,AV}}, D::Diagonal) where AV<:LayoutVector = Diagonal(convert(AV, D.diag))
These things should be in Base as well but are not
julia> convert(Diagonal{Float64,Vector{Float64}}, Diagonal(1:5))
ERROR: MethodError: no method matching Vector{Float64}(::Diagonal{Int64, UnitRange{Int64}})
Closest candidates are:
Array{T, N}(::AbstractArray{S, N}) where {T, N, S} at array.jl:540
Vector{T}() where T at boot.jl:467
Vector{T}(::SuiteSparse.CHOLMOD.Dense{T}) where T at /Users/solver/Projects/julia-1.6/usr/share/julia/stdlib/v1.6/SuiteSparse/src/cholmod.jl:991
...
Stacktrace:
[1] convert(#unused#::Type{Vector{Float64}}, a::Diagonal{Int64, UnitRange{Int64}})
@ Base ./array.jl:532
[2] Diagonal{Float64, Vector{Float64}}(diag::Diagonal{Int64, UnitRange{Int64}})
@ LinearAlgebra ~/Projects/julia-1.6/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/diagonal.jl:10
[3] convert(T::Type{Diagonal{Float64, Vector{Float64}}}, m::Diagonal{Int64, UnitRange{Int64}})
@ LinearAlgebra ~/Projects/julia-1.6/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/special.jl:53
[4] top-level scope
@ REPL[3]:1
It's actually a known issue: https://github.com/JuliaLang/julia/issues/29054