Skip to content

Commit 16f6c08

Browse files
kshyattandyferris
authored andcommitted
Fix ctranspose bug & add test (#179)
1 parent fd21afa commit 16f6c08

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/linalg.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ end
6969
end
7070
end
7171

72-
@inline ctranspose(m::StaticMatrix) = _transpose(Size(m), m)
72+
@inline ctranspose(m::StaticMatrix) = _ctranspose(Size(m), m)
7373

7474
@generated function _ctranspose(::Size{S}, m::StaticMatrix) where {S}
7575
Snew = (S[2], S[1])

test/linalg.jl

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
@test @inferred(ctranspose(@SVector([1, 2, 3]))) === RowVector(@SVector([1, 2, 3]))
8686
@test @inferred(ctranspose(@SMatrix([1 2; 0 3]))) === @SMatrix([1 0; 2 3])
8787
@test @inferred(ctranspose(@SMatrix([1 2 3; 4 5 6]))) === @SMatrix([1 4; 2 5; 3 6])
88+
@test @inferred(ctranspose(@SMatrix([1 2*im 3; 4 5 6]))) === @SMatrix([1 4; -2*im 5; 3 6])
8889
end
8990

9091
@testset "vcat() and hcat()" begin

0 commit comments

Comments
 (0)