Apply re-formatting to C++ in src/ tree.
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_covar.cpp
index 559c1f96372f7686f65fc3fe7ccc00bb92586c9a..a6a07535cac1a49034a085c2fcd2c787c59086b4 100644 (file)
@@ -188,8 +188,8 @@ int gmx_covar(int argc, char* argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, nullptr, &oenv))
+    if (!parse_common_args(
+                &argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT, NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -309,7 +309,8 @@ int gmx_covar(int argc, char* argv[])
         fprintf(stderr,
                 "\nWARNING: number of atoms in structure file (%d) and trajectory (%d) do not "
                 "match\n",
-                natoms, nat);
+                natoms,
+                nat);
     }
     gmx::throwErrorIfIndexOutOfBounds({ ifit, ifit + nfit }, nat, "fitting");
     gmx::throwErrorIfIndexOutOfBounds({ index, index + natoms }, nat, "analysis");
@@ -343,11 +344,13 @@ int gmx_covar(int argc, char* argv[])
             xread[index[i]][d] = xav[i][d];
         }
     }
-    write_sto_conf_indexed(opt2fn("-av", NFILE, fnm), "Average structure", atoms, xread, nullptr,
-                           PbcType::No, zerobox, natoms, index);
+    write_sto_conf_indexed(
+            opt2fn("-av", NFILE, fnm), "Average structure", atoms, xread, nullptr, PbcType::No, zerobox, natoms, index);
     sfree(xread);
 
-    fprintf(stderr, "Constructing covariance matrix (%dx%d) ...\n", static_cast<int>(ndim),
+    fprintf(stderr,
+            "Constructing covariance matrix (%dx%d) ...\n",
+            static_cast<int>(ndim),
             static_cast<int>(ndim));
     nframes = 0;
     nat     = read_first_x(oenv, &status, trxfile, &t, &xread, box);
@@ -457,8 +460,7 @@ int gmx_covar(int argc, char* argv[])
         {
             for (i = 0; i < ndim; i += 3)
             {
-                fprintf(out, "%g %g %g\n", mat[ndim * j + i], mat[ndim * j + i + 1],
-                        mat[ndim * j + i + 2]);
+                fprintf(out, "%g %g %g\n", mat[ndim * j + i], mat[ndim * j + i + 1], mat[ndim * j + i + 2]);
             }
         }
         gmx_ffclose(out);
@@ -500,8 +502,24 @@ int gmx_covar(int argc, char* argv[])
         rhi.b   = 0;
         out     = gmx_ffopen(xpmfile, "w");
         nlevels = 80;
-        write_xpm3(out, 0, "Covariance", bM ? "u nm^2" : "nm^2", "dim", "dim", ndim, ndim, axis,
-                   axis, mat2, min, 0.0, max, rlo, rmi, rhi, &nlevels);
+        write_xpm3(out,
+                   0,
+                   "Covariance",
+                   bM ? "u nm^2" : "nm^2",
+                   "dim",
+                   "dim",
+                   ndim,
+                   ndim,
+                   axis,
+                   axis,
+                   mat2,
+                   min,
+                   0.0,
+                   max,
+                   rlo,
+                   rmi,
+                   rhi,
+                   &nlevels);
         gmx_ffclose(out);
         sfree(axis);
         sfree(mat2);
@@ -552,8 +570,24 @@ int gmx_covar(int argc, char* argv[])
         rhi.b   = 0;
         out     = gmx_ffopen(xpmafile, "w");
         nlevels = 80;
-        write_xpm3(out, 0, "Covariance", bM ? "u nm^2" : "nm^2", "atom", "atom", ndim / DIM,
-                   ndim / DIM, axis, axis, mat2, min, 0.0, max, rlo, rmi, rhi, &nlevels);
+        write_xpm3(out,
+                   0,
+                   "Covariance",
+                   bM ? "u nm^2" : "nm^2",
+                   "atom",
+                   "atom",
+                   ndim / DIM,
+                   ndim / DIM,
+                   axis,
+                   axis,
+                   mat2,
+                   min,
+                   0.0,
+                   max,
+                   rlo,
+                   rmi,
+                   rhi,
+                   &nlevels);
         gmx_ffclose(out);
         sfree(axis);
         for (i = 0; i < ndim / DIM; i++)
@@ -595,8 +629,7 @@ int gmx_covar(int argc, char* argv[])
         if (nframes - 1 < ndim)
         {
             end = nframes - 1;
-            fprintf(stderr,
-                    "\nWARNING: there are fewer frames in your trajectory than there are\n");
+            fprintf(stderr, "\nWARNING: there are fewer frames in your trajectory than there are\n");
             fprintf(stderr, "degrees of freedom in your system. Only generating the first\n");
             fprintf(stderr, "%d out of %d eigenvectors and eigenvalues.\n", end, static_cast<int>(ndim));
         }
@@ -638,8 +671,8 @@ int gmx_covar(int argc, char* argv[])
         WriteXref = eWXR_NOFIT;
     }
 
-    write_eigenvectors(eigvecfile, natoms, mat, TRUE, 1, end, WriteXref, x, bDiffMass1, xproj, bM,
-                       eigenvalues);
+    write_eigenvectors(
+            eigvecfile, natoms, mat, TRUE, 1, end, WriteXref, x, bDiffMass1, xproj, bM, eigenvalues);
 
     out = gmx_ffopen(logfile, "w");
 
@@ -650,8 +683,12 @@ int gmx_covar(int argc, char* argv[])
 
     fprintf(out, "Working directory: %s\n\n", str);
 
-    fprintf(out, "Read %d frames from %s (time %g to %g %s)\n", nframes, trxfile,
-            output_env_conv_time(oenv, tstart), output_env_conv_time(oenv, tend),
+    fprintf(out,
+            "Read %d frames from %s (time %g to %g %s)\n",
+            nframes,
+            trxfile,
+            output_env_conv_time(oenv, tstart),
+            output_env_conv_time(oenv, tend),
             output_env_get_time_unit(oenv).c_str());
     if (bFit)
     {
@@ -677,8 +714,7 @@ int gmx_covar(int argc, char* argv[])
     {
         fprintf(out, "Fit is %smass weighted\n", bDiffMass1 ? "" : "non-");
     }
-    fprintf(out, "Diagonalized the %dx%d covariance matrix\n", static_cast<int>(ndim),
-            static_cast<int>(ndim));
+    fprintf(out, "Diagonalized the %dx%d covariance matrix\n", static_cast<int>(ndim), static_cast<int>(ndim));
     fprintf(out, "Trace of the covariance matrix before diagonalizing: %g\n", trace);
     fprintf(out, "Trace of the covariance matrix after diagonalizing: %g\n\n", sum);