@@ -9,7 +9,8 @@ like `copy` on arrays of scalars.
9
9
function recursivecopy (a)
10
10
deepcopy (a)
11
11
end
12
- recursivecopy (a:: Union{SVector,SMatrix,SArray,Number} ) = copy (a)
12
+ recursivecopy (a:: Union {StaticArraysCore. SVector,StaticArraysCore. SMatrix,
13
+ StaticArraysCore. SArray,Number}) = copy (a)
13
14
function recursivecopy (a:: AbstractArray{T,N} ) where {T<: Number ,N}
14
15
copy (a)
15
16
end
@@ -33,7 +34,7 @@ like `copy!` on arrays of scalars.
33
34
"""
34
35
function recursivecopy! end
35
36
36
- function recursivecopy! (b:: AbstractArray{T,N} ,a:: AbstractArray{T2,N} ) where {T<: StaticArray ,T2<: StaticArray ,N}
37
+ function recursivecopy! (b:: AbstractArray{T,N} ,a:: AbstractArray{T2,N} ) where {T<: StaticArraysCore. StaticArray ,T2<: StaticArraysCore. StaticArray ,N}
37
38
@inbounds for i in eachindex (a)
38
39
# TODO : Check for `setindex!`` and use `copy!(b[i],a[i])` or `b[i] = a[i]`, see #19
39
40
b[i] = copy (a[i])
@@ -68,13 +69,13 @@ A recursive `fill!` function.
68
69
"""
69
70
function recursivefill! end
70
71
71
- function recursivefill! (b:: AbstractArray{T,N} ,a:: T2 ) where {T<: StaticArray ,T2<: StaticArray ,N}
72
+ function recursivefill! (b:: AbstractArray{T,N} ,a:: T2 ) where {T<: StaticArraysCore. StaticArray ,T2<: StaticArraysCore. StaticArray ,N}
72
73
@inbounds for i in eachindex (b)
73
74
b[i] = copy (a)
74
75
end
75
76
end
76
77
77
- function recursivefill! (b:: AbstractArray{T,N} ,a:: T2 ) where {T<: SArray ,T2<: Union{Number,Bool} ,N}
78
+ function recursivefill! (b:: AbstractArray{T,N} ,a:: T2 ) where {T<: StaticArraysCore. SArray ,T2<: Union{Number,Bool} ,N}
78
79
@inbounds for i in eachindex (b)
79
80
b[i] = fill (a, typeof (b[i]))
80
81
end
@@ -88,7 +89,7 @@ function recursivefill!(b::AbstractArray{T,N},a::T2) where {T<:Union{Number,Bool
88
89
fill! (b, a)
89
90
end
90
91
91
- function recursivefill! (b:: AbstractArray{T,N} ,a) where {T<: MArray ,N}
92
+ function recursivefill! (b:: AbstractArray{T,N} ,a) where {T<: StaticArraysCore. MArray ,N}
92
93
@inbounds for i in eachindex (b)
93
94
if isassigned (b,i)
94
95
recursivefill! (b[i],a)
@@ -151,7 +152,7 @@ If `i<length(x)`, it's simply a `recursivecopy!` to the `i`th element. Otherwise
151
152
function copyat_or_push! (a:: AbstractVector{T} ,i:: Int ,x,nc:: Type{Val{perform_copy}} = Val{true }) where {T,perform_copy}
152
153
@inbounds if length (a) >= i
153
154
if ! ArrayInterfaceCore. ismutable (T) || ! perform_copy
154
- # TODO : Check for `setindex!`` if T <: StaticArray and use `copy!(b[i],a[i])`
155
+ # TODO : Check for `setindex!`` if T <: StaticArraysCore. StaticArray and use `copy!(b[i],a[i])`
155
156
# or `b[i] = a[i]`, see https://github.com/JuliaDiffEq/RecursiveArrayTools.jl/issues/19
156
157
a[i] = x
157
158
else
@@ -208,7 +209,7 @@ ones has a `Array{Array{Float64,N},N}`, this will return `Array{Float64,N}`.
208
209
"""
209
210
recursive_unitless_eltype (a) = recursive_unitless_eltype (eltype (a))
210
211
recursive_unitless_eltype (a:: Type{Any} ) = Any
211
- recursive_unitless_eltype (a:: Type{T} ) where {T<: StaticArray } = similar_type (a,recursive_unitless_eltype (eltype (a)))
212
+ recursive_unitless_eltype (a:: Type{T} ) where {T<: StaticArraysCore. StaticArray } = similar_type (a,recursive_unitless_eltype (eltype (a)))
212
213
recursive_unitless_eltype (a:: Type{T} ) where {T<: Array } = Array{recursive_unitless_eltype (eltype (a)),ndims (a)}
213
214
recursive_unitless_eltype (a:: Type{T} ) where {T<: Number } = typeof (one (eltype (a)))
214
215
recursive_unitless_eltype (:: Type{<:Enum{T}} ) where T = T
0 commit comments