summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-12 14:11:04 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-07-12 14:11:04 -0400
commitce54e63830421435115663436d120f2319bb711d (patch)
tree65eeec500b73cd7033cdcddf1c92444ffab66ca7
parentb85fefe6b6ac4a2e6599e83eef2bb567ebbef41e (diff)
downloadc++-ce54e63830421435115663436d120f2319bb711d.tar.gz
c++-ce54e63830421435115663436d120f2319bb711d.tar.bz2
c++-ce54e63830421435115663436d120f2319bb711d.zip
fixed bug
-rw-r--r--src/analyze_correlations.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/analyze_correlations.cpp b/src/analyze_correlations.cpp
index c429c1b..f0fbd15 100644
--- a/src/analyze_correlations.cpp
+++ b/src/analyze_correlations.cpp
@@ -201,6 +201,10 @@ int main (int argc, char *argv[]) {
sprintf(filename_B, "wolff_%lu_E_OO.dat", id);
+ if (length > M) {
+ length = M;
+ }
+
FILE *file_E = fopen(filename_B, "wb");
fwrite(&M_f, sizeof(double), 1, file_E);
fwrite(&mean_E, sizeof(double), 1, file_E);
@@ -286,6 +290,10 @@ int main (int argc, char *argv[]) {
compute_OO(M, forward_plan, forward_data, reverse_plan, reverse_data);
+ if (length > M) {
+ length = M;
+ }
+
sprintf(filename_E, "wolff_%lu_E_OO.dat", id);
FILE *file_E_new = fopen(filename_E, "wb");
fwrite(&M_f, sizeof(double), 1, file_E_new);