|
| KDTree (const std::vector< Point > &points, const unsigned *dimsToUse, unsigned nDimsToUse) |
|
const std::vector< Point > & | inputPoints () const |
|
unsigned | nPoints () const |
|
unsigned | nNodes () const |
|
unsigned | dim () const |
|
unsigned | pointIndex (const unsigned i) const |
|
unsigned | nCdf (const Numeric *limit, unsigned limitDim) const |
|
unsigned | nInBox (const BoxND< Numeric > &box) const |
|
unsigned | nInBox (const BoxND< Numeric > &box, const std::vector< BoundaryInclusion > &bv) const |
|
template<class Result > |
void | visitInBox (AbsVisitor< Point, Result > &visitor, const BoxND< Numeric > &box) const |
|
template<class Point, typename Numeric = double>
class npstat::KDTree< Point, Numeric >
Basic k-d tree template. See, for example, http://en.wikipedia.org/wiki/K-d_tree for the computational geometry ideas behind this type of space partitioning.
Intended for speeding up the construction of empirical copulas or copula densities. Can also be used for "sliding window" kernel density estimation, local regression, etc.
Class Point must possess operator[] which returns an object or reference to Numeric or some other type which can be automatically converted to Numeric.
template<class Point , typename Numeric = double>
npstat::KDTree< Point, Numeric >::KDTree |
( |
const std::vector< Point > & |
points, |
|
|
const unsigned * |
dimsToUse, |
|
|
unsigned |
nDimsToUse |
|
) |
| |
For efficiency reasons, this class will not make an internal copy of the "points" vector. This vector must not be modified after KDTree construction. Otherwise tree pointers will become invalid.
The arguments "dimsToUse" (and "nDimsToUse" which is the length of the "dimsToUse" array) specify which point dimensions should be used to construct the tree.