-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclutter_data_analysis.h
More file actions
306 lines (245 loc) · 11.5 KB
/
Copy pathclutter_data_analysis.h
File metadata and controls
306 lines (245 loc) · 11.5 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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
/*******************************************************************************************
**** PROGRAM: clutter_data_analysis.h
**** AUTHOR: Chengan 4/01/05
**** douboer@gmail.com
******************************************************************************************/
/*******************************************************************************************
**** PROGRAM: clutter_data_analysis.h
**** AUTHOR: Chengan 4/01/05
**** douboer@gmail.com
******************************************************************************************/
#ifndef CLUTTER_DATE_ANALYSIS_H
#define CLUTTER_DATE_ANALYSIS_H
#include <math.h>
#include <cassert>
#include <string>
#include <fstream>
#include "randomc.h"
#include "prop_model.h"
#define CLUTTER_DEBUG 0
#define OLD_ALGORITHM 0
#define OUTPUT_TIME_INFOR 1 // print information of time cost - 7/19/06 CG
const double DERROR = 1.0e-25;
class FigureEditor;
class NetworkClass;
class PolygonClass;
class CellClass;
class SectorClass;
class SparseMatrixClass;
struct divDistStruct;
template<class T> class ListClass;
//compare two double data
inline bool doubleEqual(double lhs, double rhs)
{
return fabs(lhs - rhs) < DERROR ? bool(true) : bool(false);
}
class GenericClutterPropModelClass : public PropModelClass
{
public:
GenericClutterPropModelClass(char *strid = (char *) NULL);
~GenericClutterPropModelClass();
virtual const int type();
virtual double prop_power_loss(NetworkClass *, SectorClass *, int, int, int useheight=1, double angle_deg=0.0);
virtual void get_prop_model_param_ptr(int, char *, int&, int *&, double *&);
virtual int comp_num_prop_param();
virtual void print_params(FILE *fp, char *msg, int);
virtual int is_clutter_model();
virtual void split_clutter(NetworkClass *);
virtual void clt_regulation( NetworkClass* np, ListClass<int> *scan_index_list, int iterate_flag);
virtual void clt_fill( NetworkClass* np, ListClass<int> *scan_index_list);
virtual int get_color(int clutter_type, double min_neg, double max_pos);
virtual void get_min_max_color(double &min_neg, double &max_pos);
virtual void report_clutter(NetworkClass *np, FILE *fp, PolygonClass *p);
void create_svd_matrices(NetworkClass *np, ListClass<int> *, PolygonClass *, int, int, double **&mx_a, double *&vec_b);
void create_svd_matrices(NetworkClass *np, ListClass<int> *, PolygonClass *, int, int, SparseMatrixClass *&mx_a, double *&vec_b);
double solve_clutter_coe(int num_eqn, int num_var, double **mx_a,double *vec_b);
double compute_error(int num_eqn, int num_var, double **mx_a,double *vec_b);
double compute_error(SparseMatrixClass *mx_a,double *vec_b);
void clt_statistic( int& uu, int& zz, int& dd );
void define_clutter(NetworkClass *np, int clutter_sim_res_ratio);
PolygonClass *create_map_bdy();
void refine_clutter(NetworkClass *np, int n, ListClass<int> *int_list);
void save(NetworkClass *np, char *filename);
friend class NetworkClass;
friend class PropModMgrDia;
friend class PixmapItem;
friend class FigureEditor;
protected:
int offset_x, offset_y, npts_x, npts_y;
int clutter_sim_res_ratio;
int num_clutter_type; //The number of the clutter type
int useheight;
double *mvec_x; //Clutter and height coefficients
};
class ClutterPropModelClass : public GenericClutterPropModelClass
{
public:
ClutterPropModelClass(char *strid = (char *) NULL);
~ClutterPropModelClass();
const int type();
double prop_power_loss(NetworkClass *np, SectorClass *sector, int delta_x, int delta_y, int useheight=0, double angle_deg=0 );
double compute_error(int num_road_test_pt,double **clutter_dis,double *power, int plot,char *flname);
void get_prop_model_param_ptr(int param_idx, char *str, int &type, int *&iptr, double *&dptr);
int comp_num_prop_param();
void print_params(FILE *fp, char *msg, int);
void clt_regulation( NetworkClass *np ); //Estimate the coefficients of clutters that is no road test data on it.
void clt_statistic( int& uu, int& zz, int& dd );
friend class NetworkClass;
friend class PropModMgrDia;
friend class GenericClutterPropModelClass;
private:
double k, b;
};
class ClutterPropModelFullClass : public GenericClutterPropModelClass
{
public:
ClutterPropModelFullClass(char *strid = (char *) NULL);
~ClutterPropModelFullClass();
const int type();
double prop_power_loss(NetworkClass *np, SectorClass *sector, int delta_x, int delta_y, int useheight=0, double angle_deg=0 );
double compute_error(int num_road_test_pt,double **clutter_dis,double *power, int *a_posn, int plot,char *flname);
void get_prop_model_param_ptr(int param_idx, char *str, int &type, int *&iptr, double *&dptr);
int comp_num_prop_param();
void print_params(FILE *fp, char *msg, int);
void clt_regulation( NetworkClass *np ); //Estimate the coefficients of clutters that is no road test data on it.
bool clt_fit_line( double& k, double& b );
friend class NetworkClass;
friend class PropModMgrDia;
friend class FigureEditor;
private:
double fit_k, fit_b; //Fit the variables with serial values of clutter coefficient and constant.
};
class ClutterSymFullPropModelClass : public GenericClutterPropModelClass
{
public:
ClutterSymFullPropModelClass(char *strid = (char *) NULL);
~ClutterSymFullPropModelClass();
const int type();
double prop_power_loss(NetworkClass *np, SectorClass *sector, int delta_x, int delta_y, int useheight=0, double angle_deg=0 );
double compute_error(int num_road_test_pt,double **clutter_dis,double *power, int *a_posn, int plot,char *flname);
void get_prop_model_param_ptr(int param_idx, char *str, int &type, int *&iptr, double *&dptr);
int comp_num_prop_param();
void print_params(FILE *fp, char *msg, int);
void clt_regulation( NetworkClass *np ); //Estimate the coefficients of clutters that is no road test data on it.
bool clt_fit_line( double& k, double& b );
friend class NetworkClass;
friend class PropModMgrDia;
friend class FigureEditor;
private:
double fit_k, fit_b; //Fit the variables with serial values of clutter coefficient and constant.
};
class ClutterWtExpoPropModelClass : public GenericClutterPropModelClass
{
public:
ClutterWtExpoPropModelClass(char *strid = (char *) NULL);
~ClutterWtExpoPropModelClass();
const int type();
double prop_power_loss(NetworkClass *np, SectorClass *sector, int delta_x, int delta_y, int useheight=0, double angle_deg=0 );
void get_prop_model_param_ptr(int param_idx, char *str, int &type, int *&iptr, double *&dptr);
int comp_num_prop_param();
void print_params(FILE *fp, char *msg, int);
void clt_regulation( NetworkClass* np, ListClass<int> *scan_index_list, int iterate_flag);
bool clt_fit_line( double& k, double& b );
void split_clutter( NetworkClass *np );
friend class NetworkClass;
friend class PropModMgrDia;
friend class FigureEditor;
private:
double fit_k, fit_b; //Fit the variables with serial values of clutter coefficient and constant.
};
class ClutterWtExpoSlopePropModelClass : public GenericClutterPropModelClass
{
public:
ClutterWtExpoSlopePropModelClass(char *strid = (char *) NULL);
~ClutterWtExpoSlopePropModelClass();
const int type();
double prop_power_loss(NetworkClass *np, SectorClass *sector, int delta_x, int delta_y, int useheight=0, double angle_deg=0 );
void get_prop_model_param_ptr(int param_idx, char *str, int &type, int *&iptr, double *&dptr);
int comp_num_prop_param();
void print_params(FILE *fp, char *msg, int);
void clt_regulation( NetworkClass* np, ListClass<int> *scan_index_list, int iterate_flag);
void clt_fill( NetworkClass* np, ListClass<int> *scan_index_list);
bool clt_fit_line( double& k, double& b );
void split_clutter( NetworkClass *np );
int get_color(int clutter_type, double min_neg, double max_pos);
void get_min_max_color(double &min_neg, double &max_pos);
void report_clutter(NetworkClass *np, FILE *fp, PolygonClass *p);
friend class NetworkClass;
friend class PropModMgrDia;
friend class FigureEditor;
friend class GenericClutterPropModelClass;
friend class ClutterInfoWid;
private:
double r0;
};
class ClutterGlobalPropModelClass : public GenericClutterPropModelClass
{
public:
ClutterGlobalPropModelClass(char *strid = (char *) NULL);
~ClutterGlobalPropModelClass();
const int type();
double prop_power_loss(NetworkClass *np, SectorClass *sector, int delta_x, int delta_y, int useheight=0, double angle_deg=0 );
bool comp_global_model(NetworkClass *np, int num_scan_index, int *scan_index_list, double min_logd_threshold );
void get_prop_model_param_ptr(int param_idx, char *str, int &type, int *&iptr, double *&dptr);
int comp_num_prop_param();
void print_params(FILE *fp, char *msg, int);
void clt_regulation( NetworkClass* np, ListClass<int> *scan_index_list, int iterate_flag);
void clt_fill( NetworkClass* np, ListClass<int> *scan_index_list);
bool clt_fit_line( double& k, double& b );
void split_clutter( NetworkClass *np );
int get_color(int clutter_type, double min_neg, double max_pos);
void get_min_max_color(double &min_neg, double &max_pos);
void report_clutter(NetworkClass *np, FILE *fp, PolygonClass *p);
friend class NetworkClass;
friend class PropModMgrDia;
friend class FigureEditor;
friend class GenericClutterPropModelClass;
friend class ClutterInfoWid;
private:
double r0;
SegmentPropModelClass *globPm;
};
class ClutterExpoLinearPropModelClass : public GenericClutterPropModelClass
{
public:
ClutterExpoLinearPropModelClass(char *strid = (char *) NULL);
~ClutterExpoLinearPropModelClass();
const int type();
double prop_power_loss(NetworkClass *np, SectorClass *sector, int delta_x, int delta_y, int useheight=0, double angle_deg=0 );
void get_prop_model_param_ptr(int param_idx, char *str, int &type, int *&iptr, double *&dptr);
int comp_num_prop_param();
void print_params(FILE *fp, char *msg, int);
void clt_regulation( NetworkClass* np, ListClass<int> *scan_index_list, int iterate_flag);
void clt_fill( NetworkClass* np, ListClass<int> *scan_index_list);
bool clt_fit_line( double& k, double& b );
void split_clutter( NetworkClass *np );
int get_color(int clutter_type, double min_neg, double max_pos);
void get_min_max_color(double &min_neg, double &max_pos);
void report_clutter(NetworkClass *np, FILE *fp, PolygonClass *p);
friend class NetworkClass;
friend class PropModMgrDia;
friend class FigureEditor;
friend class GenericClutterPropModelClass;
friend class ClutterInfoWidClass;
private:
double exponent, r0;
};
struct divDistStruct
{
int c_idx; //Keep the corresponding clutter index that the line from CS to object point.
double divD; //Keep the value of D(i)/D(i-1), i is the passed clutter index, D is the cumulative sum distance of passed clutters.
};
struct distStruct
{
int c_idx;
double d;
};
// xxxxxxxxxx DELETE bool check_clt_bdy( NetworkClass* np, CellClass *cell );
int get_clt_idx( NetworkClass* np, CellClass *cell );
//int matrixQR(matrix&, matrix& );
#if 0
int matrixQR( double** r_mat, double** q_mat, int M, int N );
int le_houseHolder(double** a, double* b, int M, int N );
#endif
/************************************************************************************************/
#endif