chiark / gitweb /
fix output reporting again
[matchsticks-search.git] / main.c
diff --git a/main.c b/main.c
index 3f52a86e9d76bb5cb3efc2dc42ba832b5f2a9ba3..a57bd7231a60248d0b9b81c1df24600c12c26d6e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -115,7 +115,7 @@ static double best;
 static glp_prob *best_prob;
 static AdjWord *best_adjmatrix;
 
-static int n_max_frags, m_max_frags;
+static int n_max_frags=INT_MAX, m_max_frags=INT_MAX;
 static int *weight;
 
 static unsigned printcounter;
@@ -390,8 +390,6 @@ static void prep(void) {
   glp_term_out(GLP_OFF);
   setlinebuf(stderr);
   weight = calloc(sizeof(*weight), m);  assert(weight);
-  n_max_frags = INT_MAX;
-  m_max_frags = INT_MAX;
 }
 
 #if 0
@@ -715,7 +713,7 @@ static void report(void) {
         continue;
       a[x][y] = min + glp_get_col_prim(best_prob, i);
     }
-    printf("min fragment %g", min);
+    printf("min fragment %g   [%s]\n", min, VERSION);
     for (i = 0; i < n; i++) {
       for (j = 0; j < m; j++) {
         if (a[i][j])
@@ -726,9 +724,8 @@ static void report(void) {
       printf("\n");
     }
   } else {
-    printf(" none better than %9.3f ", best);
+    printf(" none better than %9.3f    [%s]\n", best, VERSION);
   }
-  printf("   [%s]\n", VERSION);
   if (ferror(stdout) || fclose(stdout)) { perror("stdout"); exit(-1); }
 }