namespace alps {
template <class LATTICE, class GRAPH>
void make_graph_from_lattice(GRAPH& g,const LATTICE& l);
template <class LATTICE, class GRAPH>
class lattice_graph : public LATTICE
{
public:
typedef LATTICE base_type;
typedef GRAPH graph_type;
typedef typename lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef typename lattice_traits<base_type>::offset_type offset_type;
typedef typename lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef typename lattice_traits<base_type>::vector_type vector_type;
typedef typename lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;
typedef typename lattice_traits<base_type>::cell_iterator cell_iterator;
typedef typename lattice_traits<base_type>::boundary_crossing_type boundary_crossing_type;
typedef typename boost::graph_traits<graph_type>::vertex_iterator vertex_iterator;
typedef typename boost::graph_traits<graph_type>::edge_iterator edge_iterator;
lattice_graph();
template <class L>
lattice_graph(const L&);
const graph_type& graph() const { return graph_;}
graph_type& graph() { return graph_;}
};
template <class L, class G>
struct lattice_traits<lattice_graph<L,G> >
{
typedef typename lattice_graph<L,G>::unit_cell_type unit_cell_type;
typedef typename lattice_graph<L,G>::cell_descriptor cell_descriptor;
typedef typename lattice_graph<L,G>::offset_type offset_type;
typedef typename lattice_graph<L,G>::basis_vector_iterator basis_vector_iterator;
typedef typename lattice_graph<L,G>::cell_iterator cell_iterator;
typedef typename lattice_graph<L,G>::size_type size_type;
typedef typename lattice_graph<L,G>::vector_type vector_type;
typedef typename lattice_graph<L,G>::boundary_crossing_type boundary_crossing_type;
};
}
creates a graph from a lattice l that is a model of FiniteLattice and of CoordinateLattice. The unitcell of the graph has to be a model of GraphUnitCell. The graph type G has to be a model of ReflectablePropertyGraph.template <class L, class G>
void make_graph_from_lattice(G& G,const L& l);
The function takes the unit cell graph lattice::graph(lattice::unit_cell(l)) and decorates all cells with this graph, as discussed in the documentation of the the lattice XML schema on http://xml.comp-phys.org/.
The following properties are set if the graph type G supports them:
is the underlying lattice type, and also the type from which lattice_graph is derived.typedef LATTICE base_type;
is the type of graph that is attached to the lattice. It has to model the ReflectablePropertyGraph concept.typedef GRAPH graph_type;
have the same meaning as the corresponding members of the lattice_traits class discussed for the lattice concepts.typedef typename lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef typename lattice_traits<base_type>::offset_type offset_type;
typedef typename lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef typename lattice_traits<base_type>::vector_type vector_type;
typedef typename lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;
typedef typename lattice_traits<base_type>::cell_iterator cell_iterator;
typedef typename lattice_traits<base_type>::boundary_crossing_type boundary_crossing_type;
are iterators over the edges and vertices of the graph.typedef typename boost::graph_traits::vertex_iterator vertex_iterator;
typedef typename boost::graph_traits::edge_iterator edge_iterator;
The default constructor.lattice_graph();
copies the lattice given as argument and creates a graph of type graph_type by calling make_graph_from_lattice.template <class L>
lattice_graph(const L&);
returns the graph associated with the lattice and are used to implement the lattice::graph(l) function.const graph_type& graph() const { return graph_;}
graph_type& graph() { return graph_;}
is the traits class for the lattice.template <class L, class G>
struct lattice_traits<lattice_graph<L,G> >
{
typedef typename lattice_graph<L,G>::unit_cell_type unit_cell_type;
typedef typename lattice_graph<L,G>::cell_descriptor cell_descriptor;
typedef typename lattice_graph<L,G>::offset_type offset_type;
typedef typename lattice_graph<L,G>::basis_vector_iterator basis_vector_iterator;
typedef typename lattice_graph<L,G>::cell_iterator cell_iterator;
typedef typename lattice_graph<L,G>::size_type size_type;
typedef typename lattice_graph<L,G>::vector_type vector_type;
typedef typename lattice_graph<L,G>::boundary_crossing_type boundary_crossing_type;
};
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)