CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SymPermutation.cc
Go to the documentation of this file.
2 
5 
6 namespace CASM {
7 
8 double SymPermutation::character() const {
9  int n_fix(0);
10  for (Index i = 0; i < m_permute.size(); i++) {
11  n_fix += int(i == m_permute[i]);
12  }
13  return n_fix;
14 }
15 
16 //*******************************************************************************************
17 
18 // Makes permutation matrix from m_permute
19 // Permute matrix P reorders elements of a column vector v via
20 // v' = P*v
21 // Therefore, we loop over m_permute and assign ones to the
22 // appropriate row/column
23 
25  m_mat.resize(m_permute.size(), m_permute.size());
26  m_mat.setZero();
27  for (Index i = 0; i < m_permute.size(); i++) m_mat(i, m_permute[i]) = 1;
28  return;
29 }
30 } // namespace CASM
Index size() const
Definition: Permutation.hh:60
double character() const override
Calculates character of the representation (if well-defined)
Eigen::MatrixXd m_mat
void _calc_mat() const
Generate the matrix of permutation, when m_permute is known.
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39