Skip to content

Commit

Permalink
use StridedDenseArray in Base
Browse files Browse the repository at this point in the history
  • Loading branch information
nsajko committed Jan 20, 2025
1 parent e26e144 commit a84c5d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/reinterpretarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ StridedFastContiguousSubArray{T,N,A<:DenseArray} = FastContiguousSubArray{T,N,A}
StridedReinterpretArray{T,N,A<:Union{DenseArray,StridedFastContiguousSubArray},IsReshaped} = ReinterpretArray{T,N,S,A,IsReshaped} where S
StridedReshapedArray{T,N,A<:Union{DenseArray,StridedFastContiguousSubArray,StridedReinterpretArray}} = ReshapedArray{T,N,A}
StridedDenseArray{T,N} = Union{DenseArray{T,N}, StridedReshapedArray{T,N}, StridedReinterpretArray{T,N}}
StridedSubArray{T,N,A<:Union{DenseArray,StridedReshapedArray,StridedReinterpretArray},
StridedSubArray{T,N,A<:StridedDenseArray,
I<:Tuple{Vararg{Union{RangeIndex, ReshapedUnitRange, AbstractCartesianIndex}}}} = SubArray{T,N,A,I}
StridedArray{T,N} = Union{DenseArray{T,N}, StridedSubArray{T,N}, StridedReshapedArray{T,N}, StridedReinterpretArray{T,N}}
StridedArray{T,N} = Union{StridedDenseArray{T,N}, StridedSubArray{T,N}}
StridedVector{T} = StridedArray{T,1}
StridedMatrix{T} = StridedArray{T,2}
StridedVecOrMat{T} = Union{StridedVector{T}, StridedMatrix{T}}

strides(a::Union{DenseArray,StridedReshapedArray,StridedReinterpretArray}) = size_to_strides(1, size(a)...)
stride(A::Union{DenseArray,StridedReshapedArray,StridedReinterpretArray}, k::Integer) =
strides(a::StridedDenseArray) = size_to_strides(1, size(a)...)
stride(A::StridedDenseArray, k::Integer) =
k ndims(A) ? strides(A)[k] : length(A)

function strides(a::ReinterpretArray{T,<:Any,S,<:AbstractArray{S},IsReshaped}) where {T,S,IsReshaped}
Expand Down

0 comments on commit a84c5d1

Please sign in to comment.