summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/height.h4
-rw-r--r--lib/potts.h10
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/height.h b/lib/height.h
index a4cbbed..d2173fe 100644
--- a/lib/height.h
+++ b/lib/height.h
@@ -44,6 +44,10 @@ struct height_t {
inline double operator*(double a) const {
return x * a;
}
+
+ inline T operator-(const height_t& h) const {
+ return x - h.x;
+ }
};
template <class T>
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>