28 #include <grass/dataquad.h>
29 #include <grass/qtree.h>
106 int j = 0, i, k, comp;
109 fprintf(stderr,
"insert: tree is NULL\n");
113 fprintf(stderr,
"insert: tree->data is NULL\n");
120 if ((comp < 1) || (comp > n_leafs))
133 j =
MT_insert(point, info, tree, n_leafs);
138 fprintf(stderr,
"Point out of range!\n");
163 fprintf(stderr,
"datas is NULL\n");
168 for (i = 1; i <= n_leafs; i++) {
194 fprintf(stderr,
"MT_region_data: tree is NULL\n");
198 fprintf(stderr,
"MT_region_data: data is NULL\n");
203 for (j = 0; j < n_leafs; j++) {
int compare(const void *a, const void *b)
int MT_region_data(struct tree_info *info, struct multtree *tree, struct quaddata *data, int MAX, int n_leafs)
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 tree_info * MT_tree_info_new(struct multtree *root, struct multfunc *functions, double dmin, int kmax)
struct multtree * MT_tree_new(struct quaddata *data, struct multtree **leafs, struct multtree *parent, int multant)
int MT_divide(struct tree_info *info, struct multtree *tree, int n_leafs)
int MT_insert(struct triple *point, struct tree_info *info, struct multtree *tree, int n_leafs)
int(* compare)(struct triple *, struct quaddata *)
int(* division_check)(struct quaddata *, int)
int(* get_points)(struct quaddata *, struct quaddata *, int)
int(* add_data)(struct triple *, struct quaddata *, double)
int(* intersect)(struct quaddata *, struct quaddata *)
struct quaddata **(* divide_data)(struct quaddata *, int, double)
struct multfunc * functions