CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
SymPermutation.hh
Go to the documentation of this file.
1 #ifndef SYMPERMUTATION_HH
2 #define SYMPERMUTATION_HH
3 
4 #include <iostream>
5 #include <cmath>
8 
9 namespace CASM {
10  class MasterSymGroup;
11  class Lattice;
12 
17  class SymPermutation: public SymOpRepresentation {
20  public:
23  SymPermutation(const Array<Index> &init_permute) : m_permute(init_permute), m_has_mat(false) {
24 
25  }
26 
29  SymPermutation(const Permutation &init_permute) : m_permute(init_permute), m_has_mat(false) {
30 
31  }
32 
33  double character() const override;
34 
36  SymOpRepresentation *copy() const override {
37  return new SymPermutation(*this);
38  }
39 
41  Permutation const *get_permutation() const override {
42  return &m_permute;
43  }
44 
46  Eigen::MatrixXd const *get_MatrixXd() const override {
47  if(!m_has_mat)
48  _calc_mat();
49  return &m_mat;
50  }
51 
52  jsonParser &to_json(jsonParser &json) const override;
53 
54  void from_json(const jsonParser &json) override;
55 
56  private:
61 
62  // true if m_mat is initialized
63  bool m_has_mat;
64 
68 
70  void _calc_mat() const;
71 
72  };
73 
74  jsonParser &to_json(const SymPermutation &sym, jsonParser &json);
75  void from_json(SymPermutation &sym, const jsonParser &json);
76 
78 }
79 #endif
Eigen::MatrixXd MatrixXd
void _calc_mat() const
Generate the matrix of permutation, when m_permute is known.
void from_json(ClexDescription &desc, const jsonParser &json)
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
Main CASM namespace.
Definition: complete.cpp:8
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)
SymOpRepresentation * copy() const override
Return pointer to a copy of this SymPermutation.
SymOpRepresentation is the base class for anything describes a symmetry operation.
jsonParser & to_json(jsonParser &json) const override
Eigen::MatrixXd m_mat
SymPermutation(const Permutation &init_permute)
void from_json(const jsonParser &json) override
Permutation const * get_permutation() const override
Access the permutation array 'm_permute'.
SymPermutation(const Array< Index > &init_permute)
Eigen::MatrixXd const * get_MatrixXd() const override
Access the permutation matrix.