3
有沒有辦法在Julia中連接ArrayViews,它不復制底層數據? (如果能解決問題,我也很樂意使用SubArray。)在Julia中連接ArrayViews(或sliceviews或SubArrays)?
例如,在下面的代碼中,我想要一個引用y1
和y2
中的數據的ArrayView。
julia> x = [1:50];
julia> using ArrayViews;
julia> y1 = view(x, 2:5);
julia> y2 = view(x, 44:48);
julia> concat(y1, y2) # I wish there were a function like this
ERROR: concat not defined
julia> [y1, y2] # This copies the data in y1 and y2, unfortunately
9-element Array{Int64,1}:
2
3
4
5
44
45
46
47
48
你看過https://github.com/tanmaykm/ChainedVectors.jl嗎? –