Skip to content

Commit 8c3e66f

Browse files
committed
foreachblock
1 parent 410c650 commit 8c3e66f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tensors/diagonal.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,16 @@ end
282282

283283
function LinearAlgebra.lmul!(D::DiagonalTensorMap, t::AbstractTensorMap)
284284
domain(D) == codomain(t) || throw(SpaceMismatch())
285-
for (c, b) in blocks(t)
286-
lmul!(block(D, c), b)
285+
foreachblock(D, t) do c, bs
286+
lmul!(bs...)
287287
end
288288
return t
289289
end
290290

291291
function LinearAlgebra.rmul!(t::AbstractTensorMap, D::DiagonalTensorMap)
292292
codomain(D) == domain(t) || throw(SpaceMismatch())
293-
for (c, b) in blocks(t)
294-
rmul!(b, block(D, c))
293+
foreachblock(t, D) do c, bs
294+
rmul!(bs...)
295295
end
296296
return t
297297
end

0 commit comments

Comments
 (0)