-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
ARPACK error in eigs #424
Comments
Did this start happening recently? |
Happens on 0.5 too. |
It doesn't like 2x2 matrices: julia> eigs(randn(2,2), eye(2,2); nev=1)
ERROR: ArgumentError: input matrix A is too small. Use eigfact instead.
Stacktrace:
[1] #_eigs#91(::Int64, ::Int64, ::Symbol, ::Float64, ::Int64, ::Void, ::Array{Float64,1}, ::Bool, ::Base.LinAlg.#_eigs, ::Array{Float64,2}, ::Array{Float64,2}) at ./linalg/arnoldi.jl:184
[2] (::Base.LinAlg.#kw##_eigs)(::Array{Any,1}, ::Base.LinAlg.#_eigs, ::Array{Float64,2}, ::Array{Float64,2}) at ./<missing>:0
[3] #eigs#85(::Array{Any,1}, ::Function, ::Array{Float64,2}, ::Array{Float64,2}) at ./linalg/arnoldi.jl:93
[4] (::Base.LinAlg.#kw##eigs)(::Array{Any,1}, ::Base.LinAlg.#eigs, ::Array{Float64,2}, ::Array{Float64,2}) at ./<missing>:0 Not sure why |
(In a quick benchmark, it seems that for anything smaller than 20x20 we'd be better off calling |
IIRC ARPACK's input doesn't quite work out for these tiny matrices. We should probably just discourage it's use on the small ones. 20x20 seems like a good threshold. |
It can be reproduced for much larger matrices, e.g. julia> LinAlg.eigs(ones(2000,2000), eye(2000); nev=1)
ERROR: LinAlg.ARPACKException("unspecified ARPACK error: -9999")
Stacktrace:
[1] aupd_wrapper(::Type{T} where T, ::LinAlg.#matvecA!#98{Array{Float64,2}}, ::LinAlg.##95#102{Array{Float64,2}}, ::LinAlg.##96#103, ::Int64, ::Bool, ::Bool, ::String, ::Int64, ::Int64, ::String, ::Float64, ::Int64, ::Int64, ::Array{Float64,1}) at /Users/andreasnoack/julia-dev/base/linalg/arpack.jl:53
[2] #_eigs#91(::Int64, ::Int64, ::Symbol, ::Float64, ::Int64, ::Void, ::Array{Float64,1}, ::Bool, ::LinAlg.#_eigs, ::Array{Float64,2}, ::Array{Float64,2}) at /Users/andreasnoack/julia-dev/base/linalg/arnoldi.jl:286
[3] (::LinAlg.#kw##_eigs)(::Array{Any,1}, ::LinAlg.#_eigs, ::Array{Float64,2}, ::Array{Float64,2}) at ./<missing>:0
[4] #eigs#85(::Array{Any,1}, ::Function, ::Array{Float64,2}, ::Array{Float64,2}) at /Users/andreasnoack/julia-dev/base/linalg/arnoldi.jl:93
[5] (::LinAlg.#kw##eigs)(::Array{Any,1}, ::LinAlg.#eigs, ::Array{Float64,2}, ::Array{Float64,2}) at ./<missing>:0 but it is still looks like a corner of a corner case since it seems to require that julia> eigs(ones(2,2), nev = 1)
([2.0], [0.707107; 0.707107], 1, 1, 2, [0.0, 0.0])
julia> eigs(ones(2,2) + eps()*randn(2,2), eye(2), nev = 1)
([2.0], [0.707107; 0.707107], 1, 1, 3, [0.0, 0.0])
julia> eigs(ones(2,2), diagm([1.0, nextfloat(1.0)]), nev = 1)
([2.0], [0.707107; 0.707107], 1, 1, 5, [0.0, 0.0]) So it is probably an issue with ARPACK. I think the right fix is to fix #354. |
Actually, it is a duplicate of #354 |
The text was updated successfully, but these errors were encountered: