Skip to content

Commit 9de0890

Browse files
committed
same eltype, less memory
1 parent 8f39f97 commit 9de0890

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/linearcombination.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ end
157157
function Base.:(*)(A::LinearCombination{<:Any,<:Tuple{Vararg{OOPFunctionMap}}}, x::AbstractVector)
158158
mapreduce(L -> L * x, Base.add_sum, A.maps)
159159
end
160+
function Base.:(*)(A::LinearCombination{<:Any,<:Tuple{Vararg{OOPFunctionMap{T}}}}, x::AbstractVector) where {T}
161+
mapreduce(L -> L * x, (x, y) -> x .+= y, A.maps)
162+
end
160163

161164
_unsafe_mul!(y, A::LinearCombination{<:Any,<:Tuple{Vararg{OOPFunctionMap}}}, x::AbstractVector) =
162165
copyto!(y, A*x)

0 commit comments

Comments
 (0)