Skip to content

Commit

Permalink
Fix ctranspose bug & add test (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and andyferris committed May 24, 2017
1 parent fd21afa commit 16f6c08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ end
end
end

@inline ctranspose(m::StaticMatrix) = _transpose(Size(m), m)
@inline ctranspose(m::StaticMatrix) = _ctranspose(Size(m), m)

@generated function _ctranspose(::Size{S}, m::StaticMatrix) where {S}
Snew = (S[2], S[1])
Expand Down
1 change: 1 addition & 0 deletions test/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
@test @inferred(ctranspose(@SVector([1, 2, 3]))) === RowVector(@SVector([1, 2, 3]))
@test @inferred(ctranspose(@SMatrix([1 2; 0 3]))) === @SMatrix([1 0; 2 3])
@test @inferred(ctranspose(@SMatrix([1 2 3; 4 5 6]))) === @SMatrix([1 4; 2 5; 3 6])
@test @inferred(ctranspose(@SMatrix([1 2*im 3; 4 5 6]))) === @SMatrix([1 4; -2*im 5; 3 6])
end

@testset "vcat() and hcat()" begin
Expand Down

0 comments on commit 16f6c08

Please sign in to comment.