CASM  1.1.0
A Clusters Approach to Statistical Mechanics
DoFIsEquivalent.hh
Go to the documentation of this file.
1 #ifndef CASM_DoFIsEquivalent
2 #define CASM_DoFIsEquivalent
3 
4 #include "casm/basis_set/DoF.hh"
7 #include "casm/external/Eigen/Dense"
8 
9 namespace CASM {
10 class DoFSet;
11 
12 namespace xtal {
13 struct SymOp;
14 }
15 
28  public:
29  DoFIsEquivalent(DoFSet const &_dof, double tol = TOL)
30  : m_dof(_dof), m_tol(tol) {}
31 
34  bool operator()(DoFSet const &_other) const;
35 
37  bool operator()(xtal::SymOp const &_op) const;
38 
40  bool operator()(xtal::SymOp const &_op, DoFSet const &_other) const;
41 
44  Eigen::MatrixXd const &U() const { return m_U; }
45 
46  private:
48  bool _label_equiv(DoFSet const &_other) const;
49 
52  bool _vector_equiv(
53  Eigen::Ref<const Eigen::MatrixXd> const &_before_basis,
54  Eigen::Ref<const Eigen::MatrixXd> const &_after_basis) const;
55 
57 
58  double m_tol;
59 
61 };
62 
74 template <typename OccType>
76  public:
77  using OccDoFType = std::vector<OccType>;
78 
79  OccupantDoFIsEquivalent(OccDoFType const &_dof, double tol = TOL)
80  : m_dof(_dof), m_tol(tol), m_P(_dof.size()) {}
81 
84  bool operator()(OccDoFType const &_other) const;
85 
87  bool operator()(xtal::SymOp const &_op) const;
88 
90  bool operator()(xtal::SymOp const &_op, OccDoFType const &_other) const;
91 
94  Permutation const &perm() const { return m_P; }
95 
96  private:
98 
99  double m_tol;
100 
101  mutable Permutation m_P;
102 };
103 
104 } // namespace CASM
105 
106 #endif
Class for checking equivalence of two DoFSet objects, with respect to symmetry transformations.
DoFIsEquivalent(DoFSet const &_dof, double tol=TOL)
bool _label_equiv(DoFSet const &_other) const
returns true if m_dof and _other are same type and same size
bool operator()(DoFSet const &_other) const
Eigen::MatrixXd const & U() const
bool _vector_equiv(Eigen::Ref< const Eigen::MatrixXd > const &_before_basis, Eigen::Ref< const Eigen::MatrixXd > const &_after_basis) const
Class for checking equivalence of two OccupantDoF objects, with respect to symmetry transformations.
OccupantDoFIsEquivalent(OccDoFType const &_dof, double tol=TOL)
std::vector< OccType > OccDoFType
Permutation const & perm() const
bool operator()(OccDoFType const &_other) const
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
const double TOL
Definition: definitions.hh:30