Loading...
Searching...
No Matches
qtree.h File Reference

Go to the source code of this file.

## Data Structures

struct | multfunc
struct | tree_info
struct | multtree

## Macros

#define | VOID_T char

## Functions

struct multfunc * | MT_functions_new (int(*)(struct triple *, struct quaddata *), struct quaddata **(*)(struct quaddata *, int, double), int(*)(struct triple *, struct quaddata *, double), int(*)(struct quaddata *, struct quaddata *), int(*)(struct quaddata *, int), int(*)(struct quaddata *, struct quaddata *, int))
struct tree_info * | MT_tree_info_new (struct multtree *, struct multfunc *, double, int)
struct multtree * | MT_tree_new (struct quaddata *, struct multtree **, struct multtree *, int)
int | MT_insert (struct triple *, struct tree_info *, struct multtree *, int)
int | MT_divide (struct tree_info *, struct multtree *, int)
int | MT_region_data (struct tree_info *, struct multtree *, struct quaddata *, int, int)

## Macro Definition Documentation

## VOID_T

#define VOID_T char

Definition at line 28 of file qtree.h.

Referenced by BM_destroy_sparse(), BM_set_sparse(), link__get_next(), link__set_next(), link_dispose(), link_init(), and link_new().

## Function Documentation

## MT_divide()

int MT_divide | ( | struct tree_info * | info,
|  | struct multtree * | tree,
|  | int | n_leafs )

Divide a tree

Divides the tree by calling one of tree's functions (divide_data()) and returns the result of divide_data()

Definition at line 154 of file qtree.c.

References multtree::data, multfunc::divide_data, tree_info::dmin, tree_info::functions, tree_info::kmax, multtree::leafs, MT_tree_new(), and NULL.

Referenced by MT_insert().

## MT_functions_new()

struct multfunc * MT_functions_new | ( | int(* | )(struct triple *, struct quaddata *),
|  | struct quaddata ** | *)(struct quaddata *, int, double,
|  | int(* | )(struct triple *, struct quaddata *, double),
|  | int(* | )(struct quaddata *, struct quaddata *),
|  | int(* | )(struct quaddata *, int),
|  | int(* | )(struct quaddata *, struct quaddata *, int) )

## MT_insert()

int MT_insert | ( | struct triple * | 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<KMAX) then calls function add_data(point, ...) to add point to the data of tree and returns the result of add_data() (which returns 1 if the point is inserted and 0 if its ignored (when its too dense)).

If division_check() returns true, calls MT_divide() and then calls MT_insert() to insert the point into divided tree and returns the result of MT_divide().

Definition at line 103 of file qtree.c.

References multfunc::add_data, multfunc::compare, multtree::data, multfunc::division_check, tree_info::dmin, tree_info::functions, tree_info::kmax, multtree::leafs, MT_divide(), MT_insert(), and NULL.

Referenced by MT_insert(), and process_point().

## MT_region_data()

int MT_region_data | ( | struct tree_info * | info,
|  | struct multtree * | tree,
|  | struct quaddata * | data,
|  | int | MAX,
|  | int | n_leafs )

Get points inside a region from a tree

Gets points inside the region defined by DATA from TREE and adds them to DATA. If the number of eligible point is more than MAX returns MAX+1 otherwise returns number of points added to DATA.

Uses tree's functions intersect() to find leafs that intersect given region and get_points() to get points from such leafs.

Parameters

  MAX | max number of points we can add (KMAX2)

Definition at line 186 of file qtree.c.

References multtree::data, tree_info::functions, multfunc::get_points, multfunc::intersect, multtree::leafs, MAX, MT_region_data(), and NULL.

Referenced by IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), and MT_region_data().

## MT_tree_info_new()

struct tree_info * MT_tree_info_new | ( | struct multtree * | root,
|  | struct multfunc * | functions,
|  | double | dmin,
|  | int | kmax )

Initializes tree_info using given arguments

Definition at line 55 of file qtree.c.

References tree_info::dmin, tree_info::functions, tree_info::kmax, NULL, and tree_info::root.

## MT_tree_new()

struct multtree * MT_tree_new | ( | struct quaddata * | data,
|  | struct multtree ** | leafs,
|  | struct multtree * | parent,
|  | int | multant )

Initializes multtree using given arguments

Definition at line 72 of file qtree.c.

References multtree::data, multtree::leafs, multtree::multant, NULL, and multtree::parent.

Referenced by MT_divide().