CASM  1.1.0
A Clusters Approach to Statistical Mechanics
DoFMod.hh
Go to the documentation of this file.
1 #ifndef CASM_DoFMod_HH
2 #define CASM_DoFMod_HH
3 
4 namespace CASM {
5 namespace Monte {
6 
13 template <class T>
14 class SiteMod {
15  public:
16  typedef Index size_type;
17 
19  SiteMod() {}
20 
28  SiteMod(size_type _site_linear_index, size_type _sublat, const T &_to_value) {
29  set(_site_linear_index, _sublat, _to_value);
30  }
31 
33  size_type site_index() const { return m_site_index; }
34 
36  size_type sublat() const { return m_sublat; }
37 
40  const T &to_value() const { return m_to_value; }
41 
49  void set(size_type _site_linear_index, size_type _sublat,
50  const T &_to_value) {
51  m_site_index = _site_linear_index;
52  m_sublat = _sublat;
53  m_to_value = _to_value;
54  return;
55  }
56 
57  private:
61 };
62 
65 
66 } // namespace Monte
67 } // namespace CASM
68 
69 #endif
Describes the modification of a variable on a basis site.
Definition: DoFMod.hh:14
const T & to_value() const
Returns the value the variable on the site being modified will change to.
Definition: DoFMod.hh:40
SiteMod()
Default constructor.
Definition: DoFMod.hh:19
size_type m_site_index
Definition: DoFMod.hh:58
SiteMod(size_type _site_linear_index, size_type _sublat, const T &_to_value)
Construct a SiteMod.
Definition: DoFMod.hh:28
size_type site_index() const
Returns the linear index corresponding to site in ConfigDoF.
Definition: DoFMod.hh:33
size_type sublat() const
Returns the sublattice index of site being modified.
Definition: DoFMod.hh:36
size_type m_sublat
Definition: DoFMod.hh:59
void set(size_type _site_linear_index, size_type _sublat, const T &_to_value)
Set the values of a SiteMod.
Definition: DoFMod.hh:49
SiteMod< int > OccMod
An OccMod describes the change in occupation variable on a site.
Definition: DoFMod.hh:64
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39