-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Some promotion and error reporting fixes for eigs #13778
Conversation
5ffdf65
to
fa006bc
Compare
Some promotion and error reporting fixes for eigs
@@ -11,7 +11,18 @@ type LAPACKException <: Exception | |||
end | |||
|
|||
type ARPACKException <: Exception | |||
info::BlasInt | |||
info::ByteString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is technically breaking and iffy to backport
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That's true. We could backport the promotion commit only, or assume that nobody relies on the internals of ARPACKException
which is probably a safe assumption. They are thrown very rarely because we capture most of the errors with checks before calling ARPACK.
I don't think anyone relies on the internals of ARPACKException. Let's backport it - since it is a significantly better experience. |
eigs(A::AbstractMatrix{BigFloat}, B::AbstractMatrix...; kwargs...) = throw(MethodError(eigs, Any[A,B,kwargs...])) | ||
eigs(A::AbstractMatrix{BigFloat}, B::UniformScaling; kwargs...) = throw(MethodError(eigs, Any[A,B,kwargs...])) | ||
function eigs{T}(A::AbstractMatrix{T}, ::UniformScaling; kwargs...) | ||
Tnew = typeof(zero(T)/sqrt(one(T))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should just define float(T)
, or AbstractFloat(T)
as suggested in #13445. I hate this kind of typeof
construction.
float(T::Type) = typeof(float(zero(T)))
would be a decent fallback.
Fixes JuliaLang/LinearAlgebra.jl#269 and JuliaLang/LinearAlgebra.jl#274