To my understanding if I dont want to copy a part of and array a use view, like this:
julia> a=rand(4,4)
4×4 Array{Float64,2}:
0.256046 0.0541067 0.0618461 0.657153
0.968974 0.652169 0.783263 0.323621
0.543603 0.529372 0.698797 0.255175
0.0671429 0.470615 0.148772 0.0287616
julia> b=view(a,:,2)
4-element SubArray{Float64,1,Array{Float64,2},Tuple{Colon,Int64},true}:
0.0541067
0.652169
0.529372
0.470615
extracting a column has collapsed the dimension of the array from 2 to 1 and I get a monodimensional vector, which is nice as vectors behave as columns. But if i try to extract a row:
julia> c=view(a,2,: )
4-element SubArray{Float64,1,Array{Float64,2},Tuple{Int64,Colon},true}:
0.968974
0.652169
0.783263
0.323621
I still get a monodimensional ‘column’ vector , yes I can transpose:
julia> c=view(a,2,:)’
1×4 Array{Float64,2}:
0.968974 0.652169 0.783263 0.323621
but this way I get a copy loosing the purpose of getting a view