@@ -18,19 +18,19 @@ optionally with a function of type `F` to instantiate non-stored elements.
1818struct SparseArrayDOK{T,N,F} <: AbstractSparseArray{T,N}
1919 storage:: DOKStorage{T,N}
2020 size:: NTuple{N,Int}
21- getunstoredfun :: F
21+ getunstored :: F
2222 global @inline function _SparseArrayDOK (
23- storage:: DOKStorage{T,N} , size:: Dims{N} , getunstoredfun :: F
23+ storage:: DOKStorage{T,N} , size:: Dims{N} , getunstored :: F
2424 ) where {T,N,F}
25- return new {T,N,F} (storage, size, getunstoredfun )
25+ return new {T,N,F} (storage, size, getunstored )
2626 end
2727end
2828
2929# Constructors
3030# ------------
3131"""
32- SparseArrayDOK{T}(undef, dims...[; getunstoredfun ])
33- SparseArrayDOK{T,N}(undef, dims...[; getunstoredfun ])
32+ SparseArrayDOK{T}(undef, dims...[; getunstored ])
33+ SparseArrayDOK{T,N}(undef, dims...[; getunstored ])
3434
3535Construct an uninitialized `N`-dimensional [`SparseArrayDOK`](@ref) containing
3636elements of type `T`. `N` can either be supplied explicitly, or be determined by
@@ -39,12 +39,12 @@ the length or number of `dims`.
3939SparseArrayDOK {T,N} (:: UndefInitializer , dims; kwargs... )
4040
4141function SparseArrayDOK {T,N} (
42- :: UndefInitializer , dims:: Dims ; getunstoredfun = getzero
42+ :: UndefInitializer , dims:: Dims ; getunstored = getzero
4343) where {T,N}
4444 (length (dims) == N && all (≥ (0 ), dims)) ||
4545 throw (ArgumentError (" Invalid dimensions: $dims " ))
4646 storage = DOKStorage {T,N} ()
47- return _SparseArrayDOK (storage, dims, getunstoredfun )
47+ return _SparseArrayDOK (storage, dims, getunstored )
4848end
4949function SparseArrayDOK {T,N} (:: UndefInitializer , dims:: Vararg{Int,N} ; kwargs... ) where {T,N}
5050 return SparseArrayDOK {T,N} (undef, dims; kwargs... )
@@ -56,8 +56,8 @@ function SparseArrayDOK{T}(::UndefInitializer, dims::Vararg{Int,N}; kwargs...) w
5656 return SparseArrayDOK {T,N} (undef, dims; kwargs... )
5757end
5858
59- function set_getunstoredfun (a:: SparseArrayDOK , f)
60- @set a. getunstoredfun = f
59+ function set_getunstored (a:: SparseArrayDOK , f)
60+ @set a. getunstored = f
6161 return a
6262end
6363
@@ -83,7 +83,7 @@ function getstoredindex(a::SparseArrayDOK, I::Int...)
8383 return storage (a)[CartesianIndex (I)]
8484end
8585function getunstoredindex (a:: SparseArrayDOK , I:: Int... )
86- return a. getunstoredfun (a, I... )
86+ return a. getunstored (a, I... )
8787end
8888function setstoredindex! (a:: SparseArrayDOK , value, I:: Int... )
8989 # TODO : Have a way to disable this check, analogous to `checkbounds`,
0 commit comments