I frequently have to do things like this:
julia> x = rand(3,10)
3×10 Matrix{Float64}:
0.233999 0.217953 0.391807 0.396972 0.612708 0.344216 0.513826 0.724808 0.222591 0.668894
0.152236 0.0596347 0.297019 0.320482 0.864853 0.658225 0.72082 0.966251 0.429694 0.980746
0.181907 0.561663 0.991661 0.968927 0.800681 0.838888 0.624427 0.874867 0.818654 0.536921
julia> y = reinterpret(reshape,SVector{3,Float64},x)
10-element reinterpret(reshape, SVector{3, Float64}, ::Matrix{Float64}) with eltype SVector{3, Float64}:
[0.23399915174244423, 0.1522357683743134, 0.1819071100157874]
[0.21795312154627955, 0.059634728256461544, 0.5616633601811634]
[0.39180686893905836, 0.29701928018071544, 0.9916612904284883]
...
Is there some command that makes y
be just a Vector{SVector{3,Float64}}
, instead of carrying forever all its original type? (I mean particularly in this case, where the memory layouts are the same, as far as I understand).