Skip to content

Commit 763f19f

Browse files
authored
Forward scaling lmul!/rmul! for Tridiagonal to bands (#1284)
This was missed out in #1236, as the functions may be applied to the bands here as well.
1 parent 2d27d1c commit 763f19f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/tridiag.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,9 @@ function rmul!(T::Tridiagonal, x::Number)
876876
iszero(y) || throw(ArgumentError(LazyString("cannot set index (3, 1) off ",
877877
lazy"the tridiagonal band to a nonzero value ($y)")))
878878
end
879-
T.dl .*= x
880-
T.d .*= x
881-
T.du .*= x
879+
rmul!(T.dl, x)
880+
rmul!(T.d, x)
881+
rmul!(T.du, x)
882882
return T
883883
end
884884
function lmul!(x::Number, T::Tridiagonal)
@@ -888,9 +888,9 @@ function lmul!(x::Number, T::Tridiagonal)
888888
iszero(y) || throw(ArgumentError(LazyString("cannot set index (3, 1) off ",
889889
lazy"the tridiagonal band to a nonzero value ($y)")))
890890
end
891-
@. T.dl = x * T.dl
892-
@. T.d = x * T.d
893-
@. T.du = x * T.du
891+
lmul!(x, T.dl)
892+
lmul!(x, T.d)
893+
lmul!(x, T.du)
894894
return T
895895
end
896896
/(A::Tridiagonal, B::Number) = Tridiagonal(A.dl/B, A.d/B, A.du/B)

0 commit comments

Comments
 (0)