From 3e671bcda2871ecd5619dab7a853da2d211093ef Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Mon, 28 Oct 2024 14:51:40 +0530 Subject: [PATCH] inline __muldiag_nonzeroalpha! for Diagonal destination --- stdlib/LinearAlgebra/src/diagonal.jl | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/stdlib/LinearAlgebra/src/diagonal.jl b/stdlib/LinearAlgebra/src/diagonal.jl index 16528e6764531d..89173f4098ef88 100644 --- a/stdlib/LinearAlgebra/src/diagonal.jl +++ b/stdlib/LinearAlgebra/src/diagonal.jl @@ -506,7 +506,7 @@ function __muldiag!(out, A, D::Diagonal, _add::MulAddMul) return out end -@inline function __muldiag_nonzeroalpha!(out::Diagonal, D1::Diagonal, D2::Diagonal, _add::MulAddMul) +function __muldiag!(out::Diagonal, D1::Diagonal, D2::Diagonal, _add::MulAddMul) d1 = D1.diag d2 = D2.diag outd = out.diag @@ -514,16 +514,9 @@ end _modify!(_add, d1[i] * d2[i], outd, i) end out -end -function __muldiag!(out::Diagonal, D1::Diagonal, D2::Diagonal, _add::MulAddMul) - alpha, beta = _add.alpha, _add.beta - if iszero(alpha) - _rmul_or_fill!(out.diag, beta) - else - __muldiag_nonzeroalpha!(out, D1, D2, _add) - end return out end + @inline function __muldiag_nonzeroalpha!(out, D1::Diagonal, D2::Diagonal, _add::MulAddMul) d1 = D1.diag d2 = D2.diag