The Cuik KD-Tree Library
cuik-kdtree.c
Go to the documentation of this file.
double KDtreeSamplingExpansion(TKDtree *kdt) Returns the sampling expansion used in the kd-tree. Definition: cuik-kdtree.c:764 void RandomPointInRectangle(double *c, Trectangle *b) Returns the a random point along the selected dimensions. Definition: rectangle.c:145 unsigned int GetRectangleSplitDim(Trectangle *b) Computes the rectangle dimension for which it is better to split the rectangle. Definition: rectangle.c:344 void GetRectangleLimits(unsigned int i, double *l, double *u, Trectangle *b) Gets the limits of the rectangle along a given dimension. Definition: rectangle.c:115 void SampleInKDtree(double *point, TKDtree *kdt) Generates a random sample. Definition: cuik-kdtree.c:747 double SquaredDistanceToRectangleDimension(unsigned int dim, double p, unsigned int *tp, Trectangle *b) Squared distance from a value to a given rectangle dimension. Definition: rectangle.c:153 void InitRectangleFromPoint(unsigned int dim, double *p, Trectangle *b) Initializes a rectangle from a point. Definition: rectangle.c:35 void SetRectangleLowerLimit(unsigned int i, double l, Trectangle *b) Set the lower limit. Definition: rectangle.c:123 void CopyRectangle(Trectangle *b_out, Trectangle *b_in) Rectangle copy operator. Definition: rectangle.c:91 double SquaredDistanceToRectangle(double t2, double *p, unsigned int *tp, Trectangle *b) Squared distance from a point to a rectangle. Definition: rectangle.c:230 void ExpandRectangle(double *p, Trectangle *b) Expands a rectangle so that it includes a given point. Definition: rectangle.c:52 void SearchKDtree(double dr2, double *p, double *d2, unsigned int *id, TKDtree *kdt) Searches the nearest point on a KD-tree. Definition: cuik-kdtree.c:364 #define KDTREE_PRINT_INDENT(f, indent) Auxiliary macro to print the kd-tree. Definition: cuik-kdtree.c:55 Definition of constants and macros used in several parts of the library. Headers of the kd-tree implementation. void SetRectangleUpperLimit(unsigned int i, double u, Trectangle *b) Set the upper limit. Definition: rectangle.c:130 double VectorSquaredDistanceTopologyMin(double t2, unsigned int s, unsigned int *tp, double *v1, double *v2) Computes the squared distance of two points. Definition: vector.c:17 TKDtree * BuildKDTree(Trectangle *ambient, unsigned int *topology, unsigned int nd, unsigned int m, double r, unsigned int n, double **points, unsigned int *ids) Initializes a kd-tree from a set of points. Definition: cuik-kdtree.c:132 Definition of basic operations between points. #define NO_UINT Used to denote an identifier that has not been initialized. Definition: definitions.h:133 Definition of basic randomization functions. void PrintKDtree(FILE *f, unsigned int indent, TKDtree *kdt) Prints a kd-tree. Definition: cuik-kdtree.c:769 unsigned int NearestNeighbour(double *point, TKDtree *kdt) Determines the nearest-neighbour for a point. Definition: cuik-kdtree.c:714 void NeighboursInBall(double *point, double r, unsigned int *n, unsigned int **ids, TKDtree *kdt) Neighbours in a ball. Definition: cuik-kdtree.c:730 unsigned int GetRectangleDim(Trectangle *b) Returns the dimension of the rectangle. Definition: rectangle.c:47 TKDtree * InitKDTree(Trectangle *ambient, unsigned int *topology, unsigned int m, double r, unsigned int n, double **points, unsigned int *ids) Initializes a kd-tree from a set of points. Definition: cuik-kdtree.c:544 void SetRectangleLimits(unsigned int i, double l, double u, Trectangle *b) Changes a rectangle along a given dimension. Definition: rectangle.c:137 void AddPoint2KDtree(double *point, unsigned int id, TKDtree **kdt) Adds a point to a kd-tree. Definition: cuik-kdtree.c:582 #define MEM_DUP(_var, _n, _type) Duplicates a previously allocated memory space. Definition: definitions.h:123 void SearchInBallKDtree(double dr2, double *p, double r2, unsigned int *n, unsigned int *m, unsigned int **id, TKDtree *kdt) Searches the near points on a KD-tree. Definition: cuik-kdtree.c:421 double EnlargeRectangleWithLimits(double r, Trectangle *limits, Trectangle *bIn, Trectangle *bOut) Enlarges a box remaining in a given limits. Definition: rectangle.c:68 |
Follow us!