Skip to content

Commit 57c81ad

Browse files
authored
add missing defs (#303)
1 parent b1ce7bb commit 57c81ad

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

lib/ArrayInterfaceOffsetArrays/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterfaceOffsetArrays"
22
uuid = "015c0d05-e682-4f19-8f0a-679ce4c54826"
3-
version = "0.1.2"
3+
version = "0.1.3"
44

55
[deps]
66
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

lib/ArrayInterfaceOffsetArrays/src/ArrayInterfaceOffsetArrays.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,11 @@ end
4444
d = ArrayInterface.to_dims(A, dim)
4545
OffsetArrays.IdOffsetRange(ArrayInterface.axes(parent(A), d), relative_offsets(A, d))
4646
end
47+
function ArrayInterface.stride_rank(T::Type{<:OffsetArray})
48+
ArrayInterface.stride_rank(ArrayInterface.parent_type(T))
49+
end
50+
function ArrayInterface.contiguous_axis(T::Type{<:OffsetArray})
51+
ArrayInterface.contiguous_axis(ArrayInterface.parent_type(T))
52+
end
4753

4854
end # module

lib/ArrayInterfaceOffsetArrays/test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ o = OffsetArray(vec(A), 8);
2929
offset_view = @view OffsetArrays.centered(zeros(eltype(A), 5, 5))[:, begin]; # SubArray of OffsetArray
3030
@test @inferred(ArrayInterface.offsets(offset_view)) == (-2,)
3131

32+
B = OffsetArray(PermutedDimsArray(rand(2,3,4), (2,3,1)));
33+
@test @inferred(ArrayInterface.StrideIndex(B)) === ArrayInterface.StrideIndex{3, (2, 3, 1), 3}((2, 6, static(1)), (1, 1, 1))

0 commit comments

Comments
 (0)