Any advice on how to broadcast vectors of SVector
s in Julia 0.7?
eg:
julia> using StaticArrays
julia> const Vec = SVector{3, Float64}
SArray{Tuple{3},Float64,1,3}
julia> a=[Vec(i,i,i) for i in 1:5]
5-element Array{SArray{Tuple{3},Float64,1,3},1}:
[1.0, 1.0, 1.0]
[2.0, 2.0, 2.0]
[3.0, 3.0, 3.0]
[4.0, 4.0, 4.0]
[5.0, 5.0, 5.0]
julia> a .+ Vec(2,2,2)
ERROR: DimensionMismatch("arrays could not be broadcast to a common size")
Stacktrace:
[1] _bcs1 at ./broadcast.jl:444 [inlined]
[2] _bcs at ./broadcast.jl:438 [inlined]
[3] broadcast_shape at ./broadcast.jl:432 [inlined]
[4] combine_axes at ./broadcast.jl:427 [inlined]
[5] instantiate at ./broadcast.jl:266 [inlined]
[6] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(+),Tuple{Array{SArray{Tuple{3},Float64,1,3},1},SArray{Tuple{3},Float64,1,3}}}) at ./broadcast.jl:729
[7] top-level scope at none:0
Or is this just some crazy dream?