25#ifndef GRIDCONTAINER_GRIDCONSTRUCTIONHELPER_H
26#define GRIDCONTAINER_GRIDCONSTRUCTIONHELPER_H
36namespace GridContainer {
52template <
typename... Axes>
71 result.
push_back(std::get<I - 1>(axes).size());
97 result.
push_back(std::get<I - 1>(axes).name());
165 auto& old_axis = std::get<I>(axes_tuple);
166 typename std::remove_reference<
decltype(old_axis)>::type new_axis{old_axis.name(), {old_axis[index]}};
167 std::get<I>(axes_tuple) =
std::move(new_axis);
178 template <
typename IterType,
int I>
180 auto fix_pair = fix_indices.
find(I);
181 if (fix_pair != fix_indices.
end()) {
182 iter.template fixAxisByIndex<I>(fix_pair->second);
187 template <
typename IterType>
Provides information related with an axis of a GridContainer.
GridContainer construction helper class.
static std::vector< size_t > createAxesSizesVector(const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter< 0 > &)
Method which terminates the iteration when creating the axes sizes vector.
static std::vector< std::string > createAxesNamesVector(const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter< 0 > &)
Method which terminates the iteration when creating the axes names vector.
static size_t getAxisIndexFactor(const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter<-1 > &)
Method which terminates the iteration when calculating the axis index factors.
static size_t getAxisIndexFactor(const std::tuple< GridAxis< Axes >... > &axes, const TemplateLoopCounter< I > &)
Returns the index factor of an axis.
static void fixIteratorAxes(IterType &, std::map< size_t, size_t >, const TemplateLoopCounter< sizeof...(Axes)> &)
static std::vector< size_t > createAxisIndexFactorVector(const std::tuple< GridAxis< Axes >... > &axes, const TemplateLoopCounter< I > &)
Creates a vector which contains the index factors of the given axes.
static std::vector< size_t > createAxesSizesVector(const std::tuple< GridAxis< Axes >... > &axes, const TemplateLoopCounter< I > &)
Creates a vector which contains the sizes of the given axes.
static void findAndFixAxis(std::tuple< GridAxis< Axes >... > &axes_tuple, size_t axis, size_t index, const TemplateLoopCounter< I > &)
static std::vector< std::string > createAxesNamesVector(const std::tuple< GridAxis< Axes >... > &axes, const TemplateLoopCounter< I > &)
Creates a vector which contains the names of the given axes.
static void fixIteratorAxes(IterType &iter, std::map< size_t, size_t > fix_indices, const TemplateLoopCounter< I > &)
static std::vector< size_t > createAxisIndexFactorVector(const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter< 0 > &)
Method which terminates the iteration when creating the axes index factors.
static void findAndFixAxis(std::tuple< GridAxis< Axes >... > &, size_t, size_t, const TemplateLoopCounter< sizeof...(Axes)> &)