6565)
6666 # TODO : Use `Block()[]` once https://github.com/JuliaArrays/BlockArrays.jl/issues/430
6767 # is fixed.
68- return a[BlockIndex {0,Tuple{},Tuple{}} ((), () )]
68+ return a[BlockIndex ( )]
6969end
7070
7171# a[1:2, 1:2]
135135)
136136 # TODO : Use `Block()[]` once https://github.com/JuliaArrays/BlockArrays.jl/issues/430
137137 # is fixed.
138- a[BlockIndex {0,Tuple{},Tuple{}} ((), () )] = value
138+ a[BlockIndex ( )] = value
139139 return a
140140end
141141
301301function Base. size (a:: SparseSubArrayBlocks )
302302 return length .(axes (a))
303303end
304+ # TODO : Define `isstored`.
305+ # TODO : Define `getstoredindex`, `getunstoredindex` instead.
304306function Base. getindex (a:: SparseSubArrayBlocks{<:Any,N} , I:: Vararg{Int,N} ) where {N}
305307 # TODO : Should this be defined as `@view a.array[Block(I)]` instead?
306308 return @view a. array[Block (I)]
@@ -312,9 +314,11 @@ function Base.getindex(a::SparseSubArrayBlocks{<:Any,N}, I::Vararg{Int,N}) where
312314 # # return @view parent_block[blockindices(parent(a.array), block, a.array.indices)...]
313315end
314316# TODO : This should be handled by generic `AbstractSparseArray` code.
317+ # TODO : Define `getstoredindex`, `getunstoredindex` instead.
315318function Base. getindex (a:: SparseSubArrayBlocks{<:Any,N} , I:: CartesianIndex{N} ) where {N}
316319 return a[Tuple (I)... ]
317320end
321+ # TODO : Define `setstoredindex!`, `setunstoredindex!` instead.
318322function Base. setindex! (a:: SparseSubArrayBlocks{<:Any,N} , value, I:: Vararg{Int,N} ) where {N}
319323 parent_blocks = @view blocks (parent (a. array))[blockrange (a)... ]
320324 # TODO : The following line is required to instantiate
@@ -345,18 +349,11 @@ SparseArraysBase.storedlength(a::SparseSubArrayBlocks) = length(eachstoredindex(
345349# # array::Array
346350# # end
347351
348- # # TODO : Delete .
352+ # # TODO : Define `storedvalues` instead .
349353# # function SparseArraysBase.sparse_storage(a::SparseSubArrayBlocks)
350354# # return map(I -> a[I], eachstoredindex(a))
351355# # end
352356
353- # # TODO : Delete.
354- # # function SparseArraysBase.getindex_zero_function(a::SparseSubArrayBlocks)
355- # # # TODO : Base it off of `getindex_zero_function(blocks(parent(a.array))`, but replace the
356- # # # axes with `axes(a.array)`.
357- # # return BlockZero(axes(a.array))
358- # # end
359-
360357function SparseArraysBase. getunstoredindex (
361358 a:: SparseSubArrayBlocks{<:Any,N} , I:: Vararg{Int,N}
362359) where {N}
0 commit comments