Skip to content

Commit 99aadf4

Browse files
authored
Change muladd to mul in BlockArray * StridedVector (#272)
* muladd to mul in BlockArray * StridedVector * bump version to v0.16.33
1 parent dcbe006 commit 99aadf4

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockArrays"
22
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3-
version = "0.16.32"
3+
version = "0.16.33"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/blocklinalg.jl

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -208,27 +208,6 @@ end
208208
# BLAS overrides
209209
#############
210210

211-
212-
function materialize!(M::MatMulVecAdd{<:AbstractBlockLayout,<:AbstractStridedLayout,<:AbstractStridedLayout})
213-
α, A, x_in, β, y_in = M.α, M.A, M.B, M.β, M.C
214-
if length(x_in) != size(A,2) || length(y_in) != size(A,1)
215-
throw(DimensionMismatch())
216-
end
217-
218-
# impose block structure
219-
y = PseudoBlockArray(y_in, (axes(A,1),))
220-
x = PseudoBlockArray(x_in, (axes(A,2),))
221-
222-
_fill_lmul!(β, y)
223-
224-
for J = blockaxes(A,2)
225-
for K = blockcolsupport(A,J)
226-
muladd!(α, view(A,K,J), view(x,J), one(α), view(y,K))
227-
end
228-
end
229-
y_in
230-
end
231-
232211
@inline function _block_muladd!(α, A, X::AbstractVector, β, Y::AbstractVector)
233212
_fill_lmul!(β, Y)
234213
for N = blockcolsupport(X), K = blockcolsupport(A,N)
@@ -245,6 +224,19 @@ end
245224
Y
246225
end
247226

227+
function materialize!(M::MatMulVecAdd{<:AbstractBlockLayout,<:AbstractStridedLayout,<:AbstractStridedLayout})
228+
α, A, x_in, β, y_in = M.α, M.A, M.B, M.β, M.C
229+
if length(x_in) != size(A,2) || length(y_in) != size(A,1)
230+
throw(DimensionMismatch())
231+
end
232+
233+
# impose block structure
234+
y = PseudoBlockArray(y_in, (axes(A,1),))
235+
x = PseudoBlockArray(x_in, (axes(A,2),))
236+
_block_muladd!(α, A, x, β, y)
237+
y_in
238+
end
239+
248240
mul_blockscompatible(A, B, C) = blockisequal(axes(A,2), axes(B,1)) &&
249241
blockisequal(axes(A,1), axes(C,1)) &&
250242
blockisequal(axes(B,2), axes(C,2))
@@ -308,7 +300,6 @@ _triangular_matrix(::Val{'L'}, ::Val{'U'}, A) = UnitLowerTriangular(A)
308300
function _matchingblocks_triangular_mul!(::Val{'U'}, UNIT, A::AbstractMatrix{T}, dest) where T
309301
# impose block structure
310302
b = PseudoBlockArray(dest, (axes(A,1),))
311-
312303
for K = blockaxes(A,1)
313304
b_2 = view(b, K)
314305
= _triangular_matrix(Val('U'), UNIT, view(A, K,K))

0 commit comments

Comments
 (0)