Skip to content

Commit de0885e

Browse files
committed
use more tuple style in _transblockmul
1 parent f44d26a commit de0885e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/blockmap.jl

+9-8
Original file line numberDiff line numberDiff line change
@@ -319,18 +319,19 @@ end
319319

320320
@inline function _transblockmul!(y, A::BlockMap, x, α, β, transform)
321321
maps, rows, xinds, yinds = A.maps, A.rows, A.rowranges, A.colranges
322-
mapind = 0
323-
# first block row (rowind = 1) of A, meaning first block column of A', fill all of y
324322
@views @inbounds begin
325-
xcol = selectdim(x, 1, xinds[1])
326-
for colind in 1:rows[1]
327-
mapind +=1
328-
mul!(selectdim(y, 1, yinds[mapind]), transform(maps[mapind]), xcol, α, β)
323+
# first block row (rowind = 1) of A, meaning first block column of A', fill all of y
324+
xcol = selectdim(x, 1, first(xinds))
325+
for rowind in 1:first(rows)
326+
mul!(selectdim(y, 1, yinds[rowind]), transform(maps[rowind]), xcol, α, β)
329327
end
330-
# subsequent block rows of A, add results to corresponding parts of y
328+
mapind = first(rows)
329+
# subsequent block rows of A (block columns of A'),
330+
# add results to corresponding parts of y
331+
# TODO: think about multithreading
331332
for rowind in 2:length(rows)
332333
xcol = selectdim(x, 1, xinds[rowind])
333-
for colind in 1:rows[rowind]
334+
for _ in 1:rows[rowind]
334335
mapind +=1
335336
mul!(selectdim(y, 1, yinds[mapind]), transform(maps[mapind]), xcol, α, true)
336337
end

0 commit comments

Comments
 (0)