diff options
| author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-07-30 07:41:23 -0400 | 
|---|---|---|
| committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2018-07-30 07:41:23 -0400 | 
| commit | 95b4257a4df36516e192d72b12da8673f6af3081 (patch) | |
| tree | c348429b4293758d6e96e2897e3d620e89c38d78 /lib/potts.h | |
| parent | fc242f52e835be85cc6030b6cae5619d18df7670 (diff) | |
| download | c++-95b4257a4df36516e192d72b12da8673f6af3081.tar.gz c++-95b4257a4df36516e192d72b12da8673f6af3081.tar.bz2 c++-95b4257a4df36516e192d72b12da8673f6af3081.zip  | |
everything builds with new - operators defined
Diffstat (limited to 'lib/potts.h')
| -rw-r--r-- | lib/potts.h | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/potts.h b/lib/potts.h index e6ea636..771c8dc 100644 --- a/lib/potts.h +++ b/lib/potts.h @@ -53,6 +53,16 @@ class potts_t {        return result;      } + +    inline vector_t<q, int> operator-(const potts_t<q> &s) const { +      vector_t<q, int> result; +      result.fill(0); + +      result[x]++; +      result[s.x]--; + +      return result; +    }  };  template <q_t q>  | 
