ALPS Project: lattice library

Header file: lattice/latticegraphdescriptor.h

defines a lattice graph class LatticeGraphDescriptor which can be constructed from XML input. It is a model of CoordinateLattice and FiniteLattice. It can be constructed from the <LATTICEGRAPH> element of the lattice XML schema on http://xml.comp-phys.org/.

Synopsis

namespace alps {

class LatticeGraphDescriptor
: public hypercubic_lattice<coordinate_lattice<simple_lattice<GraphUnitCell>,std::vector<alps::StringValue> >, std::vector< alps::StringValue> >
{
public:
typedef hypercubic_lattice<coordinate_lattice<simple_lattice<GraphUnitCell>,std::vector<alps::StringValue> >, std::vector< alps::StringValue> > base_type;
typedef lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef lattice_traits<base_type>::offset_type offset_type;
typedef lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef lattice_traits<base_type>::vector_type vector_type;
typedef lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;
typedef lattice_traits<base_type>::cell_iterator cell_iterator;
typedef lattice_traits<base_type>::size_type size_type;
typedef lattice_traits<base_type>::boundary_crossing_type boundary_crossing_type;

LatticeGraphDescriptor() {}
LatticeGraphDescriptor(const palmxml::XMLTag&, std::istream&,
const LatticeMap& = LatticeMap(),
const FiniteLatticeMap& = FiniteLatticeMap(),
const UnitCellMap& = UnitCellMap());

void set_parameters(const palm::Parameters&);
void write_xml(std::ostream&, const std::string& new_name= "");
const std::string& name() const;
const InhomogeneityDescriptor& disorder() const;
};

std::ostream& operator<< (std::ostream& out, const LatticeGraphDescriptor& l);

struct lattice_traits<LatticeGraphDescriptor>
{
typedef LatticeGraphDescriptor::unit_cell_type unit_cell_type;
typedef LatticeGraphDescriptor::cell_descriptor cell_descriptor;
typedef LatticeGraphDescriptor::offset_type offset_type;
typedef LatticeGraphDescriptor::basis_vector_iterator basis_vector_iterator;
typedef LatticeGraphDescriptor::cell_iterator cell_iterator;
typedef LatticeGraphDescriptor::size_type size_type;
typedef LatticeGraphDescriptor::vector_type vector_type;
typedef LatticeGraphDescriptor::boundary_crossing_type boundary_crossing_type;
};

typedef lattice_graph<LatticeGraphDescriptor,coordinate_graph_type> HypercubicLatticeGraph;

}

The LatticeGraphDescriptor class

Type definitions

typedef lattice_traits<base_type>::unit_cell_type unit_cell_type;
typedef lattice_traits<base_type>::offset_type offset_type;
typedef lattice_traits<base_type>::cell_descriptor cell_descriptor;
typedef lattice_traits<base_type>::vector_type vector_type;
typedef lattice_traits<base_type>::basis_vector_iterator basis_vector_iterator;
typedef lattice_traits<base_type>::cell_iterator cell_iterator;
typedef lattice_traits<base_type>::size_type size_type;
typedef lattice_traits<base_type>::boundary_crossing_type boundary_crossing_type;
these types are inherited from hypercubic_lattice.

Constructors

LatticeGraphDescriptor() {}
an empty lattice without any information.
  LatticeGraphDescriptor(const palmxml::XMLTag&, std::istream&, 
const LatticeMap& = LatticeMap(),
const FiniteLatticeMap& = FiniteLatticeMap(),
const UnitCellMap& = UnitCellMap());
reads the LatticeGraphDescriptor in XML from a stream assuming the Lattice XML schema on http://xml.comp-phys.org. The start tag <LATTICEGRAPH ...> has already been read and is passed as a palmxml::XMLTag

In the lattice schema the < LATTICEGRAPH ...> contain <LATTICE ...>, <FINITELATTICE ...> and <UNITCELL ...> elements. These can either describe the lattice or unit cell fully, or refer to a lattice resp. unit cell by name. The optional LatticeMap, FiniteLatticeMap and UnitCellMaps argument can be used to pass the known lattices and unit cells.

Member functions

in addition to those inherited from the parent lattice:
void set_parameters(const palm::Parameters&);
The lattice schema allows the extent and boundary conditions to be specified by external parameters. The set_parameters function allows to pass a map of parameters, to fill the values of the parameters.
void write_xml(std::ostream&, const std::string& new_name= "") const;
writes the finite lattice in XML, using the same Lattice XML schema on http://xml.comp-phys.org. It can optionally be renamed by passing a new name as the second argument.
const std::string& name() const;
returns the name of the lattice.
const InhomogeneityDescriptor& disorder() const;
returns the InhomogeneityDescriptor, describing any disorder applied to the lattice.

Output operator

std::ostream& operator<< (std::ostream& out, const LatticeGraphDescriptor& l);
writes the LatticeGraphDescriptor in XML, using the write_xml member function.

Traits classes

struct lattice_traits<LatticeGraphDescriptor>
{
typedef LatticeGraphDescriptor::unit_cell_type unit_cell_type;
typedef LatticeGraphDescriptor::cell_descriptor cell_descriptor;
typedef LatticeGraphDescriptor::offset_type offset_type;
typedef LatticeGraphDescriptor::basis_vector_iterator basis_vector_iterator;
typedef LatticeGraphDescriptor::cell_iterator cell_iterator;
typedef LatticeGraphDescriptor::size_type size_type;
typedef LatticeGraphDescriptor::vector_type vector_type;
typedef LatticeGraphDescriptor::boundary_crossing_type boundary_crossing_type;
};
define the lattice traits.

The HypercubicLatticeGraph type

typedef lattice_graph<LatticeGraphDescriptor,coordinate_graph_type> HypercubicLatticeGraph;
is a useful typedef for a default lattice_graph class. It can be used to create a graph from a LatticeGraphDescriptor.

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)