2
/***********************************************************************
6
* AUTHOR(S): Roberto Antolin
8
* PURPOSE: LIDAR library
10
* COPYRIGHT: (C) 2006 by Politecnico di Milano -
11
* Polo Regionale di Como
13
* This program is free software under the
14
* GNU General Public License (>=v2).
15
* Read the file COPYING that comes with GRASS
18
**************************************************************************/
20
#ifndef _POLIMIFUNCT_H_
21
#define _POLIMIFUNCT_H_
23
#include <grass/config.h>
24
#include <grass/gis.h>
25
#include <grass/Vect.h>
26
#include <grass/dbmi.h>
27
#include <grass/glocale.h>
28
#include <grass/gmath.h>
30
/*----------------------------------------------------------------------------------------------------------*/
31
/*CONSTANTS DECLARATION */
33
#define NSPLX_MAX 150 /* Maximum number of splines along East direction used in the subregions interpolation */
34
#define NSPLY_MAX 150 /* Maximum number of splines along North direction used in the subregions interpolation */
35
#define OVERLAP_SIZE 10 /* Subregions overlapping size. */
36
#define LATO 1000 /* Side's size for v.lidar.growing. */
37
#define CONTOUR 15 /**/
39
#define GENERAL_COLUMN 1
42
#define FIRST_COLUMN 4
45
#define F_EDGE_DETECTION_CLASS 1
46
#define F_CLASSIFICATION 2
47
#define F_INTERPOLATION 3
48
#define F_COUNTER_OBJ 4
49
/* PRE-CLASSIFICATION */
53
/* FINAL CLASSIFICATION */
54
#define TERRAIN_SINGLE 1
55
#define TERRAIN_DOUBLE 2
56
#define OBJECT_DOUBLE 3
57
#define OBJECT_SINGLE 4
58
/* SINGLE OR DOUBLE PULSE */
59
#define SINGLE_PULSE 1
60
#define DOUBLE_PULSE 2
64
/* Boolean definitions */
68
/*----------------------------------------------------------------------------------------------------------*/
69
/*STRUCTS DECLARATION */
72
double orlo_h; /*Horizontal tile edge */
73
double orlo_v; /*Vertical tile edge */
74
double overlap; /*Tile's overlapping size */
75
double latoN; /*South-North side size */
76
double latoE; /*East-West side size */
95
/*----------------------------------------------------------------------------------------------------------*/
96
/*FUNCTIONS DECLARATION */
98
void P_zero_dim(struct Reg_dimens * /**/);
99
int P_set_dim(struct Reg_dimens *, double, double, int *, int *);
101
int P_set_regions(struct Cell_head *, /**/
103
BOUND_BOX *, /**/ struct Reg_dimens, /**/ int /**/);
105
int P_get_orlo(int, /**/ struct Reg_dimens *, /**/ double, /**/ double /**/);
107
int P_get_BandWidth(int, /**/ int /**/);
109
double P_estimate_splinestep(struct Map_info *, double *, double *);
111
struct Point *P_Read_Vector_Region_Map(struct Map_info *, /**/
112
struct Cell_head *, /**/
113
int *, /**/ int, /**/ int /**/);
115
double P_Mean_Calc(struct Cell_head *, /**/ struct Point *, /**/ int /**/);
117
/*----------------------------------------------------------------------------------------------------------*/
119
P_Sparse_Points(struct Map_info *, /**/
120
struct Cell_head *, /**/
133
struct line_cats *, /**/
134
dbDriver *, /**/ double, /**/ char * /**/);
136
double **P_Regular_Points(struct Cell_head *, /**/
145
int, /**/ int, /**/ int, /**/ int, /**/ int /**/);
147
/*----------------------------------------------------------------------------------------------------------*/
148
int P_Create_Aux2_Table(dbDriver *, /**/ char * /**/);
150
int P_Create_Aux4_Table(dbDriver *, /**/ char * /**/);
152
int P_Drop_Aux_Table(dbDriver *, /**/ char * /**/);
154
/*----------------------------------------------------------------------------------------------------------*/
155
void P_Aux_to_Raster(double **, /**/ int /**/);
157
void P_Aux_to_Vector(struct Map_info *, /**/
158
struct Map_info *, /**/ dbDriver *, /**/ char * /**/);
160
double **P_Null_Matrix(double ** /**/);
162
/*----------------------------------------------------------------------------------------------------------*/
164
void tcholDec(double **N, double **T, int n, int BW);
165
void tcholSolve(double **N, double *TN, double *parVect, int n, int BW);
166
void tcholSolve2(double **N, double *TN, double **T, double *parVect, int n,
168
void tcholInv(double **N, double *invNdiag, int n, int BW);
169
void tcholSolveInv(double **N, double *TN, double *invNdiag, double *parVect,
172
/*---------------------------------------------------------------------------------------*/
174
void normalDefBicubic(double **N, double *TN, double *Q, double **obsVect,
175
double deltaX, double deltaY, int xNum, int yNum,
176
double xMin, double yMin, int obsNum, int parNum,
179
void normalDefBilin(double **N, double *TN, double *Q, double **obsVect,
180
double deltaX, double deltaY, int xNum, int yNum,
181
double xMin, double yMin, int obsNum, int parNum, int BW);
183
void nCorrectLapl(double **N, /* Normal Matrix () */
188
double deltaY); /* */
190
void nCorrectGrad(double **N, double lambda, int xNum, int yNum,
191
double deltaX, double deltaY);
193
void obsEstimateBicubic(double **obsV, /* */
204
double dataInterpolateBicubic(double x, /* */
212
double *parVect); /* */
214
void obsEstimateBilin(double **obsV, double *obsE, double *parV, double deltX,
215
double deltY, int xNm, int yNm, double xMi, double yMi,
218
double dataInterpolateBilin(double x, double y, double deltaX, double deltaY,
219
int xNum, int yNum, double xMin, double yMin,