/* updated by Mitasova Nov. 96, no changes necessary */ DATa STRUCTURES: ---------------- #define VOID_T char struct multfunc { int (*compare) (); VOID_T **(*divide_data) (); int (*add_data) (); int (*intersect) (); int (*division_check) (); int (*get_points) (); }; struct tree_info { struct multfunc *functions; double dmin; int kmax; struct multtree *root; }; struct multtree { VOID_T *data; struct multtree **leafs; struct multtree *parent; int multant; }; FUNCTIONS: ---------- struct multfunc * MT_functions_new(compare,divide_data,add_data, intersect,division_check,get_points) int (*compare) (); VOID_T **(*divide_data) (); int (*add_data) (); int (*intersect) (); int (*division_check) (); int (*get_points) (); /* Initializes FUNCTIONS structure with given arguments*/ struct tree_info * MT_tree_info_new (root,functions,dmin,kmax) struct multtree *root; struct multfunc *functions; double dmin; int kmax; /*Initializes TREE_INFO using given arguments*/ struct multtree * MT_tree_new (data, leafs, parent, multant) VOID_T *data; struct multtree **leafs; struct multtree *parent; int multant; /*Initializes TREE using given arguments*/ int MT_insert (point,info,tree,n_leafs) VOID_T *point; struct tree_info *info; struct multtree *tree; int n_leafs; /*First checks for dividing cond. (if n_points>=KMAX) and TREE is a leaf by calling one of tree's functions (division_check()). If TREE is not a leaf (is a node) uses function compare to determine into which "son" we need to insert the point and calls MT_insert() with this son as a n argument. If TREE is a leaf but we don't need to divide it (n_points