boundary_crossing is used for edge properties to store whether an edge goes across a lattice boundary (of a periodic lattice) in one or more dimensions. For each dimension an egde can cross either in the negative or posiove direction, where the direction is defined relatice to the (for undirected graphs artificial) choice of source and target vertex when the edge is accessed by iterating over all edges of the graph.namespace alps {
struct boundary_crossing {
typedef unsigned int dimension_type;
typedef int direction_type;
boundary_crossing();
operator bool() const;
direction_type crosses(dimension_type dim) const;
const boundary_crossing& set_crossing(dimension_type dim, direction_type dir);
const boundary_crossing& invert();
};
}
If more than one implementation should be useful, this type could be abstracted and described by a concept instead of a concrete implementation
The property object constructed by default describes an edge not crossing any boundary.boundary_crossing();
returns true if the edge crosses any boundary and false otherwise.operator bool() const;
returns +1 or -1 if the edge crosses a boundary in the dim-th dimension in the positive or negative direction and 0 if it does not cross the boundary.direction_type crosses(dimension_type dim) const;
sets the property to a crossing of the dim-th dimensional boundary in the positive direction for dir=+1, in the negative direction for dir=-1, or to no crossing for dir=0. In the current implementation dim is restricted to values between 0 and 3.const boundary_crossing& set_crossing(dimension_type dim, direction_type dir);
inverts the direction of all boundary crossings. This is the boundary crossing property for an edge going in the opposite direction.const boundary_crossing& invert();
copyright (c) 1994-2010 by Matthias Troyer
Distributed under the Boost Software License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)