predictor.h
3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef DEF_HPREDICTOR
#define DEF_HPREDICTOR
#include <vector>
class Predictor
{
public:
Predictor(const std::vector < unsigned int > &v,
const std::vector < float > &vWCt,
const std::vector < float > &vWP,
const std::vector < float > &vWE,
const std::vector < std::vector < unsigned int > > &Nvs,
//const std::vector < std::vector < float > > &NvWCps,
const std::vector < std::vector < unsigned int > > &NvBs,
const std::vector < std::vector < unsigned int > > &G2vertices,
const std::vector < std::vector < std::vector < unsigned int > > > &G2Nv,
const std::vector < std::vector < unsigned int > > &G2G1correspondance);
~Predictor();
void predict(unsigned int T, float alphas, float alphar, float Po, unsigned int pseudoknotLevel,
unsigned int I, unsigned int seed, unsigned int nbHardCT);
unsigned int get_iter_();
std::vector < std::tuple < std::vector < unsigned int >, std::vector < float > > > get_best_cliques_();
//std::vector < std::tuple < std::vector < unsigned int >, std::vector < float > > > get_cliques_();
int dominate(std::vector < float > c1, std::vector < float > c2);
bool approximatelyEqualAbsRel(float a, float b, float absEpsilon, float relEpsilon);
bool paretoRespectHardCT(unsigned int nbHardCT);
int findPseudoknotLevel (std::vector< unsigned int > clique, int add, int del);
void printVector (int opt);
private:
std::vector < unsigned int > vertices;
std::vector < float > verticesWCt; /* user constraint weight */
std::vector < float > verticesWP; /* probing weight */
std::vector < float > verticesWE; /* energy weight */
std::vector < std::vector < unsigned int > > Nv; /* vector of linked vertices for any vertex*/
//std::vector < std::vector < float > > NvWCp; /* vector of compatibility of linked vertices for any vertex*/
std::vector < std::vector < unsigned int > > NvB; /* vector of no linked vertices for any vertex*/
std::vector < std::tuple < std::vector < unsigned int >, std::vector < float > > > cliques_; /*vector of cliques*/
std::vector < unsigned int > tabu;
std::vector < std::vector < unsigned int > > Csubopt;
std::vector < std::vector < float > > Fcsubopt;
std::vector < unsigned int > PA;
std::vector < std::tuple< unsigned int, unsigned int, std::vector < float > > > OM;
unsigned int L;
std::vector < unsigned int > C; //clique
std::vector < float > fc; //objective value of the clique
std::vector < std::vector < unsigned int > > Cbest; // best solutions found so far Pareto front
std::vector < std::vector < float > > fbest; // best objective value reached so far Pareto front
std::vector < unsigned int > Cp; //last local optimum
unsigned int w; //counter for consecutive non-improving local optima
unsigned int iter_;
/* pseudoknot graphs */
std::vector < std::vector < unsigned int > > G2vertices; /* vertex vectors of each G2 graphs
* vertices are sorted by the beginning of each interval */
std::vector < std::vector < std::vector < unsigned int > > > G2Nv; /* Nv vectors of each G2 graphs */
std::vector < std::vector < unsigned int > > G2G1correspondance; /* G1 vertex correspondance vector of each G2 graph */
};
#endif