I am puzzled by how to pass sub-arrays of two or higher dimensional arrays by reference. I have defined the following function
julia> function ff(a::Vector) a[1]=777; end
which sets the first element to 777. However, when I pass a subarray to this function, this change is not reflected.
julia> a = rand(2,3); ff(a[1,:]); display(a);
2×3 Array{Float64,2}:
0.42995 0.803084 0.927195
0.155134 0.335006 0.399494
How should I define a function so that changes made on sub-arrays are reflected ?