From b6b6235e9563b003e1932fd757b947e5a2eb9c9a Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 18 Jul 2018 16:03:08 -0400 Subject: used typedefs to shorten lines --- src/wolff_heisenberg.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/wolff_heisenberg.cpp') diff --git a/src/wolff_heisenberg.cpp b/src/wolff_heisenberg.cpp index f38fa96..5403b49 100644 --- a/src/wolff_heisenberg.cpp +++ b/src/wolff_heisenberg.cpp @@ -4,6 +4,8 @@ #include #include +typedef state_t , vector_t <3, double>> sim_t; + int main(int argc, char *argv[]) { count_t N = (count_t)1e7; @@ -61,7 +63,7 @@ int main(int argc, char *argv[]) { timestamp = spec.tv_sec*1000000000LL + spec.tv_nsec; } - std::function (gsl_rng *, const state_t , vector_t <3, double>> *)> gen_R; + std::function (gsl_rng *, const sim_t *)> gen_R; const char *pert_type; @@ -108,20 +110,20 @@ int main(int argc, char *argv[]) { free(filename_S); free(filename_X); - std::function , vector_t <3, double>> *)> *measurements = (std::function , vector_t <3, double>> *)> *)malloc(4 * sizeof(std::function , vector_t <3, double>> *)>)); + std::function *measurements = (std::function *)malloc(4 * sizeof(std::function )); - measurements[0] = [&](const state_t , vector_t <3, double>> *s) { + measurements[0] = [&](const sim_t *s) { float smaller_E = (float)s->E; fwrite(&smaller_E, sizeof(float), 1, outfile_E); }; - measurements[1] = [&](const state_t , vector_t <3, double>> *s) { + measurements[1] = [&](const sim_t *s) { float smaller_X = (float)correlation_length(s); fwrite(&smaller_X, sizeof(float), 1, outfile_X); }; - measurements[2] = [&](const state_t , vector_t <3, double>> *s) { + measurements[2] = [&](const sim_t *s) { write_magnetization(s->M, outfile_M); }; - measurements[3] = [&](const state_t , vector_t <3, double>> *s) { + measurements[3] = [&](const sim_t *s) { fwrite(&(s->last_cluster_size), sizeof(uint32_t), 1, outfile_S); }; -- cgit v1.2.3-70-g09d2