Looking to solve a generalized eigenproblem. All is well here:
julia> A = rand(4,4);
julia> B = rand(4,4);
julia> eigen(A,B)
GeneralizedEigen{Complex{Float64},Complex{Float64},Array{Complex{Float64},2},Array{Complex{Float64},1}}
eigenvalues:
4-element Array{Complex{Float64},1}:
-1.7837186962342586 + 0.0im
-0.24734999477221975 - 0.3007940273651078im
...
But then I ran into this:
julia> B = Diagonal(1:4);
julia> eigen(A,B)
ERROR: MethodError: no method matching eigen!(::Array{Float64,2}, ::Diagonal{Float64,Array{Float64,1}})
Closest candidates are:
...
An explicit cast to a matrix makes it all better:
julia> eigen(A,Matrix(B))
GeneralizedEigen{Float64,Float64,Array{Float64,2},Array{Float64,1}}
eigenvalues:
4-element Array{Float64,1}:
-0.009056339130226663
0.14327387286591
...
But I expected the original to work, given that
julia> B isa AbstractMatrix
true
and eigen(B)
is fine, too. So is this the intended behavior?