Skip to content

Commit c41b80a

Browse files
committed
add __sum
1 parent 2d19552 commit c41b80a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/solve.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,12 @@ struct DualEltypeChecker{T, T2}
469469
counter::T2
470470
end
471471

472+
@inline __sum(f::F, args...; init, kwargs...) where {F} = sum(f, args...; init, kwargs...)
473+
@inline function __sum(
474+
f::F, a::StaticArraysCore.StaticArray...; init, kwargs...) where {F}
475+
return mapreduce(f, +, a...; init, kwargs...)
476+
end
477+
472478
totallength(x::Number) = 1
473479
totallength(x::AbstractArray) = __sum(totallength, x; init = 0)
474480

0 commit comments

Comments
 (0)