#include <lattice.hpp>
Definition at line 41 of file lattice.hpp.
alps_lattice::alps_lattice |
( |
const alps::Parameters & |
p | ) |
|
|
inline |
Definition at line 50 of file lattice.hpp.
55 forward_.resize(
size());
56 backward_.resize(
size());
58 for (graph_type::bond_iterator it=graph.bonds().first; it!=graph.bonds().second; ++it) {
59 graph_type::size_type s, t;
60 s = graph.vertex_index(graph.source(*it));
61 t = graph.vertex_index(graph.target(*it));
63 forward_[s].push_back(t);
64 backward_[t].push_back(s);
66 bond_index_map[s][t] = graph.edge_index(*it);
67 bond_index_map[t][s] = graph.edge_index(*it);
std::vector<pos_t> alps_lattice::all |
( |
pos_t |
p | ) |
const |
|
inlinevirtual |
Implements lattice_impl.
Definition at line 75 of file lattice.hpp.
77 std::vector<pos_t> ret = forward_[p];
78 std::copy(backward_[p].begin(), backward_[p].end(), std::back_inserter(ret));
const graph_type& alps_lattice::alps_graph |
( |
| ) |
const |
|
inline |
std::vector<pos_t> alps_lattice::forward |
( |
pos_t |
p | ) |
const |
|
inlinevirtual |
template<class T >
T lattice_impl::get_prop |
( |
std::string |
property, |
|
|
pos_t |
site |
|
) |
| const |
|
inlineinherited |
Definition at line 49 of file lattice.h.
52 return boost::any_cast<T>(
get_prop_(property, std::vector<pos_t>(1, site)));
virtual boost::any get_prop_(std::string const &, std::vector< pos_t > const &) const =0
template<class T >
T lattice_impl::get_prop |
( |
std::string |
property, |
|
|
pos_t |
bond1, |
|
|
pos_t |
bond2 |
|
) |
| const |
|
inlineinherited |
Definition at line 55 of file lattice.h.
58 std::vector<pos_t> v(2);
59 v[0] = bond1; v[1] = bond2;
60 return boost::any_cast<T>(
get_prop_(property, v));
virtual boost::any get_prop_(std::string const &, std::vector< pos_t > const &) const =0
template<class T >
T lattice_impl::get_prop |
( |
std::string |
property, |
|
|
std::vector< pos_t > const & |
positions |
|
) |
| const |
|
inlineinherited |
Definition at line 63 of file lattice.h.
66 return boost::any_cast<T>(
get_prop_(property, positions));
virtual boost::any get_prop_(std::string const &, std::vector< pos_t > const &) const =0
boost::any alps_lattice::get_prop_ |
( |
std::string const & |
property, |
|
|
std::vector< pos_t > const & |
pos |
|
) |
| const |
|
inlinevirtual |
Implements lattice_impl.
Definition at line 92 of file lattice.hpp.
94 if (property ==
"label" && pos.size() == 1)
95 return boost::any( alps::site_label(graph.graph(), graph.site(pos[0])) );
96 else if (property ==
"label" && pos.size() == 2)
97 return boost::any( alps::bond_label(graph.graph(), graph.bond(bond_index_map[pos[0]][pos[1]])) );
98 else if (property ==
"type" && pos.size() == 1)
99 return boost::any( static_cast<int>(graph.site_type(graph.site(pos[0]))) );
100 else if (property ==
"type" && pos.size() == 2)
101 return boost::any( static_cast<int>(graph.bond_type(graph.bond(bond_index_map[pos[0]][pos[1]]))) );
102 else if (property ==
"wraps_pbc" && pos.size() == 2)
103 return boost::any( static_cast<bool>(boost::get(alps::boundary_crossing_t(),
105 graph.bond(bond_index_map[pos[0]][pos[1]]))) );
107 std::ostringstream ss;
108 ss <<
"No property '" <<
property <<
"' with " << pos.size() <<
" points implemented.";
109 throw std::runtime_error(ss.str());
int alps_lattice::maximum_vertex_type |
( |
| ) |
const |
|
inlinevirtual |
pos_t alps_lattice::size |
( |
| ) |
const |
|
inlinevirtual |
The documentation for this class was generated from the following file: