22 #ifndef ANTARES_SOLVER_VARIABLE_COMMONS_HOUR_UTILS_H
23 #define ANTARES_SOLVER_VARIABLE_COMMONS_HOUR_UTILS_H
27 #include <type_traits>
29 namespace Antares::Solver::Variable::Util
33 concept HourlySeries = requires(T t,
unsigned y) {
34 { t.series.getColumn(y) } -> std::convertible_to<const double*>;
35 { t.series.timeSeries.height } -> std::convertible_to<size_t>;
38 template<
class Ptr,
class F>
39 inline void for_each_hour(
const Ptr data,
size_t n, F&& f) noexcept
41 for (
size_t h = 0; h < n; ++h)
47 template<
class Container,
class F>
48 inline void for_each_hour(Container& c, F&& f) noexcept(noexcept(f(
size_t{}, *c.data())))
50 for (
size_t h = 0; h < c.size(); ++h)
56 template<
class Range,
class F>
57 inline void transform_in_place(Range&& r, F&& f) noexcept(noexcept(f(*r.begin())))