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

Vector indexing for OneElement #346

Merged
merged 3 commits into from
Aug 5, 2024
Merged

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Feb 1, 2024

In certain simple (yet frequently encountered) vector indexing operations, we may use the fact that a slice of a OneElement returns a OneElement:

julia> A = OneElement(2, (2,3), (4,5))
4×5 OneElement{Int64, 2, Tuple{Int64, Int64}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
         
     2    
         
         

julia> A[:,3]
4-element OneElement{Int64, 1, Tuple{Int64}, Tuple{Base.OneTo{Int64}}}:
 
 2
 
 

julia> A[2, :]
5-element OneElement{Int64, 1, Tuple{Int64}, Tuple{Base.OneTo{Int64}}}:
 
 
 2
 
 

julia> A[1:2, 1:4]
2×4 OneElement{Int64, 2, Tuple{Int64, Int64}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
       
     2  

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.90%. Comparing base (39df7ec) to head (3e5c4a2).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #346   +/-   ##
=======================================
  Coverage   99.90%   99.90%           
=======================================
  Files           8        8           
  Lines        1073     1089   +16     
=======================================
+ Hits         1072     1088   +16     
  Misses          1        1           

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

@jishnub jishnub merged commit f659d9f into JuliaArrays:master Aug 5, 2024
18 checks passed
@jishnub jishnub deleted the vectorindexoneel branch August 5, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants