Skip to content

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  

@codecov
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 force-pushed the vectorindexoneel branch from b60a62f to b1f8d93 Compare May 9, 2024 05:55
@jishnub jishnub merged commit f659d9f into JuliaArrays:master Aug 5, 2024
@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