Skip to content

Commit 97324df

Browse files
committed
Add comments and docstring
1 parent 2ef2051 commit 97324df

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/bidiag.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,17 @@ function _diag(A::Bidiagonal, k)
598598
end
599599
end
600600

601+
"""
602+
_MulAddMul_nonzeroalpha(_add::MulAddMul[, ::Val{false}])
603+
604+
Return a new `MulAddMul` with the value of `alpha` potentially set to a literal non-zero
605+
value if permitted by the type (e.g., for `_add.alpha isa Bool`, in which case the `alpha` is
606+
set to `true` in the returned instance).
607+
In other cases, the single-argument call is a no-op and returns `_add` without modifications.
608+
609+
In addition, if `Val(false)` is provided as the second argument,
610+
`beta` is set to `false` in the returned `MulAddMul` instance.
611+
"""
601612
_MulAddMul_nonzeroalpha(_add::MulAddMul) = _add
602613
function _MulAddMul_nonzeroalpha(_add::MulAddMul{ais1,bis0,A}, ::Val{false}) where {ais1,bis0,A}
603614
MulAddMul{ais1,true,A,Bool}(_add.alpha, false)
@@ -1142,6 +1153,7 @@ function _dibimul!(C, A, B, _add)
11421153
# ensure that we fill off-band elements in the destination
11431154
_rmul_or_fill!(C, _add.beta)
11441155
iszero(_add.alpha) && return C
1156+
# beta is unused in the _dibimul_nonzeroalpha! call, so we set it to false
11451157
_add_nonzeroalpha = _MulAddMul_nonzeroalpha(_add, Val(false))
11461158
_dibimul_nonzeroalpha!(C, A, B, _add_nonzeroalpha)
11471159
C

0 commit comments

Comments
 (0)