I have a probably stupid question, but I am trying to define a 8x3 array (each row is an array of 3 xyz-indices of a cell, there are 8 cells in total) using boost::multi_array. My question is, is there any way shorter/simpler than typing [DIM] 8 times like this:
static const int DIM = 3;
static const int CELL = 8;
boost::multi_array<double, CELL> ii(boost::extents[DIM][DIM][DIM][DIM][DIM][DIM][DIM][DIM]);
to declare my array? Thanks a ton!
boost::extentsis just a generator, and you can use any compatible ExtentList model instead ¹:You could conceivably write your own model that doesn't require the backing storage for each dimension.
¹ See http://www.boost.org/doc/libs/1_63_0/libs/utility/Collection.html