* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "fitahx.h"
#include <cmath>
+#include <vector>
#include "gromacs/math/do_fit.h"
#include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
real fit_ahx(int nres, t_bb bb[], int natoms, int nall, int allindex[], rvec x[], int nca, int caindex[], gmx_bool bFit)
{
- static rvec* xref = nullptr;
- static real* mass = nullptr;
- const real d = 0.15; /* Rise per residue (nm) */
- const real tw = 1.745; /* Twist per residue (rad) */
- const real rad = 0.23; /* Radius of the helix (nm) */
- real phi0, trms, rms;
- rvec dx, xcm;
- int ai, i, nmass;
+ static std::vector<gmx::RVec> xref;
+ static std::vector<real> mass;
+ const real d = 0.15; /* Rise per residue (nm) */
+ const real tw = 1.745; /* Twist per residue (rad) */
+ const real rad = 0.23; /* Radius of the helix (nm) */
+ real phi0, trms, rms;
+ rvec dx, xcm;
+ int ai, i, nmass;
if (nca < 3)
{
gmx_fatal(FARGS, "Need at least 3 Calphas to fit to, (now %d)...\n", nca);
}
- if (xref == nullptr)
+ if (xref.empty())
{
- snew(xref, natoms);
- snew(mass, natoms);
+ xref.resize(natoms);
+ mass.resize(natoms);
}
phi0 = 0;
for (i = 0; (i < nca); i++)
}
/* Center the referece around the origin */
- my_calc_xcm(nca, caindex, xref, xcm);
- my_sub_xcm(nca, caindex, xref, xcm);
+ my_calc_xcm(nca, caindex, as_rvec_array(xref.data()), xcm);
+ my_sub_xcm(nca, caindex, as_rvec_array(xref.data()), xcm);
if (bFit)
{
/* Now call the fitting routine */
if (bFit)
{
- do_fit(natoms, mass, xref, x);
+ do_fit(natoms, mass.data(), as_rvec_array(xref.data()), x);
}
/* Reset masses and calc rms */
#include "thermochemistry.h"
-static const char* proj_unit;
-
static real tick_spacing(real range, int minticks)
{
real sp;
const char* twodplotfile,
const char* threedplotfile,
const char* filterfile,
+ const char* projUnit,
int skip,
const char* extremefile,
gmx_bool bExtrAll,
sprintf(str, "vec %d", eignr[outvec[v]] + 1);
ylabel[v] = gmx_strdup(str);
}
- sprintf(str, "projection on eigenvectors (%s)", proj_unit);
+ sprintf(str, "projection on eigenvectors (%s)", projUnit);
write_xvgr_graphs(projfile,
noutvec,
1,
if (twodplotfile)
{
- sprintf(str, "projection on eigenvector %d (%s)", eignr[outvec[0]] + 1, proj_unit);
- sprintf(str2, "projection on eigenvector %d (%s)", eignr[outvec[noutvec - 1]] + 1, proj_unit);
+ sprintf(str, "projection on eigenvector %d (%s)", eignr[outvec[0]] + 1, projUnit);
+ sprintf(str2, "projection on eigenvector %d (%s)", eignr[outvec[noutvec - 1]] + 1, projUnit);
xvgrout = xvgropen(twodplotfile, "2D projection of trajectory", str, str2, oenv);
for (i = 0; i < nframes; i++)
{
}
snew(sqrtm, natoms);
+ std::string projUnit;
if (bM && bDMA1)
{
- proj_unit = "u\\S1/2\\Nnm";
+ projUnit = "u\\S1/2\\Nnm";
for (i = 0; (i < natoms); i++)
{
sqrtm[i] = std::sqrt(atoms->atom[index[i]].m);
}
else
{
- proj_unit = "nm";
+ projUnit = "nm";
for (i = 0; (i < natoms); i++)
{
sqrtm[i] = 1.0;
TwoDPlotFile,
ThreeDPlotFile,
FilterFile,
+ projUnit.c_str(),
skip,
ExtremeFile,
bFirstLastSet,
#include <cmath>
#include <cstring>
+#include <vector>
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
static void dump_axes(t_trxstatus* status, t_trxframe* fr, t_atoms* outat, t_bundle* bun)
{
- t_trxframe frout;
- static rvec* xout = nullptr;
- int i;
+ t_trxframe frout;
+ static std::vector<gmx::RVec> xout;
+ int i;
GMX_ASSERT(outat->nr >= bun->n, "");
- if (xout == nullptr)
+ if (xout.empty())
{
- snew(xout, outat->nr);
+ xout.resize(outat->nr);
}
for (i = 0; i < bun->n; i++)
frout.bAtoms = TRUE;
frout.natoms = outat->nr;
frout.atoms = outat;
- frout.x = xout;
+ frout.x = as_rvec_array(xout.data());
write_trxframe(status, &frout, nullptr);
}
real v;
} t_toppop;
-static t_toppop* top = nullptr;
-static int ntop = 0;
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
+static t_toppop* top = nullptr;
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
+static int ntop = 0;
typedef struct
{
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2012,2013,2014,2015,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
int average_area[],
const gmx_output_env_t* oenv)
{
- static gmx_bool bFirst = TRUE;
- static char* ssbuf;
- char buf[STRLEN + 1];
- char SSTP;
- int nr, iacc, nresidues;
- int naccf, naccb; /* Count hydrophobic and hydrophilic residues */
- real iaccf, iaccb;
+ static gmx_bool bFirst = TRUE;
+ static std::string ssbuf;
+ char buf[STRLEN + 1];
+ char SSTP;
+ int nr, iacc, nresidues;
+ int naccf, naccb; /* Count hydrophobic and hydrophilic residues */
+ real iaccf, iaccb;
/* Skip header */
* we allocate 2*nres-1, since for each chain there is a
* separating line in the temp file. (At most each residue
* could have been defined as a separate chain.) */
- snew(ssbuf, 2 * nres - 1);
+ ssbuf.resize(2 * nres - 1);
}
iaccb = iaccf = 0;
egLJ14,
egNR
};
+
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static const char* egrp_nm[egNR + 1] = { "Coul-SR", "LJ-SR", "Buck-SR", "Coul-14", "LJ-14", nullptr };
#include <cmath>
#include <cstring>
+#include <vector>
#include "gromacs/commandline/pargs.h"
#include "gromacs/commandline/viewit.h"
static void calc_gyro_z(rvec x[], matrix box, int gnx, const int index[], t_atom atom[], int nz, real time, FILE* out)
{
- static dvec* inertia = nullptr;
- static double* tm = nullptr;
- int i, ii, j, zi;
- real zf, w, sdet, e1, e2;
+ static std::vector<gmx::DVec> inertia;
+ static std::vector<double> tm;
+ int i, ii, j, zi;
+ real zf, w, sdet, e1, e2;
- if (inertia == nullptr)
+ if (inertia.empty())
{
- snew(inertia, nz);
- snew(tm, nz);
+ inertia.resize(nz);
+ tm.resize(nz);
}
for (i = 0; i < nz; i++)
#define max_hx 7
typedef int t_hx[max_hx];
#define NRHXTYPES max_hx
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static const char* hxtypenames[NRHXTYPES] = { "n-n", "n-n+1", "n-n+2", "n-n+3",
"n-n+4", "n-n+5", "n-n>6" };
#define MAXHH 4
static const unsigned char c_donorMask = (1 << 1);
static const unsigned char c_inGroupMask = (1 << 2);
-
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static const char* grpnames[grNR] = { "0", "1", "I" };
-
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static gmx_bool bDebug = FALSE;
#define HB_NO 0
#define OFFSET(frame) ((frame) / 32)
#define MASK(frame) (1 << ((frame) % 32))
-static void _set_hb(unsigned int hbexist[], unsigned int frame, gmx_bool bValue)
+static void set_hb_function(unsigned int hbexist[], unsigned int frame, gmx_bool bValue)
{
if (bValue)
{
gmx_fatal(FARGS, "Incomprehensible iValue %d in set_hb", ihb);
}
- _set_hb(ghptr, frame - hb->hbmap[id][ia]->n0, TRUE);
+ set_hb_function(ghptr, frame - hb->hbmap[id][ia]->n0, TRUE);
}
static void add_ff(t_hbdata* hbd, int id, int h, int ia, int frame, int ihb)
}
}
-static int _acceptor_index(t_acceptors* a, int grp, int i, const char* file, int line)
+static int acceptor_index_function(t_acceptors* a, int grp, int i, const char* file, int line)
{
int ai = a->aptr[i];
return ai;
}
}
-#define acceptor_index(a, grp, i) _acceptor_index(a, grp, i, __FILE__, __LINE__)
+#define acceptor_index(a, grp, i) acceptor_index_function(a, grp, i, __FILE__, __LINE__)
-static int _donor_index(t_donors* d, int grp, int i, const char* file, int line)
+static int donor_index_function(t_donors* d, int grp, int i, const char* file, int line)
{
int di = d->dptr[i];
return di;
}
}
-#define donor_index(d, grp, i) _donor_index(d, grp, i, __FILE__, __LINE__)
+#define donor_index(d, grp, i) donor_index_function(d, grp, i, __FILE__, __LINE__)
static gmx_bool isInterchangable(t_hbdata* hb, int d, int a, int grpa, int grpd)
{
/* Copy temp array to target array */
for (m = 0; (m <= nnframes); m++)
{
- _set_hb(hb0->h[0], m, htmp[m]);
- _set_hb(hb0->g[0], m, gtmp[m]);
+ set_hb_function(hb0->h[0], m, htmp[m]);
+ set_hb_function(hb0->g[0], m, gtmp[m]);
}
/* Set scalar variables */
snew(rdist, nrbin + 1);
#if !GMX_OPENMP
-# define __ADIST adist
-# define __RDIST rdist
-# define __HBDATA hb
-#else /* GMX_OPENMP ================================================== \
- * Set up the OpenMP stuff, | \
- * like the number of threads and such | \
- * Also start the parallel loop. | \
- */
-# define __ADIST p_adist[threadNr]
-# define __RDIST p_rdist[threadNr]
-# define __HBDATA p_hb[threadNr]
+# define __ADIST adist // NOLINT(bugprone-reserved-identifier)
+# define __RDIST rdist // NOLINT(bugprone-reserved-identifier)
+# define __HBDATA hb // NOLINT(bugprone-reserved-identifier)
+#else /* GMX_OPENMP ================================================== \
+ * Set up the OpenMP stuff, | \
+ * like the number of threads and such | \
+ * Also start the parallel loop. | \
+ */
+# define __ADIST p_adist[threadNr] // NOLINT(bugprone-reserved-identifier)
+# define __RDIST p_rdist[threadNr] // NOLINT(bugprone-reserved-identifier)
+# define __HBDATA p_hb[threadNr] // NOLINT(bugprone-reserved-identifier)
#endif
if (bOMP)
{
/* This probably sucks but it seems to work. */
/****************************************************************************/
-static int ce = 0, cb = 0;
-
/* this routine integrates the array data and returns the resulting array */
/* routine uses simple trapezoid rule */
-static void p_integrate(double* result, const double data[], int ndata, double slWidth)
+static void p_integrate(double* result, const double data[], int ndata, double slWidth, int cb, int ce)
{
int i, slice;
double sum;
double fudge_z,
gmx_bool bSpherical,
gmx_bool bCorrect,
+ int cb,
+ int ce,
const gmx_output_env_t* oenv)
{
rvec* x0; /* coordinates without pbc */
for (n = 0; n < nr_grps; n++)
{
/* integrate twice to get field and potential */
- p_integrate((*slField)[n], (*slCharge)[n], *nslices, *slWidth);
+ p_integrate((*slField)[n], (*slCharge)[n], *nslices, *slWidth, cb, ce);
}
for (n = 0; n < nr_grps; n++)
{
- p_integrate((*slPotential)[n], (*slField)[n], *nslices, *slWidth);
+ p_integrate((*slPotential)[n], (*slField)[n], *nslices, *slWidth, cb, ce);
}
/* Now correct for eps0 and in spherical case for r*/
int nr_grps,
const char* const grpname[],
double slWidth,
+ int cb,
+ int ce,
const gmx_output_env_t* oenv)
{
FILE *pot, /* xvgr file with potential */
static gmx_bool bSpherical = FALSE; /* default is bilayer types */
static real fudge_z = 0; /* translate coordinates */
static gmx_bool bCorrect = false;
+ int cb = 0;
+ int ce = 0;
t_pargs pa[] = {
{ "-d",
FALSE,
fudge_z,
bSpherical,
bCorrect,
+ cb,
+ ce,
oenv);
plot_potential(potential,
ngrps,
grpname,
slWidth,
+ cb,
+ ce,
oenv);
do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr); /* view xvgr file */
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
}
-static char Hnum[] = "123";
+static const char Hnum[] = "123";
typedef struct
{
#define NKC0 4
static const int kset_c[NKC + 1] = { 0, 3, 9, 13, 16, 19, NK };
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static rvec v0[NK] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, { 1, 1, 0 }, { 1, -1, 0 },
{ 1, 0, 1 }, { 1, 0, -1 }, { 0, 1, 1 }, { 0, 1, -1 }, { 1, 1, 1 },
{ 1, 1, -1 }, { 1, -1, 1 }, { -1, 1, 1 }, { 2, 0, 0 }, { 0, 2, 0 },
{ 0, 0, 2 }, { 3, 0, 0 }, { 0, 3, 0 }, { 0, 0, 3 }, { 4, 0, 0 },
{ 0, 4, 0 }, { 0, 0, 4 } };
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static rvec v1[NK] = { { 0, 1, 0 }, { 0, 0, 1 }, { 1, 0, 0 }, { 0, 0, 1 }, { 0, 0, 1 },
{ 0, 1, 0 }, { 0, 1, 0 }, { 1, 0, 0 }, { 1, 0, 0 }, { 1, -1, 0 },
{ 1, -1, 0 }, { 1, 0, -1 }, { 0, 1, -1 }, { 0, 1, 0 }, { 0, 0, 1 },
{ 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, { 1, 0, 0 }, { 0, 1, 0 },
{ 0, 0, 1 }, { 1, 0, 0 } };
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static rvec v2[NK] = { { 0, 0, 1 }, { 1, 0, 0 }, { 0, 1, 0 }, { 1, -1, 0 }, { 1, 1, 0 },
{ 1, 0, -1 }, { 1, 0, 1 }, { 0, 1, -1 }, { 0, 1, 1 }, { 1, 1, -2 },
{ 1, 1, 2 }, { 1, 2, 1 }, { 2, 1, 1 }, { 0, 0, 1 }, { 1, 0, 0 },
#include <algorithm>
#include <string>
+#include <vector>
#include "gromacs/commandline/pargs.h"
#include "gromacs/commandline/viewit.h"
gmx_bool bDim[],
const char* sffmt)
{
- static rvec* xav = nullptr;
+ static std::vector<gmx::RVec> xav;
if (bCom)
{
- if (xav == nullptr)
+ if (xav.empty())
{
- snew(xav, ngrps);
+ xav.resize(ngrps);
}
- average_data(x, xav, mass, ngrps, isize, index);
- low_print_data(fp, time, xav, ngrps, nullptr, bDim, sffmt);
+ average_data(x, as_rvec_array(xav.data()), mass, ngrps, isize, index);
+ low_print_data(fp, time, as_rvec_array(xav.data()), ngrps, nullptr, bDim, sffmt);
}
else
{
int isize[],
int** index)
{
- static rvec* xav = nullptr;
+ static std::vector<gmx::RVec> xav;
+ // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static t_atoms* atoms = nullptr;
t_trxframe fr_av;
int i;
if (bCom)
{
- if (xav == nullptr)
+ if (xav.empty())
{
- snew(xav, ngrps);
+ xav.resize(ngrps);
snew(atoms, 1);
*atoms = *fr->atoms;
snew(atoms->atom, ngrps);
atoms->atomname[i] = fr->atoms->atomname[index[i][0]];
}
}
- average_data(fr->x, xav, mass, ngrps, isize, index);
+ average_data(fr->x, as_rvec_array(xav.data()), mass, ngrps, isize, index);
fr_av = *fr;
fr_av.natoms = ngrps;
fr_av.atoms = atoms;
- fr_av.x = xav;
+ fr_av.x = as_rvec_array(xav.data());
write_trxframe(status, &fr_av, nullptr);
}
else
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
real d2;
} t_order;
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static t_order* order;
static int ocomp(const void* a, const void* b)
done_warning(wi, FARGS);
}
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static t_rgb black = { 0, 0, 0 };
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static t_rgb white = { 1, 1, 1 };
#define BLACK (&black)
/* this must correspond to *colors[] in get_params */
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static t_rgb* linecolors[] = { nullptr, &black, &white, nullptr };
static void leg_discrete(t_psdata* ps,
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-static const char* pp_pat[] = { "C", "N", "CA", "C", "N" };
+static const char* const pp_pat[] = { "C", "N", "CA", "C", "N" };
#define NPP (sizeof(pp_pat) / sizeof(pp_pat[0]))
static bool d_comp(const t_dih& a, const t_dih& b)
xvgrclose(fp);
}
-
extern double CMSF(gmx_structurefactors_t* gsf, int type, int nh, double lambda, double sin_theta)
/*
* return Cromer-Mann fit for the atomic scattering factor:
--- /dev/null
+# List of rationales for check suppressions (where known).
+# This have to precede the list because inline comments are not
+# supported by clang-tidy.
+#
+# -cppcoreguidelines-non-private-member-variables-in-classes,
+# -misc-non-private-member-variables-in-classes,
+# We intend a gradual transition to conform to this guideline, but it
+# is not practical to implement yet.
+#
+# -readability-isolate-declaration,
+# Declarations like "int a, b;" are readable. Some forms are not, and
+# those might reasonably be suggested against during code review.
+#
+# -cppcoreguidelines-avoid-c-arrays,
+# C arrays are still necessary in many places with legacy code
+#
+# -cppcoreguidelines-avoid-magic-numbers,
+# -readability-magic-numbers,
+# We have many legitimate use cases for magic numbers
+#
+# -cppcoreguidelines-macro-usage,
+# We do use too many macros, and we should fix many of them, but there
+# is no reasonable way to suppress the check e.g. in src/config.h and
+# configuring the build is a major legitimate use of macros.
+#
+# -cppcoreguidelines-narrowing-conversions,
+# -bugprone-narrowing-conversions
+# We have many cases where int is converted to float and we don't care
+# enough about such potential loss of precision to use explicit casts
+# in large numbers of places.
+#
+# -google-readability-avoid-underscore-in-googletest-name
+# We need to use underscores for readability for our legacy types
+# and command-line parameter names
+#
+# -misc-no-recursion
+# We have way too many functions and methods relying on recursion
+#
+# -cppcoreguidelines-avoid-non-const-global-variables
+# There are quite a lot of static variables in the test code that
+# can not be replaced.
+#
+# -modernize-avoid-bind
+# Some code needs to use std::bind and can't be modernized quickly.
+Checks: clang-diagnostic-*,-clang-analyzer-*,-clang-analyzer-security.insecureAPI.strcpy,
+ bugprone-*,misc-*,readability-*,performance-*,mpi-*,
+ -readability-inconsistent-declaration-parameter-name,
+ -readability-function-size,-readability-else-after-return,
+ modernize-use-nullptr,modernize-use-emplace,
+ modernize-make-unique,modernize-make-shared,
+ modernize-avoid-bind,
+ modernize-use-override,
+ modernize-redundant-void-arg,modernize-use-bool-literals,
+ cppcoreguidelines-*,-cppcoreguidelines-pro-*,-cppcoreguidelines-owning-memory,
+ -cppcoreguidelines-no-malloc,-cppcoreguidelines-special-member-functions,
+ -cppcoreguidelines-avoid-goto,
+ google-*,-google-build-using-namespace,-google-explicit-constructor,
+ -google-readability-function-size,-google-readability-todo,-google-runtime-int,
+ -cppcoreguidelines-non-private-member-variables-in-classes,
+ -misc-non-private-member-variables-in-classes,
+ -readability-isolate-declaration,
+ -cppcoreguidelines-avoid-c-arrays,
+ -cppcoreguidelines-avoid-magic-numbers,
+ -readability-magic-numbers,
+ -cppcoreguidelines-macro-usage,
+ -cppcoreguidelines-narrowing-conversions,
+ -bugprone-narrowing-conversions,
+ -google-readability-avoid-underscore-in-googletest-name,
+ -cppcoreguidelines-init-variables,
+ -misc-no-recursion,
+ -cppcoreguidelines-avoid-non-const-global-variables,
+ -modernize-avoid-bind
+HeaderFilterRegex: .*
+CheckOptions:
+ - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
+ value: 1
+ - key: modernize-make-unique.IncludeStyle
+ value: google
+ - key: modernize-make-shared.IncludeStyle
+ value: google
+ - key: readability-implicit-bool-conversion.AllowIntegerConditions
+ value: 1
+ - key: readability-implicit-bool-conversion.AllowPointerConditions
+ value: 1
+ - key: bugprone-dangling-handle.HandleClasses
+ value: std::basic_string_view; nonstd::sv_lite::basic_string_view
+# Permit passing shard pointers by value for sink parameters
+ - key: performance-unnecessary-copy-initialization.AllowedTypes
+ value: shared_ptr
+ - key: performance-unnecessary-value-param.AllowedTypes
+ value: shared_ptr
// Convert frequency (ps^-1) to energy (kJ/mol)
double factor = gmx::c_planck * gmx::c_pico / (2.0 * M_PI);
double zpe = 0;
- for (auto& r : eigval)
+ for (const auto& r : eigval)
{
double omega = eigval_to_frequency(r);
zpe += 0.5 * factor * scale_factor * omega;