#ifndef WOLFF_MODELS_POTTS_H #define WOLFF_MODELS_POTTS_H #include #include "vector.hpp" namespace wolff { #include "../types.h" template class potts_t { public: q_t x; potts_t() : x(0) {} potts_t(q_t x) : x(x) {} typedef vector_t M_t; typedef vector_t F_t; inline vector_t operator*(v_t 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; } q_t enumerate() const { return x; } }; template inline typename potts_t::M_t operator*(v_t 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