73 for (
int i = 0; i < level; i++)
77 out <<
" hbnd=" << cd_bnds[
ANN_HI];
88 for (
int i = 0; i < level; i++)
91 if (
this == KD_TRIVIAL) {
92 out <<
"Leaf (trivial)\n";
95 out <<
"Leaf n=" <<
n_pts <<
" <";
96 for (
int j = 0; j <
n_pts; j++) {
98 if (j < n_pts-1) out <<
",";
111 for (
int i = 0; i <
n_pts; i++) {
112 out <<
"\t" << i <<
": ";
118 out <<
" Null tree.\n";
131 #define MAX(a,b) ((a) > (b) ? (a) : (b))
154 if (
this == KD_TRIVIAL) st.
n_tl = 1;
223 if (KD_TRIVIAL != NULL) {
260 for (
int i = 0; i < n; i++) {
269 if (KD_TRIVIAL == NULL)
336 (*splitter)(pa, pidx, bnd_box, n,
dim, cd, cv, n_lo);
344 dim, bsp, bnd_box, splitter);
349 pa, pidx + n_lo, n-n_lo,
350 dim, bsp, bnd_box, splitter);
void SkeletonTree(int n, int dd, int bs, ANNpointArray pa=NULL, ANNidxArray pi=NULL)
DLL_API void annDeallocPt(ANNpoint &p)
void(* ANNkd_splitter)(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
virtual void Print(ANNbool with_pts, std::ostream &out)
virtual void getStats(ANNkdStats &st)
ANNkd_ptr rkd_tree(ANNpointArray pa, ANNidxArray pidx, int n, int dim, int bsp, ANNorthRect &bnd_box, ANNkd_splitter splitter)
void sl_fair_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
virtual void getStats(int dim, ANNkdStats &st, ANNorthRect &bnd_box)
ANNkd_tree(int n=0, int dd=0, int bs=1)
const double ANN_AR_TOOBIG
virtual void print(int level, ostream &out)
void annError(const char *msg, ANNerr level)
void sl_midpt_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
void reset(int d=0, int n=0, int bs=0)
double annAspectRatio(int dim, const ANNorthRect &bnd_box)
DLL_API ANNpoint annCopyPt(int dim, ANNpoint source)
virtual void print(int level, ostream &out)=0
void annEnclRect(ANNpointArray pa, ANNidxArray pidx, int n, int dim, ANNorthRect &bnds)
void merge(const ANNkdStats &st)
void midpt_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
virtual void getStats(int dim, ANNkdStats &st, ANNorthRect &bnd_box)
void kd_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)
virtual void print(int level, ostream &out)
virtual void getStats(int dim, ANNkdStats &st, ANNorthRect &bnd_box)=0
void annPrintPt(ANNpoint pt, int dim, std::ostream &out)
void fair_split(ANNpointArray pa, ANNidxArray pidx, const ANNorthRect &bnds, int n, int dim, int &cut_dim, ANNcoord &cut_val, int &n_lo)