- separated corr type into (cpp/h) combo
[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 "newfit.h"
14
15 using namespace gmx;
16
17 using gmx::RVec;
18
19
20 class correlationType {
21
22     public:
23
24         // деструктор класса
25         ~correlationType();
26
27         // конструктор класса для инициализации
28         correlationType();
29
30         correlationType(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
31
32         void setDefaults(std::vector< RVec > ref, int wnd, int taau, int tau_st, float crlUp, float effRad, int mod, std::string out, std::vector< std::vector < std::vector < unsigned int > > > sels, std::vector< std::string > rsNames);
33
34         void update(int frame, std::vector< RVec > curFrame);
35
36         void printData();
37
38     private:
39
40         std::vector< std::vector< std::vector< double > > >                                     matrixes;
41         std::vector< std::vector< RVec > >                                                      trajectory;
42         std::vector< std::vector< RVec > >                                                      frankensteinTrajectory;
43         std::vector< std::vector< std::vector< RVec > > >                                       fitTrajectory;
44         std::vector< RVec >                                                                     reference;
45         int                                                                                     window      = 1000;         // selectable
46         int                                                                                     tau         = window / 2;   // selectable
47         int                                                                                     tauStep     = window / 10;  // selectable
48         float                                                                                   crlUpBorder = 0.5;          // selectable
49         float                                                                                   effRadius   = 1.5;          // selectable
50         int                                                                                     mode        = 0;            // selectable
51         std::string                                                                             outputName  = "";           // selectable
52         std::vector< int >                                                                      index;
53         std::vector< std::string >                                                              resNames;
54         std::vector< std::vector < std::vector < unsigned int > > >                             selections;
55         int                                                                                     count       = 0;
56
57         std::vector< std::vector< std::pair< double, int > > >                                  graph;
58         std::vector< std::vector< unsigned int > >                                              subGraphPoints;
59         std::vector< std::vector< std::pair< unsigned int, unsigned int > > >                   subGraphRbr;
60         std::vector< std::vector< std::vector< std::pair< unsigned int, unsigned int > > > >    subGraphRouts;
61
62         void trajectoryPartition();
63
64         void readWriteCorrelations(int rwMode);
65
66         void correlationEval();
67
68         void graphCalculations(unsigned int tauStart, unsigned int tauEnd);
69
70         static bool myComparisonFunction (const std::pair< int, double > i, const std::pair< int, double > j);
71
72         void graphBackBoneEvaluation();
73
74         void printOutputData();
75 };
76
77 #endif // CORRTYPE_H