12#include "../H5Exception.hpp"
25inline std::vector<size_t> squeeze(
const std::vector<size_t>& dims,
26 const std::vector<size_t>& axes) {
27 auto n_dims = dims.size();
28 auto mask = std::vector<bool>(n_dims,
false);
29 for (
size_t i = 0; i < axes.size(); ++i) {
30 if (axes[i] >= n_dims) {
31 throw Exception(
"Out of range: axes[" + std::to_string(i) +
32 "] == " + std::to_string(axes[i]) +
" >= " + std::to_string(n_dims));
38 auto squeezed_dims = std::vector<size_t>{};
39 for (
size_t i = 0; i < n_dims; ++i) {
41 squeezed_dims.push_back(dims[i]);
44 throw Exception(
"Squeezing non-unity axis: axes[" + std::to_string(i) +
45 "] = " + std::to_string(axes[i]));
Definition assert_compatible_spaces.hpp:15