From 5ffaf0a1bb0f0b47d57d0f24ee1134659775dacb Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 20 Jul 2018 22:57:39 -0400 Subject: added ising example to cpp collection --- lib/measure.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/measure.h') diff --git a/lib/measure.h b/lib/measure.h index d20c081..52e43af 100644 --- a/lib/measure.h +++ b/lib/measure.h @@ -1,7 +1,9 @@ #pragma once -#define POSSIBLE_MEASUREMENTS 4 +#include "measurement.h" + +#define POSSIBLE_MEASUREMENTS 5 const unsigned char measurement_energy = 1 << 0; const unsigned char measurement_clusterSize = 1 << 1; const unsigned char measurement_magnetization = 1 << 2; @@ -43,6 +45,13 @@ std::function *)> measurement_fourier_file(FILE * }; } +template +std::function *)> measurement_average_cluster(meas_t *x) { + return [=](const state_t *s) { + meas_update(x, s->last_cluster_size); + }; +} + #endif -- cgit v1.2.3-70-g09d2