Skip to content

Commit fb9ebf0

Browse files
committed
Add comments and docstring
1 parent 5ee1556 commit fb9ebf0

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
@@ -600,6 +600,17 @@ function _diag(A::Bidiagonal, k)
600600
end
601601
end
602602

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

0 commit comments

Comments
 (0)