CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ConfigCompare.hh
Go to the documentation of this file.
1 #ifndef CASM_ConfigCompare
2 #define CASM_ConfigCompare
3 
4 #include <utility>
5 
6 namespace CASM {
7 
8 class PermuteIterator;
9 
17 template <typename ConfigType, typename IsEqualImpl>
19  public:
20  explicit GenericConfigCompare(const IsEqualImpl &_eq) : m_eq(_eq) {}
21 
22  template <typename... Args>
23  bool operator()(Args &&... args) const {
24  if (m_eq(std::forward<Args>(args)...)) {
25  return false;
26  }
27  return m_eq.is_less();
28  }
29 
30  /*
32  bool operator()(const ConfigType &other) const {
33  if(&m_eq.config().supercell() != &other.supercell()) {
34  if(m_eq.config().supercell() != other.supercell()) {
35  return m_eq.config().supercell() < other.supercell();
36  }
37  }
38  if(m_eq(other)) {
39  return false;
40  }
41  return m_eq.is_less();
42  }
43 
45  bool operator()(const PermuteIterator &A) const {
46  if(m_eq(A)) {
47  return false;
48  }
49  return m_eq.is_less();
50  }
51 
53  bool operator()(const PermuteIterator &A, const PermuteIterator &B) const {
54  if(m_eq(A, B)) {
55  return false;
56  }
57  return m_eq.is_less();
58  }
59 
61  bool operator()(const PermuteIterator &A, const ConfigType& other) const {
62  if(m_eq(A, other)) {
63  return false;
64  }
65  return m_eq.is_less();
66  }
67 
69  bool operator()(const PermuteIterator &A, const PermuteIterator &B, const
70  ConfigType& other) const { if(m_eq(A, B, other)) { return false;
71  }
72  return m_eq.is_less();
73  }
74  */
75 
76  const IsEqualImpl &base() const { return m_eq; }
77 
78  private:
79  IsEqualImpl m_eq;
80 };
81 
83 } // namespace CASM
84 
85 #endif
Class for less than comparison of Configurations implemented via a ConfigTypeIsEqual class that also ...
const IsEqualImpl & base() const
GenericConfigCompare(const IsEqualImpl &_eq)
bool operator()(Args &&... args) const
Main CASM namespace.
Definition: APICommand.hh:8