- added index into corrType as internal data
[alexxy/gromacs-spacetimecorr.git] / src / corrtype.h
1 #ifndef CORRTYPE_H
2 #define CORRTYPE_H
3
4 #include <iostream>
5 #include <vector>
6 #include <cfloat>
7
8 #include <gromacs/trajectoryanalysis.h>
9 // #include <gromacs/trajectoryanalysis/topologyinformation.h>
10
11 #include "/home/titov_ai/Develop/gromacs-original/src/gromacs/trajectoryanalysis/topologyinformation.h"
12
13 #include "gtest/gtest.h"
14
15 #include "newfit.h"
16
17 using namespace gmx;
18
19 using gmx::RVec;
20
21
22 class correlationType {
23
24     public:
25
26         // деструктор класса
27         ~correlationType();
28
29         // конструктор класса для инициализации
30         correlationType();
31
32         correlationType(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< int > indx, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
33
34         void setDefaults(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< int > indx, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
35
36         void update(int frame, std::vector< RVec > curFrame);
37
38         void printData();
39
40     private:
41
42         FRIEND_TEST(corrTests, corrTests_setDefaults);
43         FRIEND_TEST(corrTests, corrTests_update);
44         FRIEND_TEST(corrTests, corrTests_trajectoryPartition);
45         FRIEND_TEST(corrTests, corrTests_correlationEval);
46         FRIEND_TEST(corrTests, corrTests_graphCalculations);
47         FRIEND_TEST(corrTests, corrTests_graphBackBoneEvaluation);
48
49         std::vector< std::vector< std::vector< double > > >                                     matrixes;
50         std::vector< std::vector< RVec > >                                                      trajectory;
51         std::vector< std::vector< RVec > >                                                      frankensteinTrajectory;
52         std::vector< std::vector< std::vector< RVec > > >                                       fitTrajectory;
53         std::vector< RVec >                                                                     reference;
54         int                                                                                     window      = 1000;         // selectable
55         int                                                                                     tau         = window / 2;   // selectable
56         int                                                                                     tauStep     = window / 10;  // selectable
57         float                                                                                   crlUpBorder = 0.5;          // selectable
58         float                                                                                   effRadius   = 1.5;          // selectable
59         int                                                                                     mode        = 0;            // selectable
60         std::string                                                                             outputName  = "";           // selectable
61         std::vector< int >                                                                      index;
62         std::vector< std::string >                                                              resNames;
63         std::vector< std::vector < std::vector < unsigned int > > >                             selections;
64         int                                                                                     count       = 0;
65
66         std::vector< std::vector< std::pair< double, int > > >                                  graph;
67         std::vector< std::vector< unsigned int > >                                              subGraphPoints;
68         std::vector< std::vector< std::pair< unsigned int, unsigned int > > >                   subGraphRbr;
69         std::vector< std::vector< std::vector< std::pair< unsigned int, unsigned int > > > >    subGraphRouts;
70
71         void trajectoryPartition();
72
73         void readWriteCorrelations(int rwMode);
74
75         void correlationEval();
76
77         void graphCalculations(unsigned int tauStart, unsigned int tauEnd);
78
79         static bool myComparisonFunction (const std::pair< int, double > i, const std::pair< int, double > j);
80
81         void graphBackBoneEvaluation();
82
83         void printOutputData();
84 };
85
86 #endif // CORRTYPE_H