#include <Tensor.h>
Like this, for the 3D case; just chop off pieces for 1D and 2D:
Tensor Structure (i,j) Indices array storage of elements ----------------- ----------------- -------------------------- | x00 x01 x02 | | 0,0 0,1 0,2 | | x_m[0] x_m[3] x_m[6] | | x10 x11 x12 | | 1,0 1,1 1,2 | | x_m[1] x_m[4] x_m[7] | | x20 x21 x22 | | 2,0 2,1 2,2 | | x_m[2] x_m[5] x_m[8] |