From d36b90084e3fc520cae1a500cc1d130d9812624b Mon Sep 17 00:00:00 2001 From: Anatoly Date: Wed, 21 Oct 2020 15:09:19 +0300 Subject: [PATCH] - fixed infinite pairSearch restart --- src/colorvec.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/colorvec.cpp b/src/colorvec.cpp index 39b81ad..a4cc070 100644 --- a/src/colorvec.cpp +++ b/src/colorvec.cpp @@ -193,12 +193,13 @@ inline void betaListsRVecsEvaluation(const std::vector< gmx::RVec > &frame, cons bool isNearPeptide(const t_trxframe &fr, const t_pbc *pbc, const std::vector< gmx::RVec > &inputFrame, gmx::AnalysisNeighborhood &nbhood, const std::vector< size_t > &inputIndex, const std::vector< std::pair< std::string, size_t > > &inputColor) { - gmx::AnalysisNeighborhoodSearch nbsearch = nbhood.initSearch(pbc, gmx::AnalysisNeighborhoodPositions(fr.x, fr.natoms)); - gmx::AnalysisNeighborhoodPair pair; + gmx::AnalysisNeighborhoodSearch nbsearch = nbhood.initSearch(pbc, gmx::AnalysisNeighborhoodPositions(fr.x, fr.natoms)); + gmx::AnalysisNeighborhoodPair pair; for (const auto &i : inputColor) { std::cout << i.first << std::endl; int count {0}; - while (nbsearch.startPairSearch(inputFrame[i.second].as_vec()).findNextPair(&pair)) { + gmx::AnalysisNeighborhoodPairSearch pairSearch = nbsearch.startPairSearch(inputFrame[i.second].as_vec()); + while (pairSearch.findNextPair(&pair)) { std::cout << ++count << std::endl; for (const auto &j : inputIndex) { if (pair.refIndex() == j) { -- 2.22.0