If an axis is split and some dimensions are hidden and others are not, then remove the hidden axis so only the non-hidden axis is used in simplificaiton
| 1095 | // remove the hidden axis so only the non-hidden axis is used in |
| 1096 | // simplificaiton |
| 1097 | static void remove_split_hidden_axes(std::map<std::size_t, std::vector<dimension::sub*>>& axes_map) |
| 1098 | { |
| 1099 | for(auto&& p : axes_map) |
| 1100 | { |
| 1101 | auto& subs = p.second; |
| 1102 | if(std::all_of(subs.begin(), subs.end(), [](const dimension::sub* s) { |
| 1103 | return s->has_hidden_axis(); |
| 1104 | })) |
| 1105 | continue; |
| 1106 | for(auto* sub : subs) |
| 1107 | { |
| 1108 | if(not sub->has_hidden_axis()) |
| 1109 | continue; |
| 1110 | sub->hidden_axis.clear(); |
| 1111 | } |
| 1112 | // Remove the subdimesions that no longer have an axis |
| 1113 | subs.erase(std::remove_if(subs.begin(), |
| 1114 | subs.end(), |
| 1115 | [](const dimension::sub* s) { |
| 1116 | return s->axis.empty() and s->hidden_axis.empty(); |
| 1117 | }), |
| 1118 | subs.end()); |
| 1119 | } |
| 1120 | // Remove axis from group if empty |
| 1121 | erase_if(axes_map, [](auto&& p) { return p.second.empty(); }); |
| 1122 | } |
| 1123 | |
| 1124 | // Replace the hidden axis that is split with an axis that is missing |
| 1125 | static void fill_split_hidden_axes(std::map<std::size_t, std::vector<dimension::sub*>>& axes_map, |