1
1
module LabelledArrays
2
2
3
- using LinearAlgebra, StaticArrays, ArrayInterfaceCore
3
+ using LinearAlgebra, StaticArrays, ArrayInterface
4
4
import RecursiveArrayTools, PreallocationTools, ForwardDiff
5
5
6
6
include (" slarray.jl" )
59
59
Base. NamedTuple (x:: Union{LArray, SLArray} ) = NamedTuple {symnames(typeof(x))} (x. __x)
60
60
@inline Base. reshape (a:: SLArray , s:: Size ) = StaticArrays. similar_type (a, s)(Tuple (a))
61
61
62
- function ArrayInterfaceCore . ismutable (:: Type{<:LArray{T, N, D, Syms}} ) where {T, N, D, Syms}
63
- ArrayInterfaceCore . ismutable (T)
62
+ function ArrayInterface . ismutable (:: Type{<:LArray{T, N, D, Syms}} ) where {T, N, D, Syms}
63
+ ArrayInterface . ismutable (T)
64
64
end
65
- ArrayInterfaceCore . can_setindex (:: Type{<:SLArray} ) = false
65
+ ArrayInterface . can_setindex (:: Type{<:SLArray} ) = false
66
66
67
67
lenfun (x) = length (x)
68
68
lenfun (:: Symbol ) = 1
69
- function ArrayInterfaceCore . undefmatrix (x:: LArray{T, N, D, Syms} ) where {T, N, D, Syms}
69
+ function ArrayInterface . undefmatrix (x:: LArray{T, N, D, Syms} ) where {T, N, D, Syms}
70
70
n = sum (lenfun, Syms)
71
71
similar (x. __x, n, n)
72
72
end
@@ -78,7 +78,7 @@ function PreallocationTools.get_tmp(dc::PreallocationTools.DiffCache,
78
78
if nelem > length (dc. dual_du)
79
79
PreallocationTools. enlargedualcache! (dc, nelem)
80
80
end
81
- _x = ArrayInterfaceCore . restructure (dc. du, reinterpret (T, view (dc. dual_du, 1 : nelem)))
81
+ _x = ArrayInterface . restructure (dc. du, reinterpret (T, view (dc. dual_du, 1 : nelem)))
82
82
LabelledArrays. LArray {T, N, D, Syms} (_x)
83
83
end
84
84
0 commit comments