Skip to content

Commit 91ccfa1

Browse files
require RecursiveArrayTools
1 parent 9836fc3 commit 91ccfa1

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1111
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1212
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1313
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
14+
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
1415

1516
[compat]
1617
ArrayInterface = "2.8, 3.0, 4, 5, 6"
1718
ArrayInterfaceStaticArrays = "0.1"
1819
ChainRulesCore = "1"
1920
MacroTools = "0.5"
2021
PreallocationTools = "0.4"
21-
StaticArrays = "0.10, 0.11, 0.12, 1.0"
22+
RecursiveArrayTools = "2"
23+
StaticArrays = "1.0"
2224
julia = "1.6"
2325

2426
[extras]

src/LabelledArrays.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module LabelledArrays
22

33
using LinearAlgebra, StaticArrays, ArrayInterface
4+
import RecursiveArrayTools
45

56
include("slarray.jl")
67
include("larray.jl")

src/larray.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,6 @@ function Base.vcat(x::LArray, y::LArray)
366366
end
367367

368368
Base.elsize(::Type{<:LArray{T}}) where {T} = sizeof(T)
369+
370+
RecursiveArrayTools.recursive_unitless_eltype(a::Type{LArray{T, N, D, Syms}}) where {T, N, D, Syms} =
371+
LArray{typeof(one(T)), N, D, Syms}

src/slarray.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ function StaticArrays.similar_type(::Type{SLArray{S, T, N, L, Syms}}, T2,
3939
::Size{S}) where {S, T, N, L, Syms}
4040
SLArray{S, T2, N, L, Syms}
4141
end
42+
RecursiveArrayTools.recursive_unitless_eltype(a::Type{T}) where {T<:SLArray} =
43+
StaticArrays.similar_type(a,recursive_unitless_eltype(eltype(a)))
4244

4345
## Named tuple to SLArray
4446
#=

0 commit comments

Comments
 (0)