Hi all,

With a function like this...

function demo()
       A = ones(350,350,25000)
       return A[1:175, 1:175, :],  A[1:175, 176:end, :]
end

is there a memory-efficient (in-place I guess) way to store the return 
values while having A deallocated, if I can fit A in memory, but not both A 
and the return values?

Using subarrays acheives the desired functionality, but all of A needs to 
be kept in memory:

function demo2()
       A = ones(350,350,25000)
       return slice(A, 1:175, 1:175, :),  slice(A, 1:175, 176:350, :)
end

Thanks,
Gord

Reply via email to