Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Euclid::GridContainer::GridConstructionHelper< Axes > Class Template Reference

GridContainer construction helper class. More...

#include <GridConstructionHelper.h>

Static Public Member Functions

template<int I>
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 std::vector< size_t > createAxesSizesVector (const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter< 0 > &)
 Method which terminates the iteration when creating the axes sizes vector.
 
template<int I>
static std::vector< std::stringcreateAxesNamesVector (const std::tuple< GridAxis< Axes >... > &axes, const TemplateLoopCounter< I > &)
 Creates a vector which contains the names of the given axes.
 
static std::vector< std::stringcreateAxesNamesVector (const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter< 0 > &)
 Method which terminates the iteration when creating the axes names vector.
 
template<int I>
static size_t getAxisIndexFactor (const std::tuple< GridAxis< Axes >... > &axes, const TemplateLoopCounter< I > &)
 Returns the index factor of an axis.
 
static size_t getAxisIndexFactor (const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter<-1 > &)
 Method which terminates the iteration when calculating the axis index factors.
 
template<int I>
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 > createAxisIndexFactorVector (const std::tuple< GridAxis< Axes >... > &, const TemplateLoopCounter< 0 > &)
 Method which terminates the iteration when creating the axes index factors.
 
template<int I>
static void findAndFixAxis (std::tuple< GridAxis< Axes >... > &axes_tuple, size_t axis, size_t index, const TemplateLoopCounter< I > &)
 
static void findAndFixAxis (std::tuple< GridAxis< Axes >... > &, size_t, size_t, const TemplateLoopCounter< sizeof...(Axes)> &)
 
template<typename IterType , int I>
static void fixIteratorAxes (IterType &iter, std::map< size_t, size_t > fix_indices, const TemplateLoopCounter< I > &)
 
template<typename IterType >
static void fixIteratorAxes (IterType &, std::map< size_t, size_t >, const TemplateLoopCounter< sizeof...(Axes)> &)
 

Detailed Description

template<typename... Axes>
class Euclid::GridContainer::GridConstructionHelper< Axes >

GridContainer construction helper class.

The GridConstructionHelper is a helper class, which provides functions which use iteration over variadic templates to construct some collections required during the construction of the GridContainer class. It is meant to be used by the GridContainer constructor. For a helper class with similar behavior to be used outside the GridContainer class see the GridIndexHelper class.

Template Parameters
Axesthe types of the axes

Definition at line 53 of file GridConstructionHelper.h.

Member Function Documentation

◆ createAxesNamesVector() [1/2]

template<typename... Axes>
static std::vector< std::string > Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesNamesVector ( const std::tuple< GridAxis< Axes >... > &  ,
const TemplateLoopCounter< 0 > &   
)
inlinestatic

Method which terminates the iteration when creating the axes names vector.

Definition at line 102 of file GridConstructionHelper.h.

◆ createAxesNamesVector() [2/2]

template<typename... Axes>
template<int I>
static std::vector< std::string > Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesNamesVector ( const std::tuple< GridAxis< Axes >... > &  axes,
const TemplateLoopCounter< I > &   
)
inlinestatic

Creates a vector which contains the names of the given axes.

Note that this method is using variadic template iteration by using the second parameter (TemplateLoopCounter). To initiate the iteration the counter must be equal with the number of axes in the tuple.

Template Parameters
Ithe index of the axis until which the results are calculated
Parameters
axesA tuple containing the GridAxis objects describing the axes
Returns
A vector containing the names of the axes

Definition at line 94 of file GridConstructionHelper.h.

References Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesNamesVector(), and std::vector< T >::push_back().

Referenced by Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesNamesVector().

Here is the call graph for this function:

◆ createAxesSizesVector() [1/2]

template<typename... Axes>
static std::vector< size_t > Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesSizesVector ( const std::tuple< GridAxis< Axes >... > &  ,
const TemplateLoopCounter< 0 > &   
)
inlinestatic

Method which terminates the iteration when creating the axes sizes vector.

Definition at line 76 of file GridConstructionHelper.h.

◆ createAxesSizesVector() [2/2]

template<typename... Axes>
template<int I>
static std::vector< size_t > Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesSizesVector ( const std::tuple< GridAxis< Axes >... > &  axes,
const TemplateLoopCounter< I > &   
)
inlinestatic

Creates a vector which contains the sizes of the given axes.

Note that this method is using variadic template iteration by using the second parameter (TemplateLoopCounter). To initiate the iteration the counter must be equal with the number of axes in the tuple.

Template Parameters
Ithe index of the axis until which the results are calculated
Parameters
axesA tuple containing the GridAxis objects describing the axes
Returns
A vector containing the sizes of the axes

Definition at line 68 of file GridConstructionHelper.h.

References Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesSizesVector(), and std::vector< T >::push_back().

Referenced by Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesSizesVector().

Here is the call graph for this function:

◆ createAxisIndexFactorVector() [1/2]

template<typename... Axes>
static std::vector< size_t > Euclid::GridContainer::GridConstructionHelper< Axes >::createAxisIndexFactorVector ( const std::tuple< GridAxis< Axes >... > &  ,
const TemplateLoopCounter< 0 > &   
)
inlinestatic

Method which terminates the iteration when creating the axes index factors.

Definition at line 156 of file GridConstructionHelper.h.

◆ createAxisIndexFactorVector() [2/2]

template<typename... Axes>
template<int I>
static std::vector< size_t > Euclid::GridContainer::GridConstructionHelper< Axes >::createAxisIndexFactorVector ( const std::tuple< GridAxis< Axes >... > &  axes,
const TemplateLoopCounter< I > &   
)
inlinestatic

Creates a vector which contains the index factors of the given axes.

For an explanation of the index factor see the documentation of the getAxisIndexFactor method. The returned vector has size one bigger than the number of axes. The last element contains the total size of the required single dimensional array to keep the data. Note that this method is using variadic template iteration by using the second parameter (TemplateLoopCounter). To initiate the iteration the counter must be equal with the number of axes in the tuple.

Template Parameters
Ithe index of the axis until which the results are calculated
Parameters
axesA tuple containing the GridAxis objects describing the axes
Returns
A vector containing the index factors of the axes

Definition at line 148 of file GridConstructionHelper.h.

References Euclid::GridContainer::GridConstructionHelper< Axes >::createAxisIndexFactorVector(), Euclid::GridContainer::GridConstructionHelper< Axes >::getAxisIndexFactor(), and std::vector< T >::push_back().

Referenced by Euclid::GridContainer::GridConstructionHelper< Axes >::createAxisIndexFactorVector().

Here is the call graph for this function:

◆ findAndFixAxis() [1/2]

template<typename... Axes>
static void Euclid::GridContainer::GridConstructionHelper< Axes >::findAndFixAxis ( std::tuple< GridAxis< Axes >... > &  ,
size_t  ,
size_t  ,
const TemplateLoopCounter< sizeof...(Axes)> &   
)
inlinestatic

Definition at line 173 of file GridConstructionHelper.h.

◆ findAndFixAxis() [2/2]

template<typename... Axes>
template<int I>
static void Euclid::GridContainer::GridConstructionHelper< Axes >::findAndFixAxis ( std::tuple< GridAxis< Axes >... > &  axes_tuple,
size_t  axis,
size_t  index,
const TemplateLoopCounter< I > &   
)
inlinestatic

◆ fixIteratorAxes() [1/2]

template<typename... Axes>
template<typename IterType >
static void Euclid::GridContainer::GridConstructionHelper< Axes >::fixIteratorAxes ( IterType &  ,
std::map< size_t, size_t >  ,
const TemplateLoopCounter< sizeof...(Axes)> &   
)
inlinestatic

Definition at line 188 of file GridConstructionHelper.h.

◆ fixIteratorAxes() [2/2]

template<typename... Axes>
template<typename IterType , int I>
static void Euclid::GridContainer::GridConstructionHelper< Axes >::fixIteratorAxes ( IterType &  iter,
std::map< size_t, size_t >  fix_indices,
const TemplateLoopCounter< I > &   
)
inlinestatic

◆ getAxisIndexFactor() [1/2]

template<typename... Axes>
static size_t Euclid::GridContainer::GridConstructionHelper< Axes >::getAxisIndexFactor ( const std::tuple< GridAxis< Axes >... > &  ,
const TemplateLoopCounter<-1 > &   
)
inlinestatic

Method which terminates the iteration when calculating the axis index factors.

Definition at line 127 of file GridConstructionHelper.h.

◆ getAxisIndexFactor() [2/2]

template<typename... Axes>
template<int I>
static size_t Euclid::GridContainer::GridConstructionHelper< Axes >::getAxisIndexFactor ( const std::tuple< GridAxis< Axes >... > &  axes,
const TemplateLoopCounter< I > &   
)
inlinestatic

Returns the index factor of an axis.

The index factor of an axis is the step needed to be done in the single dimensional array to move to the next element of the axis. It is equal to the multiplication of the sizes of all the axes which have faster iteration rate. Its purpose is to facilitate the conversion of multi- dimensional coordinates to the index of a long array.

Template Parameters
Ithe index of the axis to get the factor for
Parameters
axesThe axes to use for the calculation
Returns
The index factor of the Ith axis

Definition at line 122 of file GridConstructionHelper.h.

References Euclid::GridContainer::GridConstructionHelper< Axes >::getAxisIndexFactor().

Referenced by Euclid::GridContainer::GridConstructionHelper< Axes >::createAxisIndexFactorVector(), and Euclid::GridContainer::GridConstructionHelper< Axes >::getAxisIndexFactor().

Here is the call graph for this function:

The documentation for this class was generated from the following file: