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

Add mutating sequence #60

Merged
merged 3 commits into from
Nov 2, 2022
Merged

Add mutating sequence #60

merged 3 commits into from
Nov 2, 2022

Conversation

heltonmc
Copy link
Member

@heltonmc heltonmc commented Oct 21, 2022

Closes #59

Need to go through and test benchmarks to make sure there are no regressions and need to add methods for all the other Bessel functions. Always amazed how expensive allocating memory is...

julia> @benchmark Bessels.besselj!(x, 1:10, 1.0) setup=(x=zeros(Float64, 10))
BenchmarkTools.Trial: 10000 samples with 741 evaluations.
 Range (min  max):  169.345 ns  328.243 ns  ┊ GC (min  max): 0.00%  0.00%
 Time  (median):     173.259 ns               ┊ GC (median):    0.00%
 Time  (mean ± σ):   174.458 ns ±  11.158 ns  ┊ GC (mean ± σ):  0.00% ± 0.00%

        ▁██▃  ▂▂▁                                               ▂
  ▄▃▅▇▆▆████▆████▇▆▅▅▄▅▅▅▅▁▃▃▄▅▄▃▄▁▄▃▃▁▃▄▃▁▁▁▅▃▄▃▃▄▁▃▄▃▄▁▄▄▄▅▆▅ █
  169 ns        Histogram: log(frequency) by time        199 ns <

 Memory estimate: 0 bytes, allocs estimate: 0.

julia> @benchmark Bessels.besselj(1:10, 1.0) setup=(x=zeros(Float64, 10))
BenchmarkTools.Trial: 10000 samples with 585 evaluations.
 Range (min  max):  203.162 ns   1.300 μs  ┊ GC (min  max): 0.00%  74.22%
 Time  (median):     204.342 ns              ┊ GC (median):    0.00%
 Time  (mean ± σ):   211.169 ns ± 39.150 ns  ┊ GC (mean ± σ):  0.66% ±  3.32%

  █▁▂▁                   ▁▂▁ ▁                                 ▁
  ████▆▅▆▄▄▄▃▆▄▄▄▄▄▅▄▃▃▄▇██████▆▅▄▄▃▁▄▃▄▃▅▅▄▄▄▄▄▅▆▄▆▆▅▄▄▅▆▆▆▄▅ █
  203 ns        Histogram: log(frequency) by time       319 ns <

 Memory estimate: 144 bytes, allocs estimate: 1.

I guess we also need to decide if we want to export the new methods.... probably require v0.3.0 release...

@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Base: 94.70% // Head: 94.72% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (08d3600) compared to base (6c8be6f).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 08d3600 differs from pull request most recent head e1241a4. Consider uploading reports for the commit e1241a4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   94.70%   94.72%   +0.01%     
==========================================
  Files          18       18              
  Lines        1964     1970       +6     
==========================================
+ Hits         1860     1866       +6     
  Misses        104      104              
Impacted Files Coverage Δ
src/besseli.jl 98.10% <100.00%> (+0.01%) ⬆️
src/besselj.jl 93.08% <100.00%> (+0.07%) ⬆️
src/besselk.jl 97.28% <100.00%> (+0.02%) ⬆️
src/bessely.jl 91.66% <100.00%> (+0.07%) ⬆️
src/sphericalbessel.jl 100.00% <0.00%> (ø)

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.

@heltonmc
Copy link
Member Author

Ok I've added all the methods for besselj!, bessely!, besselk!, and besseli!. There was also a bad allocation in the modified Bessel functions that I cleaned up where they now all don't allocate.

I'm not for sure how I feel about exporting all these different types of methods. If we do we should probably also export sphericalbesseli and sphericalbesselk in next big release.... but IDK.

@heltonmc heltonmc merged commit dc22b7e into master Nov 2, 2022
@heltonmc heltonmc deleted the mutate branch November 2, 2022 15:55
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.

mutating bessels! for sequence
1 participant