Ryan McConnehey <mccorywork <at> gmail.com> writes:
Do you have an example of how shape() works? The shape method isn't used in any of the multi-array tutorials. Also, the reference material says the shape method returns a list of "NumDims" but the return signature specifies a "const size_type *" is returned. How is "const size_type *" a list of dimension?
Since it is not a container, you will need to use the ::dimensionality to see how far to iterate this bare pointer. e.g. to put it into a bounded ublas vector vector: const static std::size_t rank = ublas::multi_array<double, 3>::dimensionality; //Or just 3 in this case... Showing you this could work in generic code ublas::bounded_vector<std::size_t, rank> dims; std::copy(var.shape(), var.shape() + rank, dims.begin());