#ifndef WOLFF_MODELS_POTTS_H #define WOLFF_MODELS_POTTS_H #include #include "vector.hpp" namespace wolff { template class potts_t { public: unsigned x; potts_t() : x(0) {} potts_t(unsigned x) : x(x) {} typedef vector_t M_t; typedef vector_t F_t; inline vector_t operator*(unsigned a) const { vector_t result; result.fill(0); result[x] = (int)a; return result; } inline vector_t operator*(double a) const { vector_t result; result.fill(0.0); result[x] = a; return result; } inline vector_t operator-(const potts_t &s) const { vector_t result; result.fill(0); result[x]++; result[s.x]--; return result; } unsigned enumerate() const { return x; } }; template inline typename potts_t::M_t operator*(unsigned a, const potts_t& s) { return s * a; } template inline typename potts_t::F_t operator*(double a, const potts_t& s) { return s * a; } } #endif