Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Jan 31, 2024

This adds a public function to query the index at which a OneElement contains a non-zero value.

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

julia> FillArrays.nzind(O)
CartesianIndex(1, 2)

This complements getindex_value, which returns the stored value, and size, which returns the size. With this, we may obtain all the input arguments without accessing the fields of the struct.

@codecov
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e9077c3) 99.89% compared to head (36c3b37) 99.89%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #345   +/-   ##
=======================================
  Coverage   99.89%   99.89%           
=======================================
  Files           8        8           
  Lines         934      935    +1     
=======================================
+ Hits          933      934    +1     
  Misses          1        1           

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

@jishnub jishnub merged commit 45113c3 into JuliaArrays:master Apr 28, 2024
@jishnub jishnub deleted the oneelnzind branch April 28, 2024 02:37
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