Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:07

0001 /*
0002  *  Copyright (c), 2024, BlueBrain Project, EPFL
0003  *
0004  *  Distributed under the Boost Software License, Version 1.0.
0005  *    (See accompanying file LICENSE_1_0.txt or copy at
0006  *          http://www.boost.org/LICENSE_1_0.txt)
0007  *
0008  */
0009 #pragma once
0010 
0011 #include <vector>
0012 #include "../H5Exception.hpp"
0013 #include "../H5DataSpace.hpp"
0014 
0015 namespace HighFive {
0016 namespace detail {
0017 
0018 inline void assert_compatible_spaces(const DataSpace& old, const std::vector<size_t>& dims) {
0019     auto n_elements_old = old.getElementCount();
0020     auto n_elements_new = dims.empty() ? 1 : compute_total_size(dims);
0021 
0022     if (n_elements_old != n_elements_new) {
0023         throw Exception("Invalid parameter `new_dims` number of elements differ: " +
0024                         std::to_string(n_elements_old) + " (old) vs. " +
0025                         std::to_string(n_elements_new) + " (new)");
0026     }
0027 }
0028 }  // namespace detail
0029 }  // namespace HighFive