From 1584bbdb2fd3ebd89af5fe7bae62f274937d69d3 Mon Sep 17 00:00:00 2001 From: Andrey Alekseenko Date: Wed, 21 Oct 2020 12:39:15 +0200 Subject: [PATCH] Revert "densityfit: Fix inconsistent use of iterators" This reverts commit a96e538b04cf6ff1e983d62fa58fb6150ab0c97f. --- src/gromacs/math/densityfit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gromacs/math/densityfit.cpp b/src/gromacs/math/densityfit.cpp index a4bd834308..3301fc73df 100644 --- a/src/gromacs/math/densityfit.cpp +++ b/src/gromacs/math/densityfit.cpp @@ -104,7 +104,7 @@ DensitySimilarityInnerProduct::DensitySimilarityInnerProduct(density referenceDe const auto numVoxels = gradient_.asConstView().mapping().required_span_size(); /* the gradient for the inner product measure of fit is constant and does not * depend on the compared density, so it is pre-computed here */ - std::transform(begin(referenceDensity_), end(referenceDensity_), begin(gradient_), + std::transform(begin(referenceDensity_), end(referenceDensity), begin(gradient_), [numVoxels](float x) { return x / numVoxels; }); } @@ -227,7 +227,7 @@ struct CrossCorrelationEvaluationHelperValues real referenceSquaredSum = 0; //! The sum of the squared compared density voxel values real comparisonSquaredSum = 0; - //! The covariance of the reference and the compared density + //! The covariance of the refernce and the compared density real covariance = 0; }; @@ -267,7 +267,7 @@ CrossCorrelationEvaluationHelperValues evaluateHelperValues(DensitySimilarityMea class CrossCorrelationGradientAtVoxel { public: - //! Set up the gradient calculation with pre-computed values + //! Set up the gradident calculation with pre-computed values CrossCorrelationGradientAtVoxel(const CrossCorrelationEvaluationHelperValues& preComputed) : prefactor_(evaluatePrefactor(preComputed.comparisonSquaredSum, preComputed.referenceSquaredSum)), comparisonPrefactor_(preComputed.covariance / preComputed.comparisonSquaredSum), @@ -344,7 +344,7 @@ real DensitySimilarityCrossCorrelation::similarity(density comparedDensity) // To avoid numerical instability due to large squared density value sums // division is re-written to avoid multiplying two large numbers - // as product of two separate divisions of smaller numbers + // as product of two seperate divisions of smaller numbers const real covarianceSqrt = sqrt(fabs(helperValues.covariance)); const int sign = helperValues.covariance > 0 ? 1 : -1; return sign * (covarianceSqrt / sqrt(helperValues.referenceSquaredSum)) -- 2.11.4.GIT