#ifndef __MultiArrayRotation_h__ #define __MultiArrayRotation_h__ #include using namespace std; #include "boost/multi_array/types.hpp" #include "boost/array.hpp" #include "boost/multi_array/algorithm.hpp" #include #include #include #include #include namespace boost { class cyclic_storage_order { typedef detail::multi_array::size_type size_type; public: cyclic_storage_order( const std::size_t shift ) :shift_(shift) {} template operator general_storage_order() const { boost::array ordering; boost::array ascending; for (size_type i=0; i != NumDims; ++i) { ordering[i] = (i+shift_)%NumDims; ascending[i] = true; } return general_storage_order(ordering.begin(), ascending.begin()); } private: std::size_t shift_; }; } #endif // __MultiArrayRotation_h__