SUNphi
1.0
|
#include <Partitioner.hpp>
Public Member Functions | |
void | unSetVol () const |
Unset the volume. | |
void | unSetSides () const |
Unset the sides. | |
bool | setVol (const Vol &v) const |
Set the volume to v . | |
bool | setSides (const Sides &s) const |
Set the sides to s . | |
const Vol & | getVol () const |
Get the volume. | |
const Sides & | getSides () const |
Get the sides. | |
const Side & | getSide (int mu) const |
Get a given side. | |
const Vol | getVolFromSides () const |
Get the volume from sides. More... | |
bool | volIsSet () const |
Check if the volume is set. | |
bool | sidesAreSet () const |
Check if the sides are set. | |
template<typename G > | |
ShadowGrid (G &&actualGrid, const char *name) | |
Constructor taking the grid and type-erasing it. More... | |
bool | operator< (const ShadowGrid &oth) const |
Comparison operator. | |
Public Attributes | |
const void * | actualGrid |
Reference to the actual grid. | |
const char * | name |
Name for debug purpose. | |
const std::function< void(const Sides &)> | setSidesOfActualGrid |
Function to invocate setting the sides of the actual grid. | |
Private Types | |
typedef std::array< Coord, NDims > | Coords |
typedef std::array< Coord, 2 *NDims > | Neigh |
typedef Idx | Vol |
typedef Coord | Side |
typedef Coords | Sides |
Private Attributes | |
std::optional< Vol > | volume |
std::optional< Coords > | sides |
Sdes of the grid. | |
A generic grid to type-erase the actual grid
While looping on all possible realization of a grid, there is little point in keeping updated the hash-table and other features of the target grid. We make a dedicated, simplified version of the grid, and work with it. We could make the Grid a dynamic polymorhic class but this way we risk to introduce severe performances degradation when calling any method (e.g. neighbors search)
Definition at line 31 of file Partitioner.hpp.
|
private |
Type to hold sizes, coordinate, etc
Definition at line 33 of file Partitioner.hpp.
|
private |
Type to hold the neighbors
Definition at line 33 of file Partitioner.hpp.
|
private |
Type to hold side
Definition at line 33 of file Partitioner.hpp.
|
private |
Type to hold sides
Definition at line 33 of file Partitioner.hpp.
|
private |
Type to hold volume
Definition at line 33 of file Partitioner.hpp.
|
inline |
Constructor taking the grid and type-erasing it.
Reads the sides
Reads the volume
Definition at line 163 of file Partitioner.hpp.
|
inline |
|
mutableprivate |
Volume of the grid, stored as optional value
Storing as optional allows to check if the value is set or not in a coincise way
Definition at line 39 of file Partitioner.hpp.