Skip to content

Index into a CartesianIndices with a Block - #354

Merged
jishnub merged 5 commits into
masterfrom
jishnub/blocksliceview
Mar 28, 2024
Merged

Index into a CartesianIndices with a Block#354
jishnub merged 5 commits into
masterfrom
jishnub/blocksliceview

Conversation

@jishnub

@jishnub jishnub commented Mar 26, 2024

Copy link
Copy Markdown
Member

After this, indexing into a CartesianIndices with a Block produces a CartesianIndices if the ndims match.

julia> B = BlockArray(reshape([1:9;],3,3), [2,1], [2,1])
2×2-blocked 3×3 BlockMatrix{Int64}:
 1  47
 2  58
 ──────┼───
 3  69

julia> C = CartesianIndices(B)
CartesianIndices((1:1:3, 1:1:3))

julia> C[Block(1,1)]
CartesianIndices((1:2, 1:2))

This addresses the comment in #346 (comment)

The indexing operation C[Block(1), Block(1)] should also work identically, but this is WIP. works identically:

julia> C[Block(1), Block(1)]
CartesianIndices((1:2, 1:2))

@codecov

codecov Bot commented Mar 26, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.47%. Comparing base (ea33af1) to head (53a2f7d).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #354      +/-   ##
==========================================
+ Coverage   92.66%   94.47%   +1.81%     
==========================================
  Files          16       16              
  Lines        1499     1503       +4     
==========================================
+ Hits         1389     1420      +31     
+ Misses        110       83      -27     

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

@jishnub
jishnub merged commit 2ce8d26 into master Mar 28, 2024
@jishnub
jishnub deleted the jishnub/blocksliceview branch March 28, 2024 08:58
@mtfishman mtfishman mentioned this pull request Mar 28, 2024
4 tasks
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