HILA
Loading...
Searching...
No Matches
coordinates.h File Reference

This header file defines: More...

#include "plumbing/defs.h"
#include "datatypes/matrix.h"
Include dependency graph for coordinates.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CoordinateVector_t< T >
 Class for coordinate vector useful in indexing lattice. More...
 
class  X_index_type
 X-coordinate type - "dummy" class. More...
 
struct  X_plus_direction
 
struct  X_plus_offset
 X + coordinate offset, used in f[X+CoordinateVector] or f[X+dir1+dir2] etc. More...
 

Namespaces

namespace  hila
 Implement hila::swap for gauge fields.
 

Macros

#define foralldir(d)   for (Direction d = e_x; d < NDIM; ++d)
 Macro to loop over (all) Direction(s)
 

Typedefs

using dir_mask_t = unsigned char
 
using CoordinateVector = CoordinateVector_t< int >
 CoordinateVector alias for CoordinateVector_t.
 

Enumerations

enum  Direction : unsigned
 Enumerator for direction that assigns integer to direction to be interpreted as unit vector. More...
 
enum class  Parity : unsigned
 Parity enum with values EVEN, ODD, ALL; refers to parity of the site. Parity of site (x,y,z,t) is even if (x+y+z+t) is even, odd otherwise.
 

Functions

Direction operator- (const Direction d)
 unary + and -
 
int pmod (const int a, const int b)
 
CoordinateVector operator+ (const Direction d1, const Direction d2)
 Special Direction operators: dir + dir -> CoordinateVector.
 
CoordinateVector operator* (const int i, const Direction dir)
 Special operators: int*Direction -> CoordinateVector (of type int!)
 
const X_plus_direction operator+ (const X_index_type x, const Direction d)
 Declarations X+smth, no need to implement these (type removed by hilapp)
 

Variables

constexpr unsigned NDIRS = NDIRECTIONS
 Number of directions.
 
Parity constexpr aliases

Aliases for contents of Parity

constexpr Parity EVEN = Parity::even
 bit pattern: 001
 
constexpr Parity ODD = Parity::odd
 bit pattern: 010
 
constexpr Parity ALL = Parity::all
 bit pattern: 011
 

Detailed Description

This header file defines:

These are used to traverse the lattice coordinate systems

Definition in file coordinates.h.

Macro Definition Documentation

◆ foralldir

#define foralldir (   d)    for (Direction d = e_x; d < NDIM; ++d)

Macro to loop over (all) Direction(s)

Definition at line 78 of file coordinates.h.

Typedef Documentation

◆ CoordinateVector

CoordinateVector alias for CoordinateVector_t.

Definition at line 487 of file coordinates.h.

◆ dir_mask_t

using dir_mask_t = unsigned char

dir_mask_t type used in masking directions unsigned char is ok up to 4 dim (2*4 bits)

Definition at line 123 of file coordinates.h.

Enumeration Type Documentation

◆ Direction

enum Direction : unsigned

Enumerator for direction that assigns integer to direction to be interpreted as unit vector.

In NDIM \(=4\) (max dimensionality) we have:

\(\{e_x = 0, e_y = 1, e_z = 2, e_t = 3\}\)

Negative directions are defined as \( e_{-i} = \) NDIM \(\cdot2 - 1 - e_i\)

Defined as unsigned, but note that Direction + int is not defined. To operate with int, Direction must be first cast to int

Direction can be used as an array index (interchangably with int)

Definition at line 34 of file coordinates.h.

Function Documentation

◆ pmod()

int pmod ( const int  a,
const int  b 
)
inline

Positive mod(): we define here the positive mod utility function pmod(a,b). It mods the arguments 0 <= a < m. This is not the standard for integer operator% in c++, which gives negative results if a<0. This is useful in calculating lattice vector additions on a periodic box

Definition at line 251 of file coordinates.h.

Variable Documentation

◆ NDIRS

constexpr unsigned NDIRS = NDIRECTIONS
constexpr

Number of directions.

Definition at line 57 of file coordinates.h.