Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Apr 23, 2024
1 parent 3bc025d commit f928c7a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/implementations/LinearAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function _check_dims(A, B)
return
end

function operate!(op::Union{typeof(+),typeof(-)}, A::AbstractArray, B::AbstractArray)
function operate!(
op::Union{typeof(+),typeof(-)},
A::AbstractArray,
B::AbstractArray,
)
_check_dims(A, B)
return broadcast!(op, A, B)
end
Expand Down Expand Up @@ -156,11 +160,17 @@ end

# Fallback, we may be able to be more efficient in more cases by adding more
# specialized methods.
function operate!(op::AddSubMul, A::Array, x, y)
function operate!(op::AddSubMul, A::AbstractArray, x, y)
return operate!(op, A, x * y)
end

function operate!(op::AddSubMul, A::Array, x, y, args::Vararg{Any,N}) where {N}
function operate!(
op::AddSubMul,
A::AbstractArray,
x,
y,
args::Vararg{Any,N},
) where {N}
@assert N > 0
return operate!(op, A, x, *(y, args...))
end
Expand Down

0 comments on commit f928c7a

Please sign in to comment.