Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Nov 3, 2023

This PR uses the fact that views of a BandedMatrix with AbstractUnitRange ranges have bands that are contiguous views of the original. This helps speed up indexing operations by forwarding these to the bandeddata.

On master

julia> A = brand(200, 200, 3, 4);

julia> B = view(A, 1:100, 1:100);

julia> @btime $B[band(0)];
  1.050 μs (1 allocation: 896 bytes)

This PR

julia> @btime $B[band(0)];
  214.281 ns (1 allocation: 896 bytes)

@codecov
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4f24c9d) 89.51% compared to head (cbb6f32) 89.55%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
+ Coverage   89.51%   89.55%   +0.03%     
==========================================
  Files          25       25              
  Lines        3529     3542      +13     
==========================================
+ Hits         3159     3172      +13     
  Misses        370      370              
Files Coverage Δ
src/banded/BandedMatrix.jl 95.24% <100.00%> (+0.13%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dlfivefifty dlfivefifty merged commit ee92759 into JuliaLinearAlgebra:master Nov 3, 2023
@jishnub jishnub deleted the subarraybandview branch November 4, 2023 06:20
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