The FBM function in bigstatsr package allows us to create a 2D matrix with shared memory. For instance, FBM(5, 8) will create a 5 by 8 matrix using shared memory.
However, is there a way to create a 3D matrix with shared memory in a similar manner?
A pseudo-code will be FBM(100, 5, 6), which will give me a 3D array/matrix such that it is comprised of 100 5 x 6 2D matrices. But apparently it doesn't work, because it gives: Error in match.arg(type) : 'arg' must be NULL or a character vector
I am asking this is because if I want to update an array using foreach loop in parallel, I will have to make it a shared memory one, otherwise the foreach loop will make copies of the array and update on those copies, while leaving the original one unchanged. What I am looking for is a way to create a 3D array such that it can be updated in parallel using foreach loop.
Thanks!