Skip to content

Commit 5d45797

Browse files
committed
Better definition
1 parent 81df0ab commit 5d45797

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/abstractsparsearrayinterface.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ end
5454
return error("Not implemented.")
5555
end
5656

57-
@interface ::AbstractArrayInterface function isstored(a::SubArray, I::Int...)
58-
return isstored(parent(a), Base.reindex(parentindices(a), I)...)
59-
end
60-
6157
# TODO: Use `Base.to_indices`?
6258
isstored(a::AbstractArray, I::CartesianIndex) = isstored(a, Tuple(I)...)
6359
# TODO: Use `Base.to_indices`?
@@ -106,10 +102,6 @@ end
106102
SparseArraysBase.storedvalues(::T)
107103
end
108104

109-
@derive (T=SubArray,) begin
110-
SparseArraysBase.isstored(::T, ::Int...)
111-
end
112-
113105
# TODO: Add `ndims` type parameter, like `Base.Broadcast.AbstractArrayStyle`.
114106
# TODO: This isn't used to define interface functions right now.
115107
# Currently, `@interface` expects an instance, probably it should take a

src/wrappers.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ function storedparentvalues(a::SubArray)
106106
return StoredValues(parent(a), collect(eachstoredparentindex(a)))
107107
end
108108

109+
@interface ::AbstractArrayInterface function isstored(a::SubArray, I::Int...)
110+
return isstored(parent(a), index_to_parentindex(a, I...)...)
111+
end
112+
109113
using LinearAlgebra: Transpose
110114
function parentindex_to_index(a::Transpose, I::CartesianIndex{2})
111115
return cartesianindex_reverse(I)

0 commit comments

Comments
 (0)