| 1 |
#include <grass/raster.h> |
| 2 |
|
| 3 |
#define MELEMENT struct Melement |
| 4 |
MELEMENT |
| 5 |
{ |
| 6 |
int x, y; /* grid coordinates */ |
| 7 |
int value; |
| 8 |
MELEMENT *next, *prior; /* next and prior element in row list */ |
| 9 |
}; |
| 10 |
|
| 11 |
#define NEIGHBOR struct neighbor |
| 12 |
NEIGHBOR |
| 13 |
{ |
| 14 |
double distance; |
| 15 |
MELEMENT *Mptr, /* pointer to data in linked lists of input */ |
| 16 |
**searchptr; /* row search pointer that identified this |
| 17 |
neighbor */ |
| 18 |
NEIGHBOR *next; |
| 19 |
}; |
| 20 |
|
| 21 |
/* structure for search pointers which access a row list of MELEMENTs */ |
| 22 |
/* if latitude-longitude, ealive and walive prevent search collisions on a |
| 23 |
circular, doubly-linked list; else, list is linear (NULL terminated) and |
| 24 |
pointers to MELEMENT are set NULL to indicate end of search in a direction */ |
| 25 |
#define EW struct ew |
| 26 |
EW |
| 27 |
{ |
| 28 |
MELEMENT *east, /* next eastward search in this row */ |
| 29 |
*west, /* next westward search in this row */ |
| 30 |
*start; /* starting point of east and west search in this row */ |
| 31 |
int ealive, walive; /* used only for latitude-longitude, |
| 32 |
TRUE if search is active in this direction */ |
| 33 |
EW *next; |
| 34 |
}; |
| 35 |
|
| 36 |
/* dist.c */ |
| 37 |
int G_begin_geodesic_distance_l(int, double, double); |
| 38 |
double LL_set_geodesic_distance_lat(double); |
| 39 |
double set_sdlmr(double); |
| 40 |
int LL_set_geodesic_distance(double *, int, int); |
| 41 |
double LL_geodesic_distance(double); |
| 42 |
int free_dist_params(void); |
| 43 |
|
| 44 |
/* ll.c */ |
| 45 |
int extend_west(EW *); |
| 46 |
int extend_east(EW *); |
| 47 |
double distance_LL(int, int, MELEMENT *); |
| 48 |
int LL_lookup_tables(int, int); |
| 49 |
|
| 50 |
/* main.c */ |
| 51 |
int lookup_and_function_ptrs(int, int); |
| 52 |
int interpolate(MELEMENT[], int, int, int, int, int, int); |
| 53 |
int make_neighbors_list(EW *, EW *, EW *, int, int, NEIGHBOR *, int); |
| 54 |
int search(EW **, NEIGHBOR *, int, int, int, int *, EW *, int); |
| 55 |
int exhaust(EW **, NEIGHBOR *, int, int); |
| 56 |
EW *next_row(EW *, EW *, int *, int); |
| 57 |
double triangulate(MELEMENT *, int, int); |
| 58 |
int add_neighbor(MELEMENT **, NEIGHBOR *, double, int); |
| 59 |
int replace_neighbor(MELEMENT **, NEIGHBOR *, double); |
| 60 |
int sort_neighbors(NEIGHBOR *, double); |
| 61 |
int free_row_lists(MELEMENT *, int); |
| 62 |
MELEMENT *row_lists(int, int, int *, int *, int, CELL *); |
| 63 |
int lookup_tables(int, int); |