Permute operation


#1

Hi,

I’m looking for an operation which rearranges dimensions like “permute” in Matlab.

Thank you!

-MJ


#2

Dear MJ,

I’m sorry, I misunderstood Matlab’s permute–please disregard my lookup example. It’s just a generalized transpose.

One may use redimension for this. For example:

store(build(<v:double>[i=1:10,10,0,j=1:5,5,0,k=1:3,3,0],i+j+k),x)
redimension(x, <v:double>[j=1:5,5,0,k=1:3,3,0,i=1:10,10,0])

Another approach would be to make a UDO that generalizes SciDB’s transpose to more than two dimensions, which will be faster than running redimension in general.

Best,

Bryan