queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ANNbd_tree Class Reference

#include <ANN.h>

Inheritance diagram for ANNbd_tree:
ANNkd_tree ANNpointSet

Public Member Functions

 ANNbd_tree (int n, int dd, int bs=1)
 
 ANNbd_tree (ANNpointArray pa, int n, int dd, int bs=1, ANNsplitRule split=ANN_KD_SUGGEST, ANNshrinkRule shrink=ANN_BD_SUGGEST)
 
 ANNbd_tree (std::istream &in)
 
- Public Member Functions inherited from ANNkd_tree
 ANNkd_tree (int n=0, int dd=0, int bs=1)
 
 ANNkd_tree (ANNpointArray pa, int n, int dd, int bs=1, ANNsplitRule split=ANN_KD_SUGGEST)
 
 ANNkd_tree (std::istream &in)
 
 ~ANNkd_tree ()
 
void annkSearch (ANNpoint q, int k, ANNidxArray nn_idx, ANNdistArray dd, double eps=0.0)
 
void annkPriSearch (ANNpoint q, int k, ANNidxArray nn_idx, ANNdistArray dd, double eps=0.0)
 
int annkFRSearch (ANNpoint q, ANNdist sqRad, int k, ANNidxArray nn_idx=NULL, ANNdistArray dd=NULL, double eps=0.0)
 
int theDim ()
 
int nPoints ()
 
ANNpointArray thePoints ()
 
virtual void Print (ANNbool with_pts, std::ostream &out)
 
virtual void Dump (ANNbool with_pts, std::ostream &out)
 
virtual void getStats (ANNkdStats &st)
 
- Public Member Functions inherited from ANNpointSet
virtual ~ANNpointSet ()
 

Additional Inherited Members

- Protected Member Functions inherited from ANNkd_tree
void SkeletonTree (int n, int dd, int bs, ANNpointArray pa=NULL, ANNidxArray pi=NULL)
 
- Protected Attributes inherited from ANNkd_tree
int dim
 
int n_pts
 
int bkt_size
 
ANNpointArray pts
 
ANNidxArray pidx
 
ANNkd_ptr root
 
ANNpoint bnd_box_lo
 
ANNpoint bnd_box_hi
 

Detailed Description

Definition at line 797 of file ANN.h.

Constructor & Destructor Documentation

ANNbd_tree::ANNbd_tree ( int  n,
int  dd,
int  bs = 1 
)
inline

Definition at line 799 of file ANN.h.

803  : ANNkd_tree(n, dd, bs) {} // build base kd-tree
ANNkd_tree(int n=0, int dd=0, int bs=1)
Definition: kd_tree.cpp:273
ANNbd_tree::ANNbd_tree ( ANNpointArray  pa,
int  n,
int  dd,
int  bs = 1,
ANNsplitRule  split = ANN_KD_SUGGEST,
ANNshrinkRule  shrink = ANN_BD_SUGGEST 
)

Definition at line 116 of file bd_tree.cpp.

References ANN_KD_FAIR, ANN_KD_MIDPT, ANN_KD_SL_FAIR, ANN_KD_SL_MIDPT, ANN_KD_STD, ANN_KD_SUGGEST, ANNabort, annCopyPt(), annEnclRect(), annError(), ANNkd_tree::bnd_box_hi, ANNkd_tree::bnd_box_lo, fair_split(), ANNorthRect::hi, kd_split(), ANNorthRect::lo, midpt_split(), ANNkd_tree::pidx, ANNkd_tree::pts, rbd_tree(), ANNkd_tree::root, sl_fair_split(), and sl_midpt_split().

123  : ANNkd_tree(n, dd, bs) // build skeleton base tree
124 {
125  pts = pa; // where the points are
126  if (n == 0) return; // no points--no sweat
127 
128  ANNorthRect bnd_box(dd); // bounding box for points
129  // construct bounding rectangle
130  annEnclRect(pa, pidx, n, dd, bnd_box);
131  // copy to tree structure
132  bnd_box_lo = annCopyPt(dd, bnd_box.lo);
133  bnd_box_hi = annCopyPt(dd, bnd_box.hi);
134 
135  switch (split) { // build by rule
136  case ANN_KD_STD: // standard kd-splitting rule
137  root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, kd_split, shrink);
138  break;
139  case ANN_KD_MIDPT: // midpoint split
140  root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, midpt_split, shrink);
141  break;
142  case ANN_KD_SUGGEST: // best (in our opinion)
143  case ANN_KD_SL_MIDPT: // sliding midpoint split
144  root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, sl_midpt_split, shrink);
145  break;
146  case ANN_KD_FAIR: // fair split
147  root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, fair_split, shrink);
148  break;
149  case ANN_KD_SL_FAIR: // sliding fair split
150  root = rbd_tree(pa, pidx, n, dd, bs,
151  bnd_box, sl_fair_split, shrink);
152  break;
153  default:
154  annError("Illegal splitting method", ANNabort);
155  }
156 }
ANNidxArray pidx
Definition: ANN.h:711
void annEnclRect(ANNpointArray pa, ANNidxArray pidx, int n, int dim, ANNorthRect &bnds)
Definition: kd_util.cpp:73
void sl_midpt_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
Definition: kd_split.cpp:146
void sl_fair_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
Definition: kd_split.cpp:346
void kd_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
Definition: kd_split.cpp:44
ANNkd_tree(int n=0, int dd=0, int bs=1)
Definition: kd_tree.cpp:273
ANNkd_ptr rbd_tree(ANNpointArray pa, ANNidxArray pidx, int n, int dim, int bsp, ANNorthRect &bnd_box, ANNkd_splitter splitter, ANNshrinkRule shrink)
Definition: bd_tree.cpp:335
ANNpoint bnd_box_lo
Definition: ANN.h:713
ANNkd_ptr root
Definition: ANN.h:712
Definition: ANNx.h:48
ANNpoint bnd_box_hi
Definition: ANN.h:714
void fair_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
Definition: kd_split.cpp:243
ANNsplitRule split
Definition: ann_test.cpp:491
ANNshrinkRule shrink
Definition: ann_test.cpp:492
DLL_API ANNpoint annCopyPt(int dim, ANNpoint source)
Definition: ANN.cpp:140
void annError(const char *msg, ANNerr level)
Definition: ANN.cpp:169
void midpt_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
Definition: kd_split.cpp:76
ANNpointArray pts
Definition: ANN.h:710
ANNbd_tree::ANNbd_tree ( std::istream &  in)

The documentation for this class was generated from the following files:

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