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

In-place eigvals for complex Hermitian BandedMatrix #359

Merged
merged 6 commits into from
May 24, 2023

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented May 18, 2023

After this,

julia> A = Hermitian(brand(ComplexF64, 6, 6, 2, 2))
6×6 Hermitian{ComplexF64, BandedMatrix{ComplexF64, Matrix{ComplexF64}, Base.OneTo{Int64}}}:
 0.539725+0.0im          0.25559+0.00579831im  0.559341+0.114413im                                                            
  0.25559-0.00579831im  0.784935+0.0im         0.378323+0.837163im   0.337384+0.392795im                                       
 0.559341-0.114413im    0.378323-0.837163im    0.744348+0.0im        0.153074+0.0727464im   0.420417+0.0808449im                
                       0.337384-0.392795im    0.153074-0.0727464im  0.267722+0.0im         0.377242+0.541864im    0.690377+0.470517im
                                             0.420417-0.0808449im  0.377242-0.541864im     0.67322+0.0im        0.0208153+0.151669im
                                                                  0.690377-0.470517im   0.0208153-0.151669im    0.850139+0.0im

julia> eigvals!(copy(A))
6-element Vector{Float64}:
 -0.8404525797103768
 -0.1783975827526587
  0.459438228060648
  0.7997670633406646
  1.4132897571114231
  2.2064446339423642

julia> eigen!(copy(A))
Eigen{ComplexF64, Float64, Matrix{ComplexF64}, Vector{Float64}}
values:
6-element Vector{Float64}:
 -0.8404525797103773
 -0.17839758275265893
  0.4594382280606475
  0.7997670633406677
  1.4132897571114234
  2.2064446339423593
vectors:
6×6 Matrix{ComplexF64}:
 -0.148603+0.0im        -0.425349+0.0im           0.749991+0.0im         0.287983+0.0im        -0.294169+0.0im       0.255028+0.0im
   0.10547-0.376109im   -0.157143-0.329141im     -0.383595-0.338108im    0.217697-0.218831im   -0.202174-0.142623im  0.448417+0.308796im
   0.33548+0.102147im    0.619659+0.0252785im    0.0926653+0.13952im    0.0500393+0.0875024im  -0.340514+0.136919im  0.507191-0.249498im
  0.206242+0.622302im   -0.254169-0.337529im   -0.00461372-0.041927im    -0.13238-0.072834im    0.449047-0.102082im   0.37728-0.112541im
 -0.392573-0.0638003im  0.0315878-0.0271654im    -0.107969-0.313205im    0.045246+0.761045im   0.0967334-0.195571im  0.201939-0.24638im
 -0.246861-0.231159im    0.328377+0.115492im      0.185982+0.0433029im   0.184487-0.416562im    0.416109-0.533607im  0.128546-0.214531im

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.94 🎉

Comparison is base (fc3575f) 83.44% compared to head (11da89c) 85.39%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #359      +/-   ##
==========================================
+ Coverage   83.44%   85.39%   +1.94%     
==========================================
  Files          24       24              
  Lines        3353     3389      +36     
==========================================
+ Hits         2798     2894      +96     
+ Misses        555      495      -60     
Impacted Files Coverage Δ
src/symbanded/symbanded.jl 93.02% <ø> (-0.79%) ⬇️
src/lapack.jl 88.11% <100.00%> (+1.75%) ⬆️
src/symbanded/bandedeigen.jl 77.77% <100.00%> (+7.73%) ⬆️
src/symbanded/tridiagonalize.jl 98.73% <100.00%> (+0.34%) ⬆️

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

@jishnub
Copy link
Member Author

jishnub commented May 18, 2023

This PR overlaps with #185, but given that the other one is stalled, perhaps it's better to get this version with dense eigenvectors working, and subsequently change the type of the eigenvector matrix as an implementation detail.

@@ -1,3 +1,34 @@
## eigvals routine
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The eigvals methods are moved to bandedeigen.jl from symbanded.jl so that they're in the same file as eigen and are easy to discover.

@jishnub jishnub merged commit 88a4a22 into JuliaLinearAlgebra:master May 24, 2023
@jishnub jishnub deleted the hbtrd branch May 24, 2023 16:49
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.

1 participant