| 148 | // all subdimensions that have that axis. |
| 149 | template <class Dimensions> |
| 150 | static std::map<std::size_t, std::vector<dimension::sub*>> group_axes(Dimensions& dimensions) |
| 151 | { |
| 152 | using sub = |
| 153 | std::conditional_t<std::is_const<Dimensions>{}, const dimension::sub, dimension::sub>; |
| 154 | std::map<std::size_t, std::vector<sub*>> axes_map; |
| 155 | for_each_subdimension(dimensions, [&](auto& s) { |
| 156 | if(s.origin_axis().empty()) |
| 157 | return; |
| 158 | axes_map[s.origin_axis().front()].push_back(&s); |
| 159 | }); |
| 160 | return axes_map; |
| 161 | } |
| 162 | |
| 163 | // Renumber all axes while preserving the order of the axes |
| 164 | static void renumber_axes(std::map<std::size_t, std::vector<dimension::sub*>>& axes_map) |
no test coverage detected