11using Dictionaries: set!
2- using .. SparseArraysBase: SparseArraysBase
32
4- SparseArraysBase . sparse_storage (:: AbstractSparseArray ) = error (" Not implemented" )
3+ sparse_storage (:: AbstractSparseArray ) = error (" Not implemented" )
54
6- function SparseArraysBase . index_to_storage_index (
5+ function index_to_storage_index (
76 a:: AbstractSparseArray{<:Any,N} , I:: CartesianIndex{N}
87) where {N}
9- ! isassigned (SparseArraysBase . sparse_storage (a), I) && return nothing
8+ ! isassigned (sparse_storage (a), I) && return nothing
109 return I
1110end
1211
13- function SparseArraysBase . setindex_notstored! (
12+ function setindex_notstored! (
1413 a:: AbstractSparseArray{<:Any,N} , value, I:: CartesianIndex{N}
1514) where {N}
1615 iszero (value) && return a
2019# TODO : Make this into a generic definition of all `AbstractArray`?
2120# TODO : Check if this is efficient, or determine if this mapping should
2221# be performed in `storage_index_to_index` and/or `index_to_storage_index`.
23- function SparseArraysBase . sparse_storage (a:: SubArray{<:Any,<:Any,<:AbstractSparseArray} )
22+ function sparse_storage (a:: SubArray{<:Any,<:Any,<:AbstractSparseArray} )
2423 parent_storage = sparse_storage (parent (a))
2524 all_sliced_storage_indices = map (keys (parent_storage)) do I
2625 return map_index (a. indices, I)
@@ -31,7 +30,7 @@ function SparseArraysBase.sparse_storage(a::SubArray{<:Any,<:Any,<:AbstractSpars
3130end
3231
3332# TODO : Make this into a generic definition of all `AbstractArray`?
34- function SparseArraysBase . stored_indices (
33+ function stored_indices (
3534 a:: AnyPermutedDimsArray{<:Any,<:Any,<:Any,<:Any,<:AbstractSparseArray}
3635)
3736 return Iterators. map (
@@ -40,7 +39,7 @@ function SparseArraysBase.stored_indices(
4039end
4140
4241# TODO : Make this into a generic definition of all `AbstractArray`?
43- function SparseArraysBase . sparse_storage (
42+ function sparse_storage (
4443 a:: AnyPermutedDimsArray{<:Any,<:Any,<:Any,<:Any,<:AbstractSparseArray}
4544)
4645 return sparse_storage (parent (a))
0 commit comments