File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 66
66
@generated function _transpose (:: Size{S} , m:: StaticMatrix ) where {S}
67
67
Snew = (S[2 ], S[1 ])
68
68
69
- exprs = [:(m[$ (LinearIndices (S)[j1, j2])]) for j2 = 1 : S[2 ], j1 = 1 : S[1 ]]
69
+ exprs = [:(transpose ( m[$ (LinearIndices (S)[j1, j2])]) ) for j2 = 1 : S[2 ], j1 = 1 : S[1 ]]
70
70
71
71
return quote
72
72
$ (Expr (:meta , :inline ))
84
84
@generated function _adjoint (:: Size{S} , m:: StaticMatrix ) where {S}
85
85
Snew = (S[2 ], S[1 ])
86
86
87
- exprs = [:(conj (m[$ (LinearIndices (S)[j1, j2])])) for j2 = 1 : S[2 ], j1 = 1 : S[1 ]]
87
+ exprs = [:(adjoint (m[$ (LinearIndices (S)[j1, j2])])) for j2 = 1 : S[2 ], j1 = 1 : S[1 ]]
88
88
89
89
return quote
90
90
$ (Expr (:meta , :inline ))
Original file line number Diff line number Diff line change @@ -121,6 +121,13 @@ using StaticArrays, Compat.Test
121
121
@test @inferred (adjoint (@SMatrix ([1 2 ; 0 3 ]))) === @SMatrix ([1 0 ; 2 3 ])
122
122
@test @inferred (adjoint (@SMatrix ([1 2 3 ; 4 5 6 ]))) === @SMatrix ([1 4 ; 2 5 ; 3 6 ])
123
123
@test @inferred (adjoint (@SMatrix ([1 2 * im 3 ; 4 5 6 ]))) === @SMatrix ([1 4 ; - 2 * im 5 ; 3 6 ])
124
+
125
+ m = [1 2 ; 3 4 ] + im* [5 6 ; 7 8 ]
126
+ @test @inferred (adjoint (@SVector [m,m])) == ctranspose ([m,m])
127
+ @test @inferred (transpose (@SVector [m,m])) == transpose ([m,m])
128
+ @test @inferred (adjoint (@SMatrix [m m; m m])) == ctranspose ([[m] [m]; [m] [m]])
129
+ @test @inferred (transpose (@SMatrix [m m; m m])) == transpose ([[m] [m]; [m] [m]])
130
+
124
131
end
125
132
126
133
@testset " vcat() and hcat()" begin
You can’t perform that action at this time.
0 commit comments