So, this works (calling with usual complex array):
julia> H = convert.(Complex128, Hermitian(rand(3,3)))
3×3 Array{Complex{Float64},2}:
0.0816049+0.0im 0.414275+0.0im 0.598706+0.0im
0.414275+0.0im 0.512361+0.0im 0.295375+0.0im
0.598706+0.0im 0.295375+0.0im 0.995971+0.0im
julia> Base.LinAlg.LAPACK.syev!('N', 'L', H)
3-element Array{Float64,1}:
-0.298891
0.386473
1.50236
However, this (unsuprisingly but maybe also unconveniently) doesn’t (calling with a ::Hermitian
):
julia> H = Hermitian(convert.(Complex128, Hermitian(rand(3,3))))
3×3 Hermitian{Complex{Float64},Array{Complex{Float64},2}}:
0.122402-0.0im 0.46566+0.0im 0.465734+0.0im
0.46566-0.0im 0.296259-0.0im 0.090323+0.0im
0.465734-0.0im 0.090323-0.0im 0.722005-0.0im
julia> Base.LinAlg.LAPACK.syev!('N', 'L', H)
ERROR: MethodError: no method matching syev!(::Char, ::Char, ::Hermitian{Complex{Float64},Array{Complex{Float64},2}})
Closest candidates are:
syev!(::Char, ::Char, ::Union{Base.ReshapedArray{Float64,2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{DenseArray, SubArray{T,N,P,I,true} where I<:Tuple{Union{Base.Slice, UnitRange},Vararg{Any,N} where N} where P where N where T}, DenseArray{Float64,2}, SubArray{Float64,2,A,I,L} where L} where I<:Tuple{Vararg{Union{Base.AbstractCartesianIndex, Int64, Range{Int64}},N} where N} where A<:Union{Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{DenseArray, SubArray{T,N,P,I,true} where I<:Tuple{Union{Base.Slice, UnitRange},Vararg{Any,N} where N} where P where N where T} where N where T, DenseArray}) at linalg\lapack.jl:4785
syev!(::Char, ::Char, ::Union{Base.ReshapedArray{Float32,2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{DenseArray, SubArray{T,N,P,I,true} where I<:Tuple{Union{Base.Slice, UnitRange},Vararg{Any,N} where N} where P where N where T}, DenseArray{Float32,2}, SubArray{Float32,2,A,I,L} where L} where I<:Tuple{Vararg{Union{Base.AbstractCartesianIndex, Int64, Range{Int64}},N} where N} where A<:Union{Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{DenseArray, SubArray{T,N,P,I,true} where I<:Tuple{Union{Base.Slice, UnitRange},Vararg{Any,N} where N} where P where N where T} where N where T, DenseArray}) at linalg\lapack.jl:4785
syev!(::Char, ::Char, ::Union{Base.ReshapedArray{Complex{Float64},2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{DenseArray, SubArray{T,N,P,I,true} where I<:Tuple{Union{Base.Slice, UnitRange},Vararg{Any,N} where N} where P where N where T}, DenseArray{Complex{Float64},2}, SubArray{Complex{Float64},2,A,I,L} where L} where I<:Tuple{Vararg{Union{Base.AbstractCartesianIndex, Int64, Range{Int64}},N} where N} where A<:Union{Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{DenseArray, SubArray{T,N,P,I,true} where I<:Tuple{Union{Base.Slice, UnitRange},Vararg{Any,N} where N} where P where N where T} where N where T, DenseArray}) at linalg\lapack.jl:4929
...
- Is there a way to test if ZHEEV is actually called?
- Should the documentation be adjusted? (A Hermitian matrix is, of course, also symmetric, so the doc isn’t wrong but maybe misleading)
- Should the second example also work (i.e. add more methods)?
- Why not make ZHEEV and others explicitly available as
Base.LinAlg.LAPACK.zheev
?