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

Some promotion and error reporting fixes for eigs #13778

Merged
merged 2 commits into from
Oct 28, 2015
Merged

Conversation

andreasnoack
Copy link
Member

@kshyatt kshyatt added the linear algebra Linear algebra label Oct 26, 2015
andreasnoack added a commit that referenced this pull request Oct 28, 2015
Some promotion and error reporting fixes for eigs
@andreasnoack andreasnoack merged commit 361cf34 into master Oct 28, 2015
@andreasnoack andreasnoack deleted the anj/arpack branch October 28, 2015 15:36
@@ -11,7 +11,18 @@ type LAPACKException <: Exception
end

type ARPACKException <: Exception
info::BlasInt
info::ByteString
Copy link
Contributor

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

Copy link
Member Author

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.

@ViralBShah
Copy link
Member

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)))
Copy link
Member

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.

andreasnoack added a commit that referenced this pull request Oct 31, 2015
(cherry picked from commit e9cabd3)
ref #13778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ARPACKException with eigs
6 participants