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

Conversion from IdentityMultiple to Diagonal #188

Open
mforets opened this issue Feb 23, 2020 · 1 comment
Open

Conversion from IdentityMultiple to Diagonal #188

mforets opened this issue Feb 23, 2020 · 1 comment

Comments

@mforets
Copy link
Member

mforets commented Feb 23, 2020

julia> convert(Matrix, I(2.0, 4))
4×4 Array{Float64,2}:
 2.0  0.0  0.0  0.0
 0.0  2.0  0.0  0.0
 0.0  0.0  2.0  0.0
 0.0  0.0  0.0  2.0

julia> using LinearAlgebra

julia> convert(Diagonal, I(2.0, 4))
ERROR: MethodError: Cannot `convert` an object of type IdentityMultiple{Float64} to an object of type Diagonal
Closest candidates are:
  convert(::Type{#s617} where #s617<:Diagonal, ::Union{LinearAlgebra.AbstractTriangular, Bidiagonal, Diagonal, SymTridiagonal, Tridiagonal}) at /buildworker/wor
ker/package_linux64/build/usr/share/julia/stdlib/v1.2/LinearAlgebra/src/special.jl:69
  convert(::Type{T<:AbstractArray}, ::T<:AbstractArray) where T<:AbstractArray at abstractarray.jl:14
  convert(::Type{T<:AbstractArray}, ::Factorization) where T<:AbstractArray at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LinearAlgeb
ra/src/factorization.jl:46
  ...
Stacktrace:
 [1] top-level scope at REPL[7]:1
@schillic
Copy link
Member

With #189 this is not needed.

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

No branches or pull requests

2 participants