SyTen
syten::SQL::Helpers Namespace Reference

Contains helper functions for square lattices. More...

Classes

struct  InvalidCoordinate
 Thrown if an invalid coordinate is passed into a mapping function. More...
 

Typedefs

typedef Index(* MappingFunction) (int x, int y, int l, int w)
 Type of a function mapping from 2D coordinates (x,y) and a lattice size (l,w) onto a 1D offset. More...
 

Enumerations

enum class  Map {
  Z , S , M2 , Zx ,
  M2x , Spiral
}
 Valid 2D→1D mappings. More...
 

Functions

MappingFunction decideMap (Map const &m)
 Given a mapping specifier, return the appropriate mapping function. More...
 
MappingFunction decideMap (std::string const &s)
 Given a mapping specifier, return the appropriate mapping function. More...
 
void printMapping (int l, int w, int b, int s, std::function< Index(int, int)> coord, std::ostream &out)
 Print a mapping to a stream. More...
 
2D→1D mappers for different snake variants.
Index mapZ (int x, int y, int l, int w)
 Z-like map: More...
 
Index mapZx (int x, int y, int l, int w)
 Z-like map; x and y exchanged: More...
 
Index mapS (int x, int y, int l, int w)
 Snake-like map. More...
 
Index mapM2 (int x, int y, int l, int w)
 Meandering map (2 sites): More...
 
Index mapM2x (int x, int y, int l, int w)
 Meandering map flipped (2 sites): More...
 
Index mapSpiral (int x, int y, int l, int w)
 Spiral map: More...
 

Detailed Description

Contains helper functions for square lattices.