Skip to content

Commit d77bb13

Browse files
committed
Unify naming: permutedimsopadd! biperm overload, permutedimsop, bipermutedims! via permutedimsopadd!
1 parent 4aaf3f8 commit d77bb13

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/matricize.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ function matricize_axes(a::AbstractArray, ndims_codomain::Val)
124124
end
125125

126126
"""
127-
bipermutedimsop(op, src, perm_codomain, perm_domain)
127+
permutedimsop(op, src, perm_codomain, perm_domain)
128128
129129
Non-mutating version of bipermutation `permutedimsopadd!`: returns
130130
`op.(permutedims(src, (perm_codomain..., perm_domain...)))`. Has "maybe alias"
131131
semantics — the result may be a view/wrapper aliasing `src` or a fresh copy.
132132
"""
133-
function bipermutedimsop(op, src::AbstractArray, perm_codomain, perm_domain)
133+
function permutedimsop(op, src::AbstractArray, perm_codomain, perm_domain)
134134
perm = (perm_codomain..., perm_domain...)
135135
dest = similar(src, map(i -> size(src, i), perm))
136136
return permutedimsopadd!(dest, op, src, perm_codomain, perm_domain, true, false)
@@ -142,10 +142,10 @@ end
142142
# TODO: Deprecate `permuteblockeddims` in favor of `bipermutedims`.
143143
# Keeping it here for backwards compatibility.
144144
function bipermutedims(a::AbstractArray, perm1, perm2)
145-
return bipermutedimsop(identity, a, perm1, perm2)
145+
return permutedimsop(identity, a, perm1, perm2)
146146
end
147147
function bipermutedims!(a_dest::AbstractArray, a_src::AbstractArray, perm1, perm2)
148-
return _permutedims!(a_dest, a_src, (perm1..., perm2...))
148+
return permutedimsopadd!(a_dest, identity, a_src, perm1, perm2, true, false)
149149
end
150150
function bipermutedims(a::AbstractArray, biperm::AbstractBlockPermutation{2})
151151
return bipermutedims(a, blocks(biperm)...)
@@ -259,7 +259,7 @@ function matricizeop(
259259
)
260260
ndims(a) == length(perm_codomain) + length(perm_domain) ||
261261
throw(ArgumentError("Invalid bipermutation"))
262-
a_perm_op = bipermutedimsop(op, a, perm_codomain, perm_domain)
262+
a_perm_op = permutedimsop(op, a, perm_codomain, perm_domain)
263263
return matricize(style, a_perm_op, Val(length(perm_codomain)))
264264
end
265265

0 commit comments

Comments
 (0)