queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ANN.h File Reference

Go to the source code of this file.

Classes

class  ANNpointSet
 
class  ANNbruteForce
 
class  ANNkd_tree
 
class  ANNbd_tree
 

Typedefs

typedef double ANNcoord
 
typedef double ANNdist
 
typedef int ANNidx
 
typedef ANNcoordANNpoint
 
typedef ANNpointANNpointArray
 
typedef ANNdistANNdistArray
 
typedef ANNidxANNidxArray
 
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

DLL_API ANNdist annDist (int dim, ANNpoint p, ANNpoint q)
 
DLL_API ANNpoint annAllocPt (int dim, ANNcoord c=0)
 
DLL_API ANNpointArray annAllocPts (int n, int dim)
 
DLL_API void annDeallocPt (ANNpoint &p)
 
DLL_API void annDeallocPts (ANNpointArray &pa)
 
DLL_API ANNpoint annCopyPt (int dim, ANNpoint source)
 
DLL_API void annMaxPtsVisit (int maxPts)
 
DLL_API void annClose ()
 

Variables

const double ANN_DBL_MAX = MAXDOUBLE
 
const ANNidx ANN_NULL_IDX = -1
 
const ANNdist ANN_DIST_INF = ANN_DBL_MAX
 
const int ANNcoordPrec = DBL_DIG
 
const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue
 
const int ANN_N_SPLIT_RULES = 6
 
const int ANN_N_SHRINK_RULES = 4
 

Typedef Documentation

typedef double ANNcoord

Definition at line 158 of file ANN.h.

typedef double ANNdist

Definition at line 159 of file ANN.h.

Definition at line 377 of file ANN.h.

typedef int ANNidx

Definition at line 175 of file ANN.h.

typedef ANNidx* ANNidxArray

Definition at line 378 of file ANN.h.

typedef ANNkd_node* ANNkd_ptr

Definition at line 702 of file ANN.h.

typedef ANNcoord* ANNpoint

Definition at line 375 of file ANN.h.

Definition at line 376 of file ANN.h.

Enumeration Type Documentation

enum ANNbool
Enumerator
ANNfalse 
ANNtrue 

Definition at line 132 of file ANN.h.

132 {ANNfalse = 0, ANNtrue = 1}; // ANN boolean type (non ANSI C++)
Definition: ANN.h:132
Definition: ANN.h:132
Enumerator
ANN_BD_NONE 
ANN_BD_SIMPLE 
ANN_BD_CENTROID 
ANN_BD_SUGGEST 

Definition at line 605 of file ANN.h.

605  {
606  ANN_BD_NONE = 0, // no shrinking at all (just kd-tree)
607  ANN_BD_SIMPLE = 1, // simple splitting
608  ANN_BD_CENTROID = 2, // centroid splitting
609  ANN_BD_SUGGEST = 3}; // the authors' suggested choice
Enumerator
ANN_KD_STD 
ANN_KD_MIDPT 
ANN_KD_FAIR 
ANN_KD_SL_MIDPT 
ANN_KD_SL_FAIR 
ANN_KD_SUGGEST 

Definition at line 596 of file ANN.h.

596  {
597  ANN_KD_STD = 0, // the optimized kd-splitting rule
598  ANN_KD_MIDPT = 1, // midpoint split
599  ANN_KD_FAIR = 2, // fair split
600  ANN_KD_SL_MIDPT = 3, // sliding midpoint splitting method
601  ANN_KD_SL_FAIR = 4, // sliding fair split method
602  ANN_KD_SUGGEST = 5}; // the authors' suggestion for best

Function Documentation

DLL_API ANNpoint annAllocPt ( int  dim,
ANNcoord  c = 0 
)

Definition at line 110 of file ANN.cpp.

References dim.

Referenced by ANNorthRect::ANNorthRect(), annReadDump(), and QUESO::normalizeANN_XY().

111 {
112  ANNpoint p = new ANNcoord[dim];
113  for (int i = 0; i < dim; i++) p[i] = c;
114  return p;
115 }
double ANNcoord
Definition: ANN.h:158
ANNcoord * ANNpoint
Definition: ANN.h:375
int dim
Definition: ann_test.cpp:472
DLL_API ANNpointArray annAllocPts ( int  n,
int  dim 
)

Definition at line 117 of file ANN.cpp.

References dim.

Referenced by annClusEllipsoids(), annClusGaussPts(), annClusOrthFlats(), annReadDump(), QUESO::computeMI_ANN(), QUESO::estimateCE_ANN(), QUESO::BaseVectorRV< V, M >::estimateENT_ANN(), QUESO::estimateKL_ANN(), QUESO::estimateMI_ANN(), generatePts(), and readPts().

118 {
119  ANNpointArray pa = new ANNpoint[n]; // allocate points
120  ANNpoint p = new ANNcoord[n*dim]; // allocate space for coords
121  for (int i = 0; i < n; i++) {
122  pa[i] = &(p[i*dim]);
123  }
124  return pa;
125 }
ANNpoint * ANNpointArray
Definition: ANN.h:376
double ANNcoord
Definition: ANN.h:158
ANNcoord * ANNpoint
Definition: ANN.h:375
int dim
Definition: ann_test.cpp:472
DLL_API void annClose ( )

Definition at line 221 of file kd_tree.cpp.

References KD_TRIVIAL.

Referenced by QUESO::distANN_XY(), and main().

222 {
223  if (KD_TRIVIAL != NULL) {
224  delete KD_TRIVIAL;
225  KD_TRIVIAL = NULL;
226  }
227 }
ANNkd_leaf * KD_TRIVIAL
Definition: kd_tree.cpp:50
DLL_API ANNpoint annCopyPt ( int  dim,
ANNpoint  source 
)

Definition at line 140 of file ANN.cpp.

References dim.

Referenced by ANNbd_tree::ANNbd_tree(), ANNkd_tree::ANNkd_tree(), and ANNorthRect::ANNorthRect().

141 {
142  ANNpoint p = new ANNcoord[dim];
143  for (int i = 0; i < dim; i++) p[i] = source[i];
144  return p;
145 }
double ANNcoord
Definition: ANN.h:158
ANNcoord * ANNpoint
Definition: ANN.h:375
int dim
Definition: ann_test.cpp:472
DLL_API void annDeallocPt ( ANNpoint p)

Definition at line 127 of file ANN.cpp.

Referenced by ANNkd_tree::~ANNkd_tree(), and ANNorthRect::~ANNorthRect().

128 {
129  delete [] p;
130  p = NULL;
131 }
DLL_API void annDeallocPts ( ANNpointArray pa)

Definition at line 133 of file ANN.cpp.

Referenced by annClusEllipsoids(), annClusGaussPts(), annClusOrthFlats(), QUESO::computeMI_ANN(), QUESO::estimateCE_ANN(), QUESO::BaseVectorRV< V, M >::estimateENT_ANN(), QUESO::estimateKL_ANN(), QUESO::estimateMI_ANN(), generatePts(), main(), and readPts().

134 {
135  delete [] pa[0]; // dealloc coordinate storage
136  delete [] pa; // dealloc points
137  pa = NULL;
138 }
DLL_API ANNdist annDist ( int  dim,
ANNpoint  p,
ANNpoint  q 
)

Definition at line 46 of file ANN.cpp.

References dim.

Referenced by ANNbruteForce::annkFRSearch(), and ANNbruteForce::annkSearch().

50 {
51  register int d;
52  register ANNcoord diff;
53  register ANNcoord dist;
54 
55  dist = 0;
56  for (d = 0; d < dim; d++) {
57  diff = p[d] - q[d];
58  dist = ANN_SUM(dist, ANN_POW(diff));
59  }
60  ANN_FLOP(3*dim) // performance counts
61  ANN_PTS(1)
62  ANN_COORD(dim)
63  return dist;
64 }
double ANNcoord
Definition: ANN.h:158
int dim
Definition: ann_test.cpp:472
DLL_API void annMaxPtsVisit ( int  maxPts)

Definition at line 197 of file ANN.cpp.

References ANNmaxPtsVisited.

Referenced by main().

199 {
200  ANNmaxPtsVisited = maxPts;
201 }
int ANNmaxPtsVisited
Definition: ANN.cpp:190

Variable Documentation

const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue

Definition at line 235 of file ANN.h.

Referenced by ANNbruteForce::annkFRSearch(), and ANNbruteForce::annkSearch().

const double ANN_DBL_MAX = MAXDOUBLE

Definition at line 114 of file ANN.h.

Referenced by doValidation(), and ANNsampStat::reset().

const ANNdist ANN_DIST_INF = ANN_DBL_MAX

Definition at line 199 of file ANN.h.

const int ANN_N_SHRINK_RULES = 4

Definition at line 610 of file ANN.h.

const int ANN_N_SPLIT_RULES = 6

Definition at line 603 of file ANN.h.

const ANNidx ANN_NULL_IDX = -1

Definition at line 176 of file ANN.h.

Referenced by doValidation(), and main().

const int ANNcoordPrec = DBL_DIG

Definition at line 220 of file ANN.h.

Referenced by ANNkd_tree::Dump().


Generated on Tue Jun 5 2018 19:48:56 for queso-0.57.1 by  doxygen 1.8.5