The source vector is a column of x and the destination vector is a different column of x. There is nothing in the documentation or source code that says that the base array can’t be the same. Seems to defeat the purpose for some common cases. See the example.
It’s easy enough to use the non-inplace version.
Well, it doesn’t work when I do an example with x and y–different base arrays. It appears that it doesn’t like slices for some reason. Is there something about slices that makes the implementation infeasible?
Example:
julia> x = [collect(1:5) collect(4:8) zeros(Int,5)]
5×3 Array{Int64,2}:
1 4 0
2 5 0
3 6 0
4 7 0
5 8 0
julia> display(x)
5×3 Array{Int64,2}:
1 4 0
2 5 0
3 6 0
4 7 0
5 8 0
julia> cumsum!(x[:,3], x[:,2], dims=1)
5-element Array{Int64,1}:
4
9
15
22
30
julia> x
5×3 Array{Int64,2}:
1 4 0
2 5 0
3 6 0
4 7 0
5 8 0