CASM  1.1.0
A Clusters Approach to Statistical Mechanics
DoFIsEquivalent_impl.hh
Go to the documentation of this file.
2 
3 namespace CASM {
4 
7 template <typename OccType>
9  OccDoFType const &_other) const {
10  if (_other.size() != m_dof.size()) return false;
11  Index j;
12  for (Index i = 0; i < m_dof.size(); ++i) {
13  for (j = 0; j < _other.size(); ++j) {
14  if (m_dof[i].identical(_other[j], m_tol)) {
15  m_P.set(i) = j;
16  break;
17  }
18  }
19  if (j == _other.size()) {
20  return false;
21  }
22  }
23  return true;
24 }
25 
27 template <typename OccType>
29  xtal::SymOp const &_op) const {
30  Index j;
31  for (Index i = 0; i < m_dof.size(); ++i) {
32  OccType t_occ = copy_apply(_op, m_dof[i]);
33  for (j = 0; j < m_dof.size(); ++j) {
34  if (t_occ.identical(m_dof[j], m_tol)) {
35  m_P.set(i) = j;
36  break;
37  }
38  }
39  if (j == m_dof.size()) {
40  return false;
41  }
42  }
43  return true;
44 }
45 
47 template <typename OccType>
49  xtal::SymOp const &_op, OccDoFType const &_other) const {
50  if (_other.size() != m_dof.size()) return false;
51  Index j;
52  for (Index i = 0; i < m_dof.size(); ++i) {
53  OccType t_occ = sym::copy_apply(_op, m_dof[i]);
54  for (j = 0; j < _other.size(); ++j) {
55  if (t_occ.identical(_other[j], m_tol)) {
56  m_P.set(i) = j;
57  break;
58  }
59  }
60  if (j == _other.size()) {
61  return false;
62  }
63  }
64  return true;
65 }
66 
67 } // namespace CASM
std::vector< OccType > OccDoFType
bool operator()(OccDoFType const &_other) const
xtal::Coordinate copy_apply(const xtal::SymOp &op, xtal::Coordinate coord)
Copy and apply SymOp to a Coordinate.
Definition: Coordinate.cc:354
Main CASM namespace.
Definition: APICommand.hh:8
MappingNode copy_apply(PermuteIterator const &_it, MappingNode const &_node, bool transform_cost_mat=true)
Reorders the permutation and compounds the spatial isometry (rotation.
bool identical(AnisoValTraits const &A, AnisoValTraits const &B)
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39