CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
DoFMod.hh
Go to the documentation of this file.
1 #ifndef CASM_DoFMod_HH
2 #define CASM_DoFMod_HH
3 
4 namespace CASM {
5 
12  template<class T>
13  class SiteMod {
14  public:
15 
16  typedef Index size_type;
17 
19  SiteMod() {}
20 
27  SiteMod(size_type _site_linear_index, size_type _sublat, const T &_to_value) {
28  set(_site_linear_index, _sublat, _to_value);
29  }
30 
32  size_type site_index() const {
33  return m_site_index;
34  }
35 
37  size_type sublat() const {
38  return m_sublat;
39  }
40 
41 
43  const T &to_value() const {
44  return m_to_value;
45  }
46 
53  void set(size_type _site_linear_index, size_type _sublat, const T &_to_value) {
54  m_site_index = _site_linear_index;
55  m_sublat = _sublat;
56  m_to_value = _to_value;
57  return;
58  }
59 
60  private:
61 
62  size_type m_site_index;
63  size_type m_sublat;
65  };
66 
69 
70 }
71 
72 #endif
SiteMod()
Default constructor.
Definition: DoFMod.hh:19
Index size_type
Definition: DoFMod.hh:16
size_type site_index() const
Returns the linear index corresponding to site in ConfigDoF.
Definition: DoFMod.hh:32
void set(size_type _site_linear_index, size_type _sublat, const T &_to_value)
Set the values of a SiteMod.
Definition: DoFMod.hh:53
Describes the modification of a variable on a basis site.
Definition: DoFMod.hh:13
Main CASM namespace.
Definition: complete.cpp:8
SiteMod< int > OccMod
An OccMod describes the change in occupation variable on a site.
Definition: DoFMod.hh:68
size_type m_sublat
Definition: DoFMod.hh:63
const T & to_value() const
Returns the value the variable on the site being modified will change to.
Definition: DoFMod.hh:43
size_type sublat() const
Returns the sublattice index of site being modified.
Definition: DoFMod.hh:37
EigenIndex Index
For long integer indexing:
SiteMod(size_type _site_linear_index, size_type _sublat, const T &_to_value)
Construct a SiteMod.
Definition: DoFMod.hh:27
size_type m_site_index
Definition: DoFMod.hh:62