namespace alps {
{
class LatticeLibrary
{
public:
typedef hypercubic_lattice<coordinate_lattice<simple_lattice<GraphUnitCell> > > lattice_type;
LatticeLibrary();
LatticeLibrary(std::istream& is);
LatticeLibrary(const XMLTag& tag, std::istream& is);
void read_xml(std::istream& is);
void read_xml(const XMLTag& tag, std::istream& is);
void write_xml(std::ostream&) const;
bool has_graph(const std::string& name) const;
bool has_lattice(const std::string& name) const;
const LatticeGraphDescriptor& lattice_descriptor(const std::string& name) const;
lattice_type lattice(const std::string& name) const;
const coordinate_graph_type& graph(const std::string& name) const;
template <class G>
bool get_graph(G& graph,const std::string& name) const;
};
std::ostream& operator<<(std::ostream&, const LatticeLibrary& l)
std::ostream& operator<<(oxstream&, const LatticeLibrary& l)
std::istream& operator>>(std::istream&, LatticeLibrary& l)
is the only type of lattice that can be constructed at the moment. Once other lattice types than hypercubic_lattice become available this class will have to be modified.typedef hypercubic_lattice<coordinate_lattice<simple_lattice<GraphUnitCell> > > lattice_type;
an empty library of lattices and graphs.LatticeLibrary();
reads XML input from a std::istream, expected to contain a <LATTICES> element, as given by the Lattice XML schema on http://xml.comp-phys.org.LatticeLibrary(std::istream& is);
The start tag <LATTICES> has already been read and is passed as an XMLTagLatticeLibrary(const palmxml::XMLTag& tag, std::istream& is);
are similar to the cinstructors with corresponding signature. Read additional lattices and graphs.void read_xml(std::istream& is);
void read_xml(const XMLTag& tag, std::istream& is);
writes the contents of the LatticeLibrary using the Lattice XML schema on http://xml.comp-phys.org.void write_xml(std::ostream&) const;
returns true if the LatticeLibrary contains a graph with the given name, read from a <GRAPH> element.bool has_graph(const std::string& name) const;
returns true if the LatticeLibrary contains a LatticeGraph with the given name, read from a <LATTICEGRAPH> element.bool has_lattice(const std::string& name) const;
returns a reference to the graph with given name. If the graoh does not exist (has_graph returns false) a std::runtime_error is thrown.const coordinate_graph_type& graph(const std::string& name) const;
returns a reference to the LatticeGraphDescriptor with given name. If the lattice graph does not exist (has_lattice returns false) a std::runtime_error is thrown.const LatticeGraphDescriptor& lattice_descriptor(const std::string& name) const;
returns a lattice built from the lattice descriptor with the given name. If the lattice graph does not exist (has_lattice returns false) a std::runtime_error is thrown.lattice_type lattice(const std::string& name) const;
If there is a graph with the given name it is copied into the graph argument using the copy_graph function. Otherwise, the graph argument is unchanged and the function returns false.template <class G>
bool get_graph(G& graph,const std::string& name) const;
writes the LatticeLibrary using the write_xml member function.std::ostream& operator<<(std::ostream&, const LatticeLibrary& l)
std::ostream& operator<<(oxstream&, const LatticeLibrary& l)
reads the LatticeLibrary using the read_xml member function.std::istream& operator>>(std::istream&, LatticeLibrary& l)
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)