From 88086fc222e1802d2a68edf5f1097cf9685ec42c Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Mon, 9 Jul 2018 14:29:16 -0400 Subject: removed some references to the specific form of the magnetization for vector models from wolff.h --- lib/orthogonal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/orthogonal.h') diff --git a/lib/orthogonal.h b/lib/orthogonal.h index 0a2b5c7..2d0e1a1 100644 --- a/lib/orthogonal.h +++ b/lib/orthogonal.h @@ -161,4 +161,16 @@ void generate_rotation (gsl_rng *r, orthogonal_t *ptr) { } } +template +void write_magnetization(vector_t M, FILE *outfile) { + fwrite(M.x, sizeof(double), q, outfile); +} + +template // save some space and don't write whole doubles +void write_magnetization(vector_t M, FILE *outfile) { + for (q_t i = 0; i < q; i++) { + float M_tmp = (float)M.x[i]; + fwrite(&M_tmp, sizeof(float), 1, outfile); + } +} -- cgit v1.2.3-70-g09d2