The rank (or NumDims
) parameter of boost::multi_array
is a std::size_t
template parameter.
Is there any way to give the array a dynamic rank instead of static? I'm assuming not, looking at the code but I might have missed something.
That's not a feature of the library. You can emulate it, though:
How to dynamically set dimensionality for a boost multi_array
Here the dimensionality is not dynamic but arrays of lower dimensions are emulated by fixing the higher dimensions to 1
.
Container for boost::multi_array of same type but with different dimentionality
The latter uses variants to store a known set of dimensionalities (with unlimited shapes).