#pragma once #include #include "types.h" // object definition template struct height_t { T x; }; // init, copy, add, subtract, scalar_multiple, free_spin, and // write_magnetization are necessary for the operation of wolff.h template void init(height_t *ptr) { ptr->x = (T)0; } template height_t copy (height_t h) { return h; } template void add (height_t *h1, height_t h2) { h1->x += h2.x; } template void subtract (height_t *h1, height_T h2) { h1->x -= h2.x; } template height_t scalar_multiple(v_t a, height_t h) { height_t hm; hm.x = a * h.x; return hm; } template void free_spin (height_t h) { } template void write_magnetization(height_t M, FILE *outfile) { fwrite(&(M.x), sizeof(T), 1, outfile); } template double correlation_component(height_t h) { return (double)h.x; } // below here are not necessary for operation template T dot(height_t h1, height_t h2) { return (h1.x - h2.x) * (h1.x - h2.x); }