ALPS Project: lattice library
Header file: lattice/graph.h
defines functions for graph I/O, inquiry about graph properties, and a
function to copy a graph. The functions work on all graphs modelling the
concept of ReflectablePropertyGraph.
Synopsis
namespace alps {
template <class GRAPH>
void write_graph_xml(std::ostream& out, const GRAPH& g, const std::string& n="")
std::ostream& operator<<(std::ostream& out, const lattice::coordinate_graph_type& g);
template <class GRAPH>
std::string read_graph_xml(std::istream& p, GRAPH& g)
template <class GRAPH>
std::string read_graph_xml(const XMLTag& intag, std::istream& p, GRAPH& g)
template <class SOURCEGRAPH, class DESTINATIONGRAPH>
void copy_graph(const SOURCEGRAPH& src, DESTINATIONGRAPH& dst)
template <class GRAPH >
int constant_degree(const GRAPH& g)
template <class GRAPH>
int32_t maximum_edge_type(const GRAPH& g)
template <class G>
int32_t maximum_vertex_type(const GRAPH& g)
}
XML I/O functions
template <class GRAPH>
void write_graph_xml(std::ostream& out, const GRAPH& g, const std::string& name="")
writes a ReflectablePropertyGraph
to an std::ostream using the Lattice XML schema
on http://xml.comp-phys.org. The graph
can optionally be given a name for the output, which overrides any name property
the graph might have.
std::ostream& operator<<(std::ostream& out, const lattice::coordinate_graph_type& g);
writes a ReflectablePropertyGraph
from an std::istream assuming the Lattice XML schema
on http://xml.comp-phys.org. The name
of the graph is returned.
template <class GRAPH>
std::string read_graph_xml(const XMLTag& intag, std::istream& p, GRAPH& g)
same as above, but the start tag <GRAPH ...> has already
been read and is passed as an XMLTag
argument.
Graph functions
template <class SOURCEGRAPH, class DESTINATIONGRAPH>
void copy_graph(const SOURCEGRAPH& src, DESTINATIONGRAPH& dst)
copies a ReflectablePropertyGraph
and all its properties defined in graphproperties.h,
if they exist for both of the graphs.
template <class GRAPH >
int constant_degree(const GRAPH& g)
determines if all vertices of a Boost graph have the same degree. If they
do the degree is returned, otherwise -1.
template <class GRAPH>
int32_t maximum_edge_type(const GRAPH& g)
finds the largest value of the egde_type_t property in a ReflectablePropertyGraph.
template <class G>
int32_t maximum_vertex_type(const GRAPH& g)
finds the largest value of the vertex_type_t property in a ReflectablePropertyGraph.
copyright (c) 2000-2004 by Matthias Troyer