#include "kdtree.h"
#include "const.h"
#include "emalloc.h"
#include "freelist.h"
#include <stdio.h>
#include <math.h>
#include <setjmp.h>
Defines | |
#define | Magnitude(X) ((X) < 0 ? -(X) : (X)) |
#define | MIN(A, B) ((A) < (B) ? (A) : (B)) |
#define | NodeFound(N, K, D) (( (N)->Key == (K) ) && ( (N)->Data == (D) )) |
#define | MINSEARCH -MAX_FLOAT32 |
#define | MAXSEARCH MAX_FLOAT32 |
Functions | |
KDTREE * | MakeKDTree (inT16 KeySize, PARAM_DESC KeyDesc[]) |
void | KDStore (KDTREE *Tree, FLOAT32 *Key, void *Data) |
void | KDDelete (KDTREE *Tree, FLOAT32 Key[], void *Data) |
int | KDNearestNeighborSearch (KDTREE *Tree, FLOAT32 Query[], int QuerySize, FLOAT32 MaxDistance, void *NBuffer, FLOAT32 DBuffer[]) |
void | KDWalk (KDTREE *Tree, void_proc Action) |
void | FreeKDTree (KDTREE *Tree) |
int | Equal (FLOAT32 Key1[], FLOAT32 Key2[]) |
KDNODE * | MakeKDNode (FLOAT32 Key[], char *Data, int Index) |
void | FreeKDNode (KDNODE *Node) |
void | Search (int Level, KDNODE *SubTree) |
FLOAT32 | ComputeDistance (register int N, register PARAM_DESC Dim[], register FLOAT32 p1[], register FLOAT32 p2[]) |
void | FindMaxDistance () |
int | QueryIntersectsSearch () |
int | QueryInSearch () |
void | Walk (KDNODE *SubTree, inT32 Level) |
void | FreeSubTree (KDNODE *SubTree) |
#define Magnitude | ( | X | ) | ((X) < 0 ? -(X) : (X)) |
---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------
#define MAXSEARCH MAX_FLOAT32 |
#define MIN | ( | A, | |||
B | ) | ((A) < (B) ? (A) : (B)) |
#define MINSEARCH -MAX_FLOAT32 |
---------------------------------------------------------------------------- Global Data Definitions and Declarations ----------------------------------------------------------------------------
#define NodeFound | ( | N, | |||
K, | |||||
D | ) | (( (N)->Key == (K) ) && ( (N)->Data == (D) )) |
FLOAT32 ComputeDistance | ( | register int | N, | |
register PARAM_DESC | Dim[], | |||
register FLOAT32 | p1[], | |||
register FLOAT32 | p2[] | |||
) |
---------------------------------------------------------------------------- Private Code ----------------------------------------------------------------------------
void FindMaxDistance | ( | ) |
void FreeKDNode | ( | KDNODE * | Node | ) |
void FreeKDTree | ( | KDTREE * | Tree | ) |
void FreeSubTree | ( | KDNODE * | SubTree | ) |
int KDNearestNeighborSearch | ( | KDTREE * | Tree, | |
FLOAT32 | Query[], | |||
int | QuerySize, | |||
FLOAT32 | MaxDistance, | |||
void * | NBuffer, | |||
FLOAT32 | DBuffer[] | |||
) |
KDTREE* MakeKDTree | ( | inT16 | KeySize, | |
PARAM_DESC | KeyDesc[] | |||
) |
---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------
int QueryInSearch | ( | ) |
int QueryIntersectsSearch | ( | ) |
void Search | ( | int | Level, | |
KDNODE * | SubTree | |||
) |