Skip to content

Commit 5cb5c01

Browse files
committed
No ordering
1 parent 088b101 commit 5cb5c01

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/indexing.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ For multiple arrays, the iterable contains all indices where at least one input
7070
The type of indices can be controlled through `style`, which will default to a compatible style for all
7171
inputs.
7272
73-
The order of the iterable is not fixed, but for a single input it may be assumed to be compatible
74-
with [`storedvalues`](@ref).
73+
The order of the iterable is not guaranteed to be fixed or sorted, and should not be assumed
74+
to be the same as [`storedvalues`](@ref).
7575
7676
See also [`storedvalues`](@ref), [`storedpairs`](@ref) and [`storedlength`](@ref).
7777
"""
@@ -90,7 +90,8 @@ function storedlength end
9090
An iterable over all stored indices and their corresponding stored values.
9191
The indices are compatible with `IndexStyle(A)`.
9292
93-
The order of the iterable is not fixed, but is compatible with [`eachstoredindex`](@ref).
93+
The order of the iterable is not guaranteed to be fixed or sorted.
94+
See also [`eachstoredindex`](@ref) and [`storedvalues`](@ref).
9495
"""
9596
function storedpairs end
9697

@@ -99,7 +100,8 @@ function storedpairs end
99100
100101
An iterable over all stored values.
101102
102-
The order of the iterable is not fixed, but is compatible with [`eachstoredindex`](@ref).
103+
The order of the iterable is not guaranteed to be fixed or sorted, and should not be assumed
104+
to be the same as [`eachstoredindex`](@ref).
103105
"""
104106
function storedvalues end
105107

@@ -379,8 +381,9 @@ end
379381

380382
@interface ::AbstractSparseArrayInterface storedlength(A::AbstractArray) =
381383
length(storedvalues(A))
382-
@interface ::AbstractSparseArrayInterface storedpairs(A::AbstractArray) =
383-
Iterators.map(=>, eachstoredindex(A), storedvalues(A))
384+
@interface ::AbstractSparseArrayInterface function storedpairs(A::AbstractArray)
385+
return Iterators.map(I -> (I => A[I]), eachstoredindex(A))
386+
end
384387

385388
#=
386389
All sparse array interfaces are mapped through layout_getindex. (is this too opinionated?)

0 commit comments

Comments
 (0)