#include <cmath>#include <iostream>#include <climits>#include <cfloat>Go to the source code of this file.
Classes | |
| class | ANNpointSet |
| class | ANNbruteForce |
| class | ANNkd_tree |
| class | ANNbd_tree |
Defines | |
| #define | DLL_API |
| #define | ANNversion "1.0" |
| #define | ANNversionCmt "" |
| #define | ANNcopyright "David M. Mount and Sunil Arya" |
| #define | ANNlatestRev "Mar 1, 2005" |
| #define | ANN_POW(v) ((v)*(v)) |
| #define | ANN_ROOT(x) sqrt(x) |
| #define | ANN_SUM(x, y) ((x) + (y)) |
| #define | ANN_DIFF(x, y) ((y) - (x)) |
Typedefs | |
| typedef float | ANNcoord |
| typedef float | ANNdist |
| typedef int | ANNidx |
| typedef ANNcoord * | ANNpoint |
| typedef ANNpoint * | ANNpointArray |
| typedef ANNdist * | ANNdistArray |
| typedef ANNidx * | ANNidxArray |
| typedef ANNkd_node * | ANNkd_ptr |
Enumerations | |
| enum | ANNbool { ANNfalse = 0, ANNtrue = 1 } |
| enum | ANNsplitRule { ANN_KD_STD = 0, ANN_KD_MIDPT = 1, ANN_KD_FAIR = 2, ANN_KD_SL_MIDPT = 3, ANN_KD_SL_FAIR = 4, ANN_KD_SUGGEST = 5 } |
| enum | ANNshrinkRule { ANN_BD_NONE = 0, ANN_BD_SIMPLE = 1, ANN_BD_CENTROID = 2, ANN_BD_SUGGEST = 3 } |
Functions | |
| ANNdist | annDist (int dim, ANNpoint p, ANNpoint q) |
| ANNpoint | annAllocPt (int dim, ANNcoord c=0) |
| ANNpointArray | annAllocPts (int n, int dim) |
| void | annDeallocPt (ANNpoint &p) |
| void | annDeallocPts (ANNpointArray &pa) |
| ANNpoint | annCopyPt (int dim, ANNpoint source) |
| void | annMaxPtsVisit (int maxPts) |
| void | annClose () |
Variables | |
| const double | ANN_DBL_MAX = DBL_MAX |
| const ANNidx | ANN_NULL_IDX = -1 |
| const ANNdist | ANN_DIST_INF = FLT_MAX |
| const int | ANNcoordPrec = 15 |
| const ANNbool | ANN_ALLOW_SELF_MATCH = ANNtrue |
| const int | ANN_N_SPLIT_RULES = 6 |
| const int | ANN_N_SHRINK_RULES = 4 |
Definition at line 345 of file ANN.h.
Referenced by ANNkd_split::ann_FR_search(), ANNkd_split::ann_pri_search(), and ANNkd_split::ann_search().
| #define ANN_POW | ( | v ) | ((v)*(v)) |
Definition at line 342 of file ANN.h.
Referenced by ANNkd_leaf::ann_FR_search(), ANNkd_split::ann_FR_search(), ANNkd_leaf::ann_pri_search(), ANNkd_split::ann_pri_search(), ANNkd_leaf::ann_search(), ANNkd_split::ann_search(), annBoxDistance(), annDist(), ANNkd_tree::annkFRSearch(), ANNkd_tree::annkPriSearch(), ANNkd_tree::annkSearch(), and ANNorthHalfSpace::dist().
Definition at line 344 of file ANN.h.
Referenced by ANNkd_leaf::ann_FR_search(), ANNkd_split::ann_FR_search(), ANNbd_shrink::ann_FR_search(), ANNkd_leaf::ann_pri_search(), ANNkd_split::ann_pri_search(), ANNbd_shrink::ann_pri_search(), ANNkd_leaf::ann_search(), ANNkd_split::ann_search(), ANNbd_shrink::ann_search(), annBoxDistance(), and annDist().
| typedef ANNdist* ANNdistArray |
| typedef ANNidx* ANNidxArray |
| typedef ANNkd_node* ANNkd_ptr |
| typedef ANNpoint* ANNpointArray |
| enum ANNbool |
| enum ANNshrinkRule |
Definition at line 611 of file ANN.h.
{
ANN_BD_NONE = 0, // no shrinking at all (just kd-tree)
ANN_BD_SIMPLE = 1, // simple splitting
ANN_BD_CENTROID = 2, // centroid splitting
ANN_BD_SUGGEST = 3}; // the authors' suggested choice
| enum ANNsplitRule |
Definition at line 602 of file ANN.h.
{
ANN_KD_STD = 0, // the optimized kd-splitting rule
ANN_KD_MIDPT = 1, // midpoint split
ANN_KD_FAIR = 2, // fair split
ANN_KD_SL_MIDPT = 3, // sliding midpoint splitting method
ANN_KD_SL_FAIR = 4, // sliding fair split method
ANN_KD_SUGGEST = 5}; // the authors' suggestion for best
Definition at line 108 of file ANN.cpp.
Referenced by ANNorthRect::ANNorthRect(), annReadDump(), mitk::PointLocator::InitANN(), and ipMITKSegmentationGetCutPoints().
| ANNpointArray annAllocPts | ( | int | n, |
| int | dim | ||
| ) |
Definition at line 115 of file ANN.cpp.
Referenced by annReadDump(), ipMITKSegmentationGetCutPoints(), and mitk::PointLocator::SetPoints().
{
ANNpointArray pa = new ANNpoint[n]; // allocate points
ANNpoint p = new ANNcoord[n*dim]; // allocate space for coords
for (int i = 0; i < n; i++) {
pa[i] = &(p[i*dim]);
}
return pa;
}
| void annClose | ( | ) |
Definition at line 221 of file kd_tree.cpp.
References KD_TRIVIAL.
{
if (KD_TRIVIAL != NULL) {
delete KD_TRIVIAL;
KD_TRIVIAL = NULL;
}
}
Definition at line 138 of file ANN.cpp.
Referenced by ANNbd_tree::ANNbd_tree(), ANNkd_tree::ANNkd_tree(), and ANNorthRect::ANNorthRect().
| void annDeallocPt | ( | ANNpoint & | p ) |
Definition at line 125 of file ANN.cpp.
Referenced by mitk::PointLocator::DestroyANN(), ipMITKSegmentationGetCutPoints(), ANNkd_tree::~ANNkd_tree(), and ANNorthRect::~ANNorthRect().
{
delete [] p;
p = NULL;
}
| void annDeallocPts | ( | ANNpointArray & | pa ) |
Definition at line 131 of file ANN.cpp.
Referenced by mitk::PointLocator::DestroyANN(), and ipMITKSegmentationGetCutPoints().
{
delete [] pa[0]; // dealloc coordinate storage
delete [] pa; // dealloc points
pa = NULL;
}
Definition at line 44 of file ANN.cpp.
References ANN_COORD, ANN_FLOP, ANN_POW, ANN_PTS, ANN_SUM, and QuadProgPP::dist().
Referenced by ANNbruteForce::annkFRSearch(), and ANNbruteForce::annkSearch().
| void annMaxPtsVisit | ( | int | maxPts ) |
| const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue |
Definition at line 241 of file ANN.h.
Referenced by ANNkd_leaf::ann_FR_search(), ANNkd_leaf::ann_pri_search(), ANNkd_leaf::ann_search(), ANNbruteForce::annkFRSearch(), and ANNbruteForce::annkSearch().
| const double ANN_DBL_MAX = DBL_MAX |
Definition at line 124 of file ANN.h.
Referenced by ANNsampStat::reset().
| const ANNdist ANN_DIST_INF = FLT_MAX |
| const int ANN_N_SHRINK_RULES = 4 |
| const int ANN_N_SPLIT_RULES = 6 |
| const ANNidx ANN_NULL_IDX = -1 |
| const int ANNcoordPrec = 15 |
1.7.2