-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cannot square an infinite Diagonal? #38
Comments
As a side-issue, the infinite |
@dlfivefifty (I guess you should just watch your own repository?) |
Looks like a missing convert for |
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: JuliaLang/LinearAlgebra.jl#564 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: