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

wrapper for eigen(Matrix A) where A is hermitian by value but not type #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johnfgibson
Copy link

A small fix to make the generic eigen work for matrices that are hermitian by value but not by type, following @dlfivefifty's suggestion at https://discourse.julialang.org/t/eigen-not-working-for-arbitrary-precision-bigfloat/67686/11

@andreasnoack
Copy link
Member

For reference, the current error is

julia> eigen(big.(A + A'))
ERROR: MethodError: no method matching eigen!(::Matrix{BigFloat}; permute=true, scale=true, sortby=LinearAlgebra.eigsortby)
Closest candidates are:
  eigen!(::StridedMatrix{T}; permute, scale, sortby) where T<:Union{Float32, Float64} at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/eigen.jl:148
  eigen!(::StridedMatrix{T}; permute, scale, sortby) where T<:Union{ComplexF32, ComplexF64} at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/eigen.jl:171
  eigen!(::StridedMatrix{T}, ::StridedMatrix{T}; sortby) where T<:Union{Float32, Float64} at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/eigen.jl:427 got unsupported keyword arguments "permute", "scale"
  ...
Stacktrace:
 [1] eigen(A::Matrix{BigFloat}; permute::Bool, scale::Bool, sortby::typeof(LinearAlgebra.eigsortby))
   @ LinearAlgebra /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/eigen.jl:237
 [2] eigen(A::Matrix{BigFloat})
   @ LinearAlgebra /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/eigen.jl:235
 [3] top-level scope
   @ REPL[3]:1

It would probably be more appropriate to adjust the eigen! methods in this package such that they have the same keyword arguments as the ones in LinearAlgebra.

@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.21 ⚠️

Comparison is base (2f2f4e6) 82.59% compared to head (6e17f92) 82.38%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
- Coverage   82.59%   82.38%   -0.21%     
==========================================
  Files          11       11              
  Lines        1637     1641       +4     
==========================================
  Hits         1352     1352              
- Misses        285      289       +4     
Impacted Files Coverage Δ
src/eigenSelfAdjoint.jl 92.23% <0.00%> (-0.86%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants