-
Notifications
You must be signed in to change notification settings - Fork 124
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
[NDTensors] Start SparseArrayDOKs
module
#1270
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1270 +/- ##
===========================================
- Coverage 84.07% 53.94% -30.14%
===========================================
Files 99 98 -1
Lines 8542 8489 -53
===========================================
- Hits 7182 4579 -2603
- Misses 1360 3910 +2550 ☔ View full report in Codecov by Sentry. |
This introduces the module
SparseArrayInterface
, which defines sparse versions of various Julia Base functions likesparse_getindex
,sparse_setindex!
,sparse_map[!]
, etc. which make use of the sparsity structure of an array given some minimal overloads accessing the sparse storage and how multidimensional indices map back and forth to locations in the sparse storage.Then, it defines a concrete sparse array type called
SparseArrayDOK
(for dictionary-of-keys) in aSparseArrayDOKs
module that makes use ofSparseArrayInterface
to provide a lot of AbstractArray Julia functionality. The design is similar to that in SparseArrayKit.jl, with some key differences such as being based onSparseArrayInterface
, using Dictionaries.jl for the dictionary implementation instead ofBase.Dict
, and allowing for a more generic zero element type which will be used by theBlockSparseArray
type inBlockSparseArrays
.Some things to do:
SparseArrayInterface
inDiagonalArrays
to simplify the implementation there (i.e. make it simpler to define indexing, map/broadcast, etc.).The rest of the action items were moved to #1250 to keep this PR more self-contained.