Skip to content

Commit

Permalink
inline __muldiag_nonzeroalpha! for Diagonal destination
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Oct 28, 2024
1 parent 989badf commit d321cce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,11 @@ end
end
out
end

@inline function __muldiag_nonzeroalpha!(out, D1::Diagonal, D2::Diagonal, alpha::Number, beta::Number)
d1 = D1.diag
d2 = D2.diag
# this method is only called with beta == true
# we hardcode beta == true in the loop to reduce the @stable_muladdmul branches
isone(beta) || throw(ArgumentError("beta must satisfy isone(beta)"))
@inbounds for i in eachindex(d1, d2)
@stable_muladdmul _modify!(MulAddMul(alpha,true), d1[i] * d2[i], out, (i,i))
Expand Down

0 comments on commit d321cce

Please sign in to comment.