File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -144,12 +144,12 @@ end
144144@inline to_vec (x:: Number ) = x
145145@inline to_vecs (rowvecs... ) = (map (to_vec, rowvecs)... )
146146
147- # map
148- @inline map (f, rowvecs:: RowVector... ) = RowVector (map (f , to_vecs (rowvecs... )... ))
147+ # map: Preserve the RowVector, but note that `f` expects transposed elements
148+ @inline map (f, rowvecs:: RowVector... ) = RowVector (map (transpose ∘ f ∘ transpose , to_vecs (rowvecs... )... ))
149149
150150# broacast (other combinations default to higher-dimensional array)
151151@inline broadcast (f, rowvecs:: Union{Number,RowVector} ...) =
152- RowVector (broadcast (f , to_vecs (rowvecs... )... ))
152+ RowVector (broadcast (transpose ∘ f ∘ transpose , to_vecs (rowvecs... )... ))
153153
154154# Horizontal concatenation #
155155
Original file line number Diff line number Diff line change 249249 @test A' * x' == A' * y == B* x' == B* y == C'
250250 end
251251end
252+
253+ @testset " issue #20979" begin
254+ f20979 (z:: Complex ) = [z. re - z. im; z. im z. re]
255+ v = [1 + 2im ]'
256+ @test (f20979 .(v))[1 ] == f20979 (v[1 ])
257+ @test f20979 .(v) == f20979 .(collect (v))
258+
259+ w = rand (Complex128, 3 )
260+ @test f20979 .(v' ) == f20979 .(collect (v' )) == (f20979 .(v))'
261+ end
You can’t perform that action at this time.
0 commit comments