Motivation: https://github.com/JuliaSparse/SparseArrays.jl/issues/512 Solution (just a brief sketch): ```julia struct SparseOverlay{T,N,D<:AbstractArray{T,N}} <: AbstractArray{T,N} data::Dict{CartesianIndex{N},T} base::D end const SparseArray{T,N} = SparseOverlay{T,N,FillArrays.Zeros{T,N}} @inline function Base.getindex(a::SparseOverlay{T,N}, I::CartesianIndex{N}) where {T,N} @boundscheck checkbounds(a, I) return get(a.data, I, a.base[I]) end ```
Activity