Skip to content

Commit c70d08f

Browse files
Format
1 parent aaab61d commit c70d08f

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/LabelledArrays.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ end
6565
ArrayInterface.can_setindex(::Type{<:SLArray}) = false
6666

6767
function PreallocationTools.get_tmp(dc::PreallocationTools.DiffCache,
68-
u::LArray{T, N, D, Syms}) where {T, N, D, Syms}
69-
nelem = div(sizeof(T), sizeof(eltype(dc.dual_du))) * length(dc.du)
68+
u::LArray{T, N, D, Syms}) where {T, N, D, Syms}
69+
nelem = div(sizeof(T), sizeof(eltype(dc.dual_du))) * length(dc.du)
7070
if nelem > length(dc.dual_du)
7171
PreallocationTools.enlargedualcache!(dc, nelem)
7272
end

src/larray.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,5 +367,11 @@ end
367367

368368
Base.elsize(::Type{<:LArray{T}}) where {T} = sizeof(T)
369369

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}
370+
function RecursiveArrayTools.recursive_unitless_eltype(a::Type{LArray{T, N, D, Syms}}) where {
371+
T,
372+
N,
373+
D,
374+
Syms
375+
}
376+
LArray{typeof(one(T)), N, D, Syms}
377+
end

src/slarray.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ 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)))
42+
function RecursiveArrayTools.recursive_unitless_eltype(a::Type{T}) where {T <: SLArray}
43+
StaticArrays.similar_type(a, recursive_unitless_eltype(eltype(a)))
44+
end
4445

4546
## Named tuple to SLArray
4647
#=

0 commit comments

Comments
 (0)