Skip to content

Commit 5042189

Browse files
committed
transpose/adjoint 2 time return the same
1 parent d101848 commit 5042189

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/batchedadjtrans.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515
Lazy batched transpose.
1616
"""
1717
batched_transpose(A::AbstractArray{T}) where T = BatchedTranspose(A)
18-
18+
batched_transpose(A::BatchedTranspose) = A.parent
1919

2020
"""
2121
BatchedAdjoint{T, N, S} <: AbstractBatchedMatrix{T, N}
@@ -31,7 +31,7 @@ end
3131
Lazy batched adjoint.
3232
"""
3333
batched_adjoint(A::AbstractArray{T, 3}) where T = BatchedAdjoint(A)
34-
34+
batched_adjoint(A::BatchedAdjoint) = A.parent
3535

3636
BatchedAdjoint(A) = BatchedAdjoint{Base.promote_op(adjoint,eltype(A)),typeof(A)}(A)
3737
BatchedTranspose(A) = BatchedTranspose{Base.promote_op(transpose,eltype(A)),typeof(A)}(A)

test/batchedmul.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ end
4141
@test batched_mul(batched_adjoint(cA), batched_adjoint(cB)) == bmm_adjtest(cA, cB; adjA = true, adjB = true)
4242
@test batched_mul(batched_adjoint(cA), cC) == bmm_adjtest(cA, cC; adjA = true)
4343
@test batched_mul(cA, batched_adjoint(cA)) == bmm_adjtest(cA, cA; adjB = true)
44+
45+
@test batched_transpose(batched_transpose(A)) == A
46+
@test batched_adjoint(batched_adjoint(cA)) == cA
4447
end

0 commit comments

Comments
 (0)