- fixed a potentional bug with negative values
[alexxy/gromacs-spacetimecorr.git] / src / corrtype.cpp
index f83e7253a3a465ee8031faf1dd9a2367567c668d..426d306ffdd7956499b09bca8b08d2e81c6444aa 100644 (file)
@@ -40,8 +40,7 @@ void correlationType::update(const int frameNum, const std::vector< RVec > &curF
         trajectory.erase(trajectory.begin());
     }
     if (mode == 1) {
-        if ((frameNum - temp + 1) % tauStep == 0) {
-            std::cout << frameNum << " " << window << " " << tau << " " << tauStep << "\n";
+        if ( ((frameNum - temp + 1) >= 0) && ((frameNum - temp + 1) % tauStep == 0)) {
             correlationEval();
             selections.erase(selections.begin());
             std::cout << "\n\t\tcorrEval successful\n" << std::endl;