On Mon, May 04 2015, Maco Anshu <[email protected]> wrote:

> I just found this discussion on SO and it was very helpful:
> http://stackoverflow.com/questions/28271308/avoid-memory-allocation-when-indexing-an-array-in-julia
>
>
> Julia allocates a new array on indexing every time.

Strictly speaking, no: singleton indexes like x[1,2] just extract the
element.

See https://github.com/JuliaLang/ArrayViews.jl for an alternative
that does not copy.

> Here is how to achieve it if someone is trying to figure the same thing out

It is documented in the manual, so you don't need to experiment.

Best,

Tamas

Reply via email to