Clang-11 fixes for applied forces
[alexxy/gromacs.git] / src / gromacs / applied_forces / awh / histogramsize.cpp
index 15d1ace4ba3ea2c2c1760c6d44bdf204e3e431d5..c42e913f79bd73b9a296e7e517e5e49ccc9da743 100644 (file)
@@ -155,7 +155,7 @@ bool histogramIsEquilibrated(ArrayRef<const PointState> pointStates)
     /* Get the total weight of the total weight histogram; needed for normalization. */
     double totalWeight     = 0;
     int    numTargetPoints = 0;
-    for (auto& pointState : pointStates)
+    for (const auto& pointState : pointStates)
     {
         if (!pointState.inTargetRegion())
         {
@@ -177,7 +177,7 @@ bool histogramIsEquilibrated(ArrayRef<const PointState> pointStates)
     /* Sum up weight of points that do or don't pass the check. */
     double equilibratedWeight    = 0;
     double notEquilibratedWeight = 0;
-    for (auto& pointState : pointStates)
+    for (const auto& pointState : pointStates)
     {
         double targetWeight  = pointState.target();
         double sampledWeight = pointState.weightSumTot() * inverseTotalWeight;