CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SymPermutation.hh
Go to the documentation of this file.
1 #ifndef SYMPERMUTATION_HH
2 #define SYMPERMUTATION_HH
3 
4 #include <cmath>
5 #include <iostream>
6 
9 
10 namespace CASM {
11 namespace xtal {
12 class Lattice;
13 }
14 using xtal::Lattice;
15 
16 class MasterSymGroup;
17 
27  public:
30  template <typename Iterator>
31  SymPermutation(Iterator begin, Iterator end)
32  : m_permute(begin, end), m_has_mat(false) {}
33 
36  SymPermutation(const std::vector<Index> &init_permute)
37  : m_permute(init_permute), m_has_mat(false) {}
38 
41  SymPermutation(const Permutation &init_permute)
42  : m_permute(init_permute), m_has_mat(false) {}
43 
44  double character() const override;
45 
47  SymOpRepresentation *copy() const override {
48  return new SymPermutation(*this);
49  }
50 
52  Permutation const *permutation() const override { return &m_permute; }
53 
55  Eigen::MatrixXd const *MatrixXd() const override {
56  if (!m_has_mat) _calc_mat();
57  return &m_mat;
58  }
59 
60  protected:
61  SymOpRepresentation *inverse_impl() const override {
62  return new SymPermutation(m_permute.inverse());
63  }
64 
65  private:
71 
72  // true if m_mat is initialized
73  bool m_has_mat;
74 
78 
80  void _calc_mat() const;
81 };
82 
84 } // namespace CASM
85 #endif
Permutation inverse() const
Construct permutation that undoes the permutation performed by 'this'.
Definition: Permutation.cc:111
SymOpRepresentation is the base class for anything describes a symmetry operation.
SymPermutation describes how a symmetry operation permutes a list of 'things' For example,...
double character() const override
Calculates character of the representation (if well-defined)
SymPermutation(const Permutation &init_permute)
SymPermutation(Iterator begin, Iterator end)
Eigen::MatrixXd m_mat
Eigen::MatrixXd const * MatrixXd() const override
Access the permutation matrix.
void _calc_mat() const
Generate the matrix of permutation, when m_permute is known.
SymOpRepresentation * copy() const override
Return pointer to a copy of this SymPermutation.
SymPermutation(const std::vector< Index > &init_permute)
Permutation const * permutation() const override
Access the permutation array 'm_permute'.
SymOpRepresentation * inverse_impl() const override
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd