-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.h
154 lines (108 loc) · 4.44 KB
/
node.h
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#ifndef NODE_H
#define NODE_H
#include "gp_wrapper.h"
class node{
public:
node();
node(const node&);
node& operator=(const node&);
~node();
void set_center_dex(int);
void set_gpWrapper(gpWrapper*);
void set_dice(Ran*);
void evaluate(array_1d<double>&,double*,int*);
void evaluateNoAssociate(array_1d<double>&,double*,int*);
void evaluate(array_1d<double>&,double*,int*,int);
void project_to_unit_sphere(array_1d<double>&, array_1d<double>&);
void add_as_boundary(int);
int search();
void set_farthest_associate(double);
Ran* get_Ran();
gpWrapper* get_gpWrapper();
int get_center();
double get_geographic_center(int);
void copy(const node&);
double get_farthest_associate();
int get_n_associates();
int get_n_boundary();
int get_boundary(int);
double get_time();
double get_time_coulomb();
double get_time_bases();
double get_time_ricochet();
void set_time(double);
int get_ct_search();
int get_ct_ricochet();
int get_ct_coulomb();
int get_ct_bases();
int get_calls_to_bases();
double get_basis(int,int);
double get_basis_model(int);
double apply_model(array_1d<double>&);
double apply_model(array_1d<double>&,array_2d<double>&,array_1d<double>&);
void set_basis(int,int,double);
double volume();
int is_it_active();
double get_max(int);
double get_min(int);
void flush_candidates(array_1d<int>&);
int get_n_oldCenters();
int get_oldCenter(int);
private:
array_1d<int> associates,boundaryPoints;
array_2d<double> basisVectors;
array_1d<double> basisModel;
array_1d<double> range_max,range_min,geographicCenter;
array_1d<int> candidates,centerCandidates,oldCenters;
array_1d<int> compass_centers;
int ct_search,ct_coulomb,ct_bases,ct_ricochet;
int calls_to_bases;
int last_expanded,activity;
int center_dex,min_dex,last_nBasisAssociates,last_nAssociates;
double time_ricochet,time_coulomb,time_search,time_bases;
double farthest_associate,time_penalty;
gpWrapper *gg;
Ran *dice;
void set_names();
int bisection(int,int);
int bisection(array_1d<double>&,double,array_1d<double>&,double,int);
int bisection(array_1d<double>&,double,array_1d<double>&,double);
int bisectionAssociate(int,int);
int bisectionAssociate(array_1d<double>&,double,array_1d<double>&,double);
int bisection(int,int,int);
int coulomb_search();
void ricochet_search(int,array_1d<double>&);
int ricochet_driver(int,array_1d<double>&,array_1d<double>&);
void compass_search(int);
void find_bases();
int perturb_bases(array_2d<double>&,int,array_1d<double>&,array_2d<double>&);
double basis_error(array_2d<double>&,array_1d<int>&,array_1d<double>&);
double basis_error_simplex(array_2d<double>&,array_1d<int>&,array_1d<double>&);
double basis_error_fn(array_2d<double>&, array_1d<int>&, array_1d<double>&);
void recenter();
void project_distance(int,array_1d<double>&,array_2d<double>&,
array_1d<double>&);
void project_distance(array_1d<double>&,int,array_2d<double>&,
array_1d<double>&);
void project_distance(int, int, array_2d<double>&, array_1d<double>&);
void project_distance(array_1d<double>&, array_1d<double>&,
array_2d<double>&, array_1d<double>&);
};
class arrayOfNodes{
public:
arrayOfNodes();
~arrayOfNodes();
void add(int,gpWrapper*,Ran*);
void add(int,Ran*,gpWrapper*);
void add(Ran*,int,gpWrapper*);
void add(Ran*,gpWrapper*,int);
void add(gpWrapper*,Ran*,int);
void add(gpWrapper*,int,Ran*);
int get_dim();
void remove(int);
node* operator()(int);
private:
node *data;
int ct,room;
};
#endif