Skip to content

Commit 5e32afa

Browse files
committed
Define
1 parent 014df74 commit 5e32afa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/blocksparsearrayinterface/blocksparsearrayinterface.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ end
163163

164164
# Version of `permutedims!` that assumes the destination and source
165165
# have the same blocking.
166-
# TODO: Delete this and handle this logic in block sparse `map!`.
167-
function blocksparse_permutedims!(a_dest::AbstractArray, a_src::AbstractArray, perm)
166+
# TODO: Delete this and handle this logic in block sparse `map[!]`, define
167+
# `blockisequal_map[!]`.
168+
# TODO: Maybe define a `BlockIsEqualInterface` for these kinds of functions.
169+
function blockisequal_permutedims!(a_dest::AbstractArray, a_src::AbstractArray, perm)
168170
blocks(a_dest) .= blocks(PermutedDimsArray(a_src, perm))
169171
return a_dest
170172
end
@@ -176,7 +178,8 @@ end
176178
a::AbstractArray, perm
177179
)
178180
a_dest = similar(PermutedDimsArray(a, perm))
179-
blocksparse_permutedims!(a_dest, a, perm)
181+
# TODO: Maybe define this as `@interface BlockIsEqualInterface() permutedims!(...)`.
182+
blockisequal_permutedims!(a_dest, a, perm)
180183
return a_dest
181184
end
182185

@@ -187,7 +190,8 @@ end
187190
a_dest::AbstractArray, a_src::AbstractArray, perm
188191
)
189192
if all(blockisequal.(axes(a_dest), axes(PermutedDimsArray(a_src, perm))))
190-
blocksparse_permutedims!(a_dest, a_src, perm)
193+
# TODO: Maybe define this as `@interface BlockIsEqualInterface() permutedims!(...)`.
194+
blockisequal_permutedims!(a_dest, a_src, perm)
191195
return a_dest
192196
end
193197
@interface DefaultArrayInterface() permutedims!(a_dest, a_src, perm)

0 commit comments

Comments
 (0)