bigmemory icon indicating copy to clipboard operation
bigmemory copied to clipboard

Support for n-dimensional arrays?

Open noamross opened this issue 9 years ago • 2 comments

I was wondering if you would consider supporting n-dimensional arrays in your package. It seems it would be relatively straightforward to do so. ff does this, but it doesn't provide a C++-level interface that would allow me to work with ff objects from Rcpp, as bigmemory does.

noamross avatar Dec 19 '16 19:12 noamross

From when I thought of this problem, the more straightforward way to do so for me was to make a function that convert multiple indices to one: 1,1,1 -> 1 1,1,2 -> 2 etc. Did you try this? I'm interested to know the performances, even if it must really depends on the use you have. Can you provide an example?

privefl avatar Dec 20 '16 16:12 privefl

I wrote about how to do this in my dissertation. It's essentially the scheme that @privefl describes and it can be done in C++ by creating a new matrix accessor type or, in R, subclassing big.matrix and overriding the bracket operator.

kaneplusplus avatar Dec 21 '16 20:12 kaneplusplus