jverzani / AMRVW.jl

Implementation in Julia of unitary core transformations approach to finding eigenvalues of companion matrices
MIT License
10 stars 0 forks source link

make solve_simple_cases type-stable #13

Closed nsajko closed 1 year ago

nsajko commented 1 year ago

Prevents run time dispatch in roots(::Vector)

Before (with my other current PRs applied):

  | | |_| | | | (_| |  |  Version 1.10.0-DEV.143 (2022-12-14)
 _/ |\__'_|_|_|\__'_|  |  Commit 0fbe56e35e9 (0 days old master)
|__/                   |

julia> import AMRVW

julia> const A = AMRVW
AMRVW

julia> A.roots(rand(15));

julia> using JET

julia> @report_opt A.roots(rand(15))
 1 possible error found
┌ @ /home/nsajko/tmp/AMRVW.jl/src/companion.jl:255 AMRVW.append!(%7, %8)
│ runtime dispatch detected: AMRVW.append!(%7::Union{Nothing, Vector{ComplexF64}}, %8::Vector{ComplexF64})::Any
└──────────────────────────────────────────────────

After:

julia> @report_opt A.roots(rand(15))
No errors detected
jverzani commented 1 year ago

Awesome! Thanks again.

codecov[bot] commented 1 year ago

Codecov Report

Merging #13 (3e62721) into master (98688e2) will decrease coverage by 0.17%. The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
- Coverage   86.91%   86.73%   -0.18%     
==========================================
  Files          19       19              
  Lines        1826     1892      +66     
==========================================
+ Hits         1587     1641      +54     
- Misses        239      251      +12     
Impacted Files Coverage Δ
src/utils.jl 95.83% <50.00%> (-1.27%) :arrow_down:
src/AMRVW_algorithm.jl 79.61% <0.00%> (-3.39%) :arrow_down:
src/rfactorization.jl 83.43% <0.00%> (-0.23%) :arrow_down:
src/twisted.jl 87.33% <0.00%> (-0.22%) :arrow_down:
src/diagonal.jl 85.89% <0.00%> (-0.14%) :arrow_down:
src/CSS.jl 100.00% <0.00%> (ø)
src/RDS.jl 100.00% <0.00%> (ø)
src/bulge-step.jl 100.00% <0.00%> (ø)
src/companion.jl 98.07% <0.00%> (+0.09%) :arrow_up:
... and 5 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more