ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
factory_lattice.hpp File Reference
#include "dmrg/models/coded/lattice.hpp"

Go to the source code of this file.

Functions

boost::shared_ptr< lattice_implcoded_lattice_factory (BaseParameters &parms)
 

Function Documentation

boost::shared_ptr<lattice_impl> coded_lattice_factory ( BaseParameters parms)
inline

Definition at line 33 of file factory_lattice.hpp.

34 {
35  typedef boost::shared_ptr<lattice_impl> impl_ptr;
36  if (parms["LATTICE"] == std::string("periodic chain lattice"))
37  return impl_ptr(new ChainLattice(parms, true));
38  else if (parms["LATTICE"] == std::string("chain lattice"))
39  return impl_ptr(new ChainLattice(parms, false));
40  else if (parms["LATTICE"] == std::string("open chain lattice"))
41  return impl_ptr(new ChainLattice(parms, false));
42  else if (parms["LATTICE"] == std::string("square lattice"))
43  return impl_ptr(new SquareLattice(parms));
44  else if (parms["LATTICE"] == std::string("open square lattice"))
45  return impl_ptr(new SquareLattice(parms));
46  else {
47  throw std::runtime_error("Don't know this lattice!");
48  }
49 }