tesseract v5.3.3.20231005
kdtree.cpp File Reference
#include "kdtree.h"
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <cstdio>

Go to the source code of this file.

Classes

class  tesseract::MinK< Key, Value >
 
struct  tesseract::MinK< Key, Value >::Element
 
class  tesseract::KDTreeSearch
 

Namespaces

namespace  tesseract
 

Macros

#define Magnitude(X)   ((X) < 0 ? -(X) : (X))
 
#define NodeFound(N, K, D)   (((N)->Key == (K)) && ((N)->Data == (D)))
 
#define MINSEARCH   (-FLT_MAX)
 
#define MAXSEARCH   FLT_MAX
 

Functions

KDTREE * tesseract::MakeKDTree (int16_t KeySize, const PARAM_DESC KeyDesc[])
 
void tesseract::KDStore (KDTREE *Tree, float *Key, CLUSTER *Data)
 
void tesseract::KDDelete (KDTREE *Tree, float Key[], void *Data)
 
void tesseract::KDNearestNeighborSearch (KDTREE *Tree, float Query[], int QuerySize, float MaxDistance, int *NumberOfResults, void **NBuffer, float DBuffer[])
 
void tesseract::KDWalk (KDTREE *Tree, kdwalk_proc action, ClusteringContext *context)
 
float tesseract::DistanceSquared (int k, PARAM_DESC *dim, float p1[], float p2[])
 
float tesseract::ComputeDistance (int k, PARAM_DESC *dim, float p1[], float p2[])
 
void tesseract::Walk (KDTREE *tree, kdwalk_proc action, ClusteringContext *context, KDNODE *sub_tree, int32_t level)
 
void tesseract::InsertNodes (KDTREE *tree, KDNODE *nodes)
 

Macro Definition Documentation

◆ Magnitude

#define Magnitude (   X)    ((X) < 0 ? -(X) : (X))

Definition at line 30 of file kdtree.cpp.

◆ MAXSEARCH

#define MAXSEARCH   FLT_MAX

Definition at line 37 of file kdtree.cpp.

◆ MINSEARCH

#define MINSEARCH   (-FLT_MAX)

Definition at line 36 of file kdtree.cpp.

◆ NodeFound

#define NodeFound (   N,
  K,
 
)    (((N)->Key == (K)) && ((N)->Data == (D)))

Definition at line 31 of file kdtree.cpp.