- complete change to reference instead of basic_frame
authorAnatoly <Titov_AI@pnpi.nrcki.ru>
Wed, 15 May 2019 10:42:36 +0000 (13:42 +0300)
committerAnatoly <Titov_AI@pnpi.nrcki.ru>
Wed, 15 May 2019 10:42:36 +0000 (13:42 +0300)
src/spacetimecorr.cpp

index 348f7d72dfc419800c5d908cf45a74d88d42d1c7..0d8018de68f48f6a695fe7d90805cb4a71d871f1 100644 (file)
@@ -164,7 +164,7 @@ bool isitsubset (std::vector< int > a, std::vector< int > b) {
     }
 }
 
-void correlation_evaluation(std::vector< RVec > ref, std::vector< std::vector< RVec > > traj, int b_frame, std::vector< std::vector< std::vector< float > > > &crl, int tauS, int tauE) {
+void correlation_evaluation(std::vector< RVec > ref, std::vector< std::vector< RVec > > traj, std::vector< std::vector< std::vector< float > > > &crl, int tauS, int tauE) {
     crl.resize(tauE + 1);
     for (int i = 0; i < crl.size(); i++) {
         crl[i].resize(traj.front().size());
@@ -209,7 +209,7 @@ void correlation_evaluation(std::vector< RVec > ref, std::vector< std::vector< R
 }
 
 void graph_calculation(std::vector< std::vector< std::pair< float, int > > > &graph, std::vector< std::vector< int > > &s_graph, std::vector< std::vector< std::pair< int, int > > > &s_graph_rbr,
-                      std::vector< std::vector< RVec > > traj, int b_frame,
+                      std::vector< std::vector< RVec > > traj, std::vector< RVec > ref,
                       std::vector< std::vector< std::vector< float > > > crl, float crl_b, float e_rad, int tauE) {
     graph.resize(traj.front().size());
     for (int i = 0; i < traj.front().size(); i++) {
@@ -219,7 +219,7 @@ void graph_calculation(std::vector< std::vector< std::pair< float, int > > > &gr
     for (int i = 1; i <= tauE; i++) {
         for (int j = 0; j < traj.front().size(); j++) {
             for (int f = j; f < traj.front().size(); f++) {
-                temp = traj[b_frame][j] - traj[b_frame][f];
+                temp = ref[i] - ref[f];
                 if (std::max(std::abs(crl[i][j][f]), std::abs(crl[i][f][j])) >= crl_b && norm(temp) <= e_rad && std::abs(graph[j][f].first) < std::max(std::abs(crl[i][j][f]), std::abs(crl[i][f][j]))) {
                     if (std::abs(crl[i][j][f]) > std::abs(crl[i][f][j])) {
                         graph[j][f].first = crl[i][j][f];
@@ -410,7 +410,6 @@ class SpaceTimeCorr : public TrajectoryAnalysisModule
 
         std::vector< int >                                          index;
         int                                                         frames              = 0;
-        int                                                         basic_frame         = 0;
         int                                                         tau                 = 0; // selectable
         float                                                       crl_border          = 0; // selectable
         float                                                       eff_rad             = 1.5; // selectable
@@ -527,7 +526,7 @@ SpaceTimeCorr::finishAnalysis(int nframes)
 
     std::cout << "\nCorrelation's evaluation - start\n";
 
-    correlation_evaluation(reference, trajectory, basic_frame, crltns, m, k);
+    correlation_evaluation(reference, trajectory, crltns, m, k);
 
     make_correlation_matrix_file(crltns, (OutPutName + "_matrix.txt").c_str(), 0);
     std::cout << "corelation matrix printed\n";
@@ -537,7 +536,7 @@ SpaceTimeCorr::finishAnalysis(int nframes)
 
     std::cout << "Correlation's evaluation - end\n" << "graph evaluation: start\n";
 
-    graph_calculation(graph, sub_graph, sub_graph_rbr, trajectory, basic_frame, crltns, crl_border, eff_rad, k);
+    graph_calculation(graph, sub_graph, sub_graph_rbr, trajectory, reference, crltns, crl_border, eff_rad, k);
     std::cout << "graph evaluation: end\n" << "routs evaluation: start\n";
 
     graph_back_bone_evaluation(rout_new, index.size(), graph, sub_graph, sub_graph_rbr);