Alexandria
2.16
Please provide a description of the project.
|
Go to the documentation of this file.
25 #ifndef GRIDCONTAINER_GRIDCONTAINER_H
26 #define GRIDCONTAINER_GRIDCONTAINER_H
32 #include <type_traits>
38 namespace GridContainer {
96 template<
typename GridCellManager,
typename... AxesTypes>
115 template<
typename CellType>
388 template<
typename GridCellManager,
typename... AxesTypes>
389 template<
typename CellType>
492 template<
typename OtherIter>
GridContainer(std::tuple< GridAxis< AxesTypes >... > axes_tuple)
Constructs a GridContainer with the given axes.
bool operator==(const iter &other) const
cell_type & operator()(decltype(std::declval< GridAxis< AxesTypes >>().size())... indices)
(decltype(std::declval<GridAxis<AxesTypes>>().size())...) const
typename std::tuple_element< I, std::tuple< AxesTypes... > >::type axis_type
std::tuple< GridAxis< AxesTypes >... > m_axes_fixed
a tuple containing the original axes of the full grid, if this grid is a slice
iter(const GridContainer< GridCellManager, AxesTypes... > &owner, const cell_manager_iter_type &data_iter)
Constructs a new iterator for the given grid.
GridIndexHelper< AxesTypes... > m_index_helper_fixed
a helper class for calculations of the original axes indices
static std::unique_ptr< GridCellManager > factory(size_t size)
Provides information related with an axis of a GridContainer.
iter(iter< CellType > &&)=default
Move constructor.
const cell_type & operator()(decltype(std::declval< GridAxis< AxesTypes >>().size())... indices) const
GridContainer(GridContainer< GridCellManager, AxesTypes... > &&)=default
Default move constructor and move assignment operator.
Representation of a multi-dimensional grid which contains axis information.
const_iterator end() const
Returns an iterator to the cell after the last of the grid.
void forwardToIndex(size_t axis, size_t fixed_index)
Class to iterate through the GridContainer cells.
GridContainer construction helper class.
Helper class for converting multi-dimensional grid coordinates to the index of a long data array and ...
CellType & operator*()
Returns a reference to the cell value.
GridCellManager::iterator iterator
GridContainer(const GridContainer< GridCellManager, AxesTypes... > &other, size_t axis, size_t index)
Slice constructor.
const axis_type< I > & axisValue() const
GridCellManagerTraits< GridCellManager >::data_type cell_type
The type of the values stored in the grid cells.
iterator end()
Returns an iterator to the cell after the last of the grid.
virtual ~GridContainer()=default
Default destructor.
iterator begin()
Returns an iterator to the first cell of the grid.
GridIndexHelper< AxesTypes... > m_index_helper
A helper class used for calculations of the axes indices.
static constexpr size_t axisNumber()
Returns the number of axes of the grid (dimensionality)
GridContainer(const GridContainer< GridCellManager, AxesTypes... > &)=delete
std::add_const< CellType >::type & operator*() const
Returns a reference to the cell value (const version)
const GridContainer< GridCellManager, AxesTypes... > fixAxisByValue(const axis_type< I > &value) const
const version of the fixAxisByValue(const axis_type<I>&) method
iter & fixAllAxes(const OtherIter &other)
const GridAxis< axis_type< I > > & getOriginalAxis() const
bool operator!=(const iter &other) const
iter & fixAxisByIndex(size_t index)
std::tuple< GridAxis< AxesTypes >... > m_axes
A tuple containing the axes of the grid.
std::map< size_t, size_t > m_fixed_indices
A map containing the axes which have been fixed, if this grid is a slice.
const std::tuple< GridAxis< AxesTypes >... > & getAxesTuple() const
Returns a tuple containing the information of all the grid axes.
iter(const iter< CellType > &)=default
Copy constructor.
const_iterator begin() const
Returns an iterator to the first cell of the grid.
cell_type & at(decltype(std::declval< GridAxis< AxesTypes >>().size())... indices)
GridContainer< GridCellManager, AxesTypes... > fixAxisByValue(const axis_type< I > &value)
Returns a slice of the grid based on an axis value.
const GridContainer< GridCellManager, AxesTypes... > fixAxisByIndex(size_t index) const
const version of the fixAxisByIndex(size_t) method
std::tuple< GridAxis< AxesTypes >... > AxesTuple
The type of the tuple keeping the axes of the grid.
iter & fixAxisByValue(const axis_type< I > &value)
iter< cell_type const > const_iterator
std::add_const< CellType >::type * operator->() const
Returns a pointer to the cell value (const version)
cell_manager_iter_type m_data_iter
iter< cell_type > iterator
iter & operator=(const iter &other)
Copy operator of the iterator.
CellType * operator->()
Returns a pointer to the cell value.
const GridAxis< axis_type< I > > & getAxis() const
size_t size() const
Returns the total number of cells of the grid.
const_iterator cbegin()
Returns a constant iterator to the first cell of the grid.
const_iterator cend()
Returns a constant iterator to the cell after the last of the grid.
std::map< size_t, size_t > m_fixed_indices
GridContainer & operator=(GridContainer< GridCellManager, AxesTypes... > &&)=default
const GridContainer< GridCellManager, AxesTypes... > & m_owner
GridContainer< GridCellManager, AxesTypes... > fixAxisByIndex(size_t index)
Returns a slice of the grid based on an axis index.
GridCellManagerTraits< GridCellManager >::iterator cell_manager_iter_type
std::shared_ptr< GridCellManager > m_cell_manager
A pointer to the data of the grid.
GridContainer & operator=(const GridContainer< GridCellManager, AxesTypes... > &)=delete
const cell_type & at(decltype(std::declval< GridAxis< AxesTypes >>().size())... indices) const
iter & operator++()
Moves the iterator to the next grid cell.
GridCellManager::data_type data_type
The type of the data kept by the GridCellManager.
GridContainer(GridAxis< AxesTypes >... axes)
Constructs a GridContainer with the given axes.