#ifndef WOLFF_MODELS_SYMMETRIC_H #define WOLFF_MODELS_SYMMETRIC_H #include #include "potts.hpp" namespace wolff { template class symmetric_t : public std::array { public: symmetric_t() { for (unsigned i = 0; i < q; i++) { (*this)[i] = i; } } potts_t act(const potts_t &s) const { return potts_t((*this)[s.x]); } symmetric_t act(const symmetric_t& r) const { symmetric_t r_rot; for (unsigned i = 0; i < q; i++) { r_rot[i] = (*this)[r[i]]; } return r_rot; } potts_t act_inverse(const potts_t& s) const { for (unsigned i = 0; i < q; i++) { if ((*this)[i] == s.x) { return potts_t(i); } } exit(EXIT_FAILURE); } symmetric_t act_inverse(const symmetric_t& r) const { symmetric_t r_rot; for (unsigned i = 0; i < q; i++) { r_rot[(*this)[i]] = r[i]; } return r_rot; } }; } #endif