Go to the documentation of this file.
34 NEW(t-> tp,t-> m, unsigned int);
35 memcpy(t-> tp,topology, sizeof( unsigned int)*t-> m);
46 InitRectangle(nd,NULL,NULL,&rec);
55 t->kdtree=InitKDTree(&rec,topology,25,0,1,&p,& id);
57 DeleteRectangle(&rec);
63 t->kdtree=CreateKDTree(t-> m);
65 t->kdtree=CreateKDTreeT(t-> m,( int *)t-> tp);
69 NEW(t->n2id,t->mp, unsigned int);
83 Error( "The kd-tree in the NN library can only hold one million points");
86 MEM_DUP(t->n2id,t->mp, unsigned int);
106 AddPoint2KDTree(p,t->kdtree);
124 QueryKDTreeR( GetChartCenter(mp),t-> r,( int *)nn,( int **)n,&d,t->kdtree);
139 QueryKDTreeR(p,t-> r,( int *)nn,( int **)n,&d,t->kdtree);
150 (*n)[i]=t->n2id[(*n)[i]];
161 DeleteKDtree(t->kdtree);
166 DeleteKDTree(t->kdtree);
void AddChart2Btree(unsigned int id, Tchart *mp, TBTree *t) Adds a chart to the tree.
Tinterval * GetBoxInterval(unsigned int n, Tbox *b) Returns a pointer to one of the intervals defining the box.
#define NEW(_var, _n, _type) Allocates memory space.
void SearchInBtree(Tchart *mp, unsigned int *nn, unsigned int **n, TBTree *t) Search for neighbouring charts.
void ArrayPi2Pi(unsigned int n, unsigned int *t, double *a) Applies PI2PI to an array.
Definition binary tree of charts.
#define INIT_NUM_POINTS_IN_BTREE Initial number of points in the tree.
void DeleteBTree(TBTree *t) Chart tree destructor.
void Error(const char *s) General error function.
unsigned int GetBoxNIntervals(Tbox *b) Box dimensionality.
double GetChartRadius(Tchart *c) Returns de range of the chart.
double LowerLimit(Tinterval *i) Gets the lower limit.
void InitBTree(unsigned int id, Tchart *mp, Tbox *ambient, unsigned int *topology, TBTree *t) Initializes a binary tree of charts.
unsigned int GetChartAmbientDim(Tchart *c) Dimensionality of the ambient space.
double UpperLimit(Tinterval *i) Gets the uppser limit.
#define MEM_DUP(_var, _n, _type) Duplicates a previously allocated memory space.
double * GetChartCenter(Tchart *c) Returns the center of the chart.
|
Follow us!