Clarified logic in g_wham
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 16 Jul 2013 07:39:29 +0000 (09:39 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 25 Jul 2013 22:04:21 +0000 (00:04 +0200)
The fragment "!i==0" is less clear than "i!=0," and clang 3.4-SVN even
issues warnings about a possible problem. Checked with Jochen Hub (the
original author) and he agrees the new form is appropriate.

Change-Id: I640e2104b3aa2d740895ee1145e56b731b11350f

src/gromacs/gmxana/gmx_wham.cpp

index 238de2b23078b7156734285e79a90ec33f3af402..decb0c57e82b5f9f0bf4fd56ff56c95152f380d1 100644 (file)
@@ -1683,7 +1683,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
             {
                 bExact = TRUE;
             }
-            if (((i%opt->stepchange) == 0 || i == 1) && !i == 0)
+            if (((i%opt->stepchange) == 0 || i == 1) && i != 0)
             {
                 printf("\t%4d) Maximum change %e\n", i, maxchange);
             }
@@ -3595,7 +3595,7 @@ int gmx_wham(int argc, char *argv[])
             printf("Switched to exact iteration in iteration %d\n", i);
         }
         calc_profile(profile, window, nwins, &opt, bExact);
-        if (((i%opt.stepchange) == 0 || i == 1) && !i == 0)
+        if (((i%opt.stepchange) == 0 || i == 1) && i != 0)
         {
             printf("\t%4d) Maximum change %e\n", i, maxchange);
         }