Merge branch 'master' into pygromacs
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_rotmat.cpp
similarity index 97%
rename from src/gromacs/gmxana/gmx_rotmat.c
rename to src/gromacs/gmxana/gmx_rotmat.cpp
index 1c95da982faae63eb698031aee3a8ab67079aced..28fd1e81a6d317aadb713d362d7a8c6f97559a5f 100644 (file)
@@ -34,8 +34,8 @@
  */
 #include "gmxpre.h"
 
-#include <math.h>
-#include <string.h>
+#include <cmath>
+#include <cstring>
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
@@ -50,6 +50,7 @@
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 static void get_refx(output_env_t oenv, const char *trxfn, int nfitdim, int skip,
@@ -134,8 +135,8 @@ static void get_refx(output_env_t oenv, const char *trxfn, int nfitdim, int skip
                 }
             }
             msd      /= tot_mass;
-            srmsd[i] += sqrt(msd);
-            srmsd[j] += sqrt(msd);
+            srmsd[i] += std::sqrt(msd);
+            srmsd[j] += std::sqrt(msd);
         }
         sfree(xi[i]);
     }
@@ -251,6 +252,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
+    GMX_RELEASE_ASSERT(reffit[0] != NULL, "Options inconsistency; reffit[0] is NULL");
     if (reffit[0][0] != 'n')
     {
         get_refx(oenv, ftp2fn(efTRX, NFILE, fnm), reffit[0][2] == 'z' ? 3 : 2, skip,