28 #include <grass/dataquad.h> 29 #include <grass/qtree.h> 108 int j = 0, i, k, comp;
111 fprintf(stderr,
"insert: tree is NULL\n");
115 fprintf(stderr,
"insert: tree->data is NULL\n");
122 if ((comp < 1) || (comp > n_leafs))
135 j =
MT_insert(point, info, tree, n_leafs);
140 fprintf(stderr,
"Point out of range!\n");
167 fprintf(stderr,
"datas is NULL\n");
172 for (i = 1; i <= n_leafs; i++) {
203 fprintf(stderr,
"MT_region_data: tree is NULL\n");
207 fprintf(stderr,
"MT_region_data: data is NULL\n");
212 for (j = 0; j < n_leafs; j++) {
struct tree_info * MT_tree_info_new(struct multtree *root, struct multfunc *functions, double dmin, int kmax)
struct multfunc * MT_functions_new(int(*compare)(struct triple *, struct quaddata *), struct quaddata **(*divide_data)(struct quaddata *, int, double), int(*add_data)(struct triple *, struct quaddata *, double), int(*intersect)(struct quaddata *, struct quaddata *), int(*division_check)(struct quaddata *, int), int(*get_points)(struct quaddata *, struct quaddata *, int))
struct multtree * MT_tree_new(struct quaddata *data, struct multtree **leafs, struct multtree *parent, int multant)
struct multfunc * functions
int MT_region_data(struct tree_info *info, struct multtree *tree, struct quaddata *data, int MAX, int n_leafs)
int compare(const void *a, const void *b)
struct quaddata **(* divide_data)()
int MT_insert(struct triple *point, struct tree_info *info, struct multtree *tree, int n_leafs)
int MT_divide(struct tree_info *info, struct multtree *tree, int n_leafs)