@@ -30,7 +30,7 @@ banded_gbmv!(tA, α, A, x, β, y) =
3030 =#
3131 length (y) == 0 && return y
3232 if length (x) == 0
33- _fill_lmul! (β, y )
33+ _fill_rmul! (y, β )
3434 else
3535 xc = Base. unalias (y, x)
3636 banded_gbmv! (tA, α, A, xc, β, y)
@@ -42,15 +42,15 @@ function _banded_muladd!(α, A, x::AbstractVector, β, y)
4242 m, n = size (A)
4343 l, u = bandwidths (A)
4444 if - l > u # no bands
45- _fill_lmul! (β, y )
45+ _fill_rmul! (y, β )
4646 elseif l < 0 # with u >= -l > 0, that is, all bands lie above the diagonal
4747 # E.g. (l,u) = (-1,2)
4848 # set lview = 0 and uview = u + l >= 0
4949 _banded_gbmv! (' N' , α, view (A, :, 1 - l: n), view (x, 1 - l: n), β, y)
5050 elseif u < 0 # with -l <= u < 0, that is, all bands lie below the diagnoal.
5151 # E.g. (l,u) = (2,-1)
5252 # set lview = l + u >= 0 and uview = 0
53- _fill_lmul! (β, @view (y[1 : - u]))
53+ _fill_rmul! ( @view (y[1 : - u]), β )
5454 _banded_gbmv! (' N' , α, view (A, 1 - u: m, :), x, β, view (y, 1 - u: m))
5555 y
5656 else
@@ -67,11 +67,11 @@ function _banded_muladd_row!(tA, α, At, x, β, y)
6767 n, m = size (At)
6868 u, l = bandwidths (At)
6969 if - l > u # no bands
70- _fill_lmul! (β, y )
70+ _fill_rmul! (y, β )
7171 elseif l < 0
7272 _banded_gbmv! (tA, α, view (At, 1 - l: n, :,), view (x, 1 - l: n), β, y)
7373 elseif u < 0
74- _fill_lmul! (β, @view (y[1 : - u]))
74+ _fill_rmul! ( @view (y[1 : - u]), β )
7575 _banded_gbmv! (tA, α, view (At, :, 1 - u: m), x, β, view (y, 1 - u: m))
7676 y
7777 else
@@ -100,10 +100,10 @@ end
100100@inline function materialize! (M:: MatMulVecAdd{<:AbstractBandedLayout} )
101101 checkdimensions (M)
102102 α,A,B,β,C = M. α,M. A,M. B,M. β,M. C
103- _fill_lmul! (β, C )
103+ _fill_rmul! (C, β )
104104 @inbounds for j = intersect (rowsupport (A), colsupport (B))
105105 for k = colrange (A,j)
106- C[k] += α * inbands_getindex (A,k,j)* B[j]
106+ C[k] += inbands_getindex (A,k,j) * B[j] * α
107107 end
108108 end
109109 C
@@ -113,11 +113,11 @@ end
113113 checkdimensions (M)
114114 α,At,B,β,C = M. α,M. A,M. B,M. β,M. C
115115 A = transpose (At)
116- _fill_lmul! (β, C )
116+ _fill_rmul! (C, β )
117117
118118 @inbounds for j = rowsupport (A)
119119 for k = intersect (colrange (A,j), colsupport (B))
120- C[j] += α * transpose (inbands_getindex (A,k,j))* B[k]
120+ C[j] += transpose (inbands_getindex (A,k,j)) * B[k] * α
121121 end
122122 end
123123 C
@@ -127,10 +127,10 @@ end
127127 checkdimensions (M)
128128 α,Ac,B,β,C = M. α,M. A,M. B,M. β,M. C
129129 A = Ac'
130- _fill_lmul! (β, C )
130+ _fill_rmul! (C, β )
131131 @inbounds for j = rowsupport (A)
132132 for k = intersect (colrange (A,j), colsupport (B))
133- C[j] += α * inbands_getindex (A,k,j)' * B[k]
133+ C[j] += inbands_getindex (A,k,j)' * B[k] * α
134134 end
135135 end
136136 C
@@ -227,13 +227,13 @@ end
227227
228228function materialize! (M:: MatMulMatAdd{<:DiagonalLayout{<:AbstractFillLayout},<:AbstractBandedLayout} )
229229 checkdimensions (M)
230- M. C .= (M . α * getindex_value (M. A. diag)) .* M. B .+ M. β .* M. C
230+ M. C .= getindex_value (M. A. diag) .* M. B .* M . α . + M. C .* M. β
231231 M. C
232232end
233233
234234function materialize! (M:: MatMulMatAdd{<:AbstractBandedLayout,<:DiagonalLayout{<:AbstractFillLayout}} )
235235 checkdimensions (M)
236- M. C .= (M . α * getindex_value (M. B. diag)) .* M. A .+ M. β .* M. C
236+ M. C .= M . A . * getindex_value (M. B. diag) .* M. α .+ M. C .* M. β
237237 M. C
238238end
239239
@@ -244,7 +244,7 @@ function materialize!(M::MatMulMatAdd{<:BandedColumns, <:AbstractStridedLayout,
244244 α, β, A, B, C = M. α, M. β, M. A, M. B, M. C
245245
246246 if iszero (α)
247- lmul! (β, C )
247+ rmul! (C, β )
248248 else
249249 for (colC, colB) in zip (eachcol (C), eachcol (B))
250250 mul! (colC, A, colB, α, β)
@@ -259,7 +259,7 @@ function materialize!(M::MatMulMatAdd{<:AbstractStridedLayout, <:BandedColumns,
259259 α, β, A, B, C = M. α, M. β, M. A, M. B, M. C
260260
261261 if iszero (α)
262- lmul! (β, C )
262+ rmul! (C, β )
263263 else
264264 for (rowC, rowA) in zip (eachrow (C), eachrow (A))
265265 mul! (rowC, transpose (B), rowA, α, β)
0 commit comments