Public Member Functions

ANNbd_tree Class Reference

#include <ANN.h>

Inheritance diagram for ANNbd_tree:
Inheritance graph
[legend]
Collaboration diagram for ANNbd_tree:
Collaboration graph
[legend]

List of all members.

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)

Detailed Description

Definition at line 803 of file ANN.h.


Constructor & Destructor Documentation

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

Definition at line 805 of file ANN.h.

                : ANNkd_tree(n, dd, bs) {}              // build base kd-tree
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().

        : ANNkd_tree(n, dd, bs)                         // build skeleton base tree
{
        pts = pa;                                                       // where the points are
        if (n == 0) return;                                     // no points--no sweat

        ANNorthRect bnd_box(dd);                        // bounding box for points
                                                                                // construct bounding rectangle
        annEnclRect(pa, pidx, n, dd, bnd_box);
                                                                                // copy to tree structure
        bnd_box_lo = annCopyPt(dd, bnd_box.lo);
        bnd_box_hi = annCopyPt(dd, bnd_box.hi);

        switch (split) {                                        // build by rule
        case ANN_KD_STD:                                        // standard kd-splitting rule
                root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, kd_split, shrink);
                break;
        case ANN_KD_MIDPT:                                      // midpoint split
                root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, midpt_split, shrink);
                break;
        case ANN_KD_SUGGEST:                            // best (in our opinion)
        case ANN_KD_SL_MIDPT:                           // sliding midpoint split
                root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, sl_midpt_split, shrink);
                break;
        case ANN_KD_FAIR:                                       // fair split
                root = rbd_tree(pa, pidx, n, dd, bs, bnd_box, fair_split, shrink);
                break;
        case ANN_KD_SL_FAIR:                            // sliding fair split
                root = rbd_tree(pa, pidx, n, dd, bs,
                                                bnd_box, sl_fair_split, shrink);
                break;
        default:
                annError("Illegal splitting method", ANNabort);
        }
}
ANNbd_tree::ANNbd_tree ( std::istream &  in )

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines