A C++ class wrapper for the bianary treeNB used in the Nbody force calculation, but also useful for general purpose searches.
More...
|
| TreeSimple (PType *xp, IndexType Npoints, int bucket=5, int dimensions=2, bool median=true) |
|
template<typename T > |
void | PointsWithinCircle (T center[2], float radius, std::list< unsigned long > &neighborkist) |
| Finds the points within a circle around center and puts their index numbers in a list.
|
|
template<typename T > |
void | PointsWithinEllipse (T center[2], float a_max, float a_min, float posangle, std::list< unsigned long > &neighborkist) |
| Finds the points within an ellipse around center and puts their index numbers in a list.
|
|
template<typename T > |
T | NNDistance (T *ray, int Nneighbors) const |
| Finds the nearest N neighbors and puts their index numbers in an array, also returns the distance to the Nth neighbor for calculating smoothing.
|
|
template<typename T > |
void | PointsWithinEllipse (T *ray, float rmax, float rmin, float posangle, std::list< unsigned long > &neighborlist) |
|
template<typename T > |
void | PointsWithinCircle (T *ray, float rmax, std::list< unsigned long > &neighborlist) |
|
|
TreeNBStruct< PType > * | BuildTreeNB (PType *xxp, IndexType Nparticles, IndexType *particles, int Ndimensions, PosType theta) |
|
void | _BuildTreeNB (TreeNBStruct< PType > *tree, IndexType nparticles, IndexType *particles) |
|
template<typename T > |
void | _findleaf (T *ray, TreeSimple::iterator &it) const |
|
template<typename T > |
void | _PointsWithin (T *ray, float *rmax, std::list< unsigned long > &neighborkist) |
|
template<typename T > |
void | _NearestNeighbors (T *ray, int Nneighbors, unsigned long *neighbors, PosType *rneighbors) |
|
BranchNB * | NewBranchNB (IndexType *particles, IndexType nparticles, PosType boundary_p1[], PosType boundary_p2[], PosType center[], int level, unsigned long branchNBnumber) |
|
void | FreeBranchNB (BranchNB *branchNB) |
|
TreeNBStruct< PType > * | NewTreeNB (IndexType *particles, IndexType nparticles, PosType boundary_p1[], PosType boundary_p2[], PosType center[], short Ndimensions) |
|
void | freeTreeNB (TreeNBStruct< PType > *tree) |
|
short | emptyTreeNB (TreeNBStruct< PType > *tree) |
|
void | _freeTreeNB (TreeNBStruct< PType > *tree, short child) |
|
bool | isEmptyNB (TreeNBStruct< PType > *tree) |
|
bool | atTopNB (TreeNBStruct< PType > *tree) |
|
bool | noChildNB (TreeNBStruct< PType > *tree) |
|
bool | offEndNB (TreeNBStruct< PType > *tree) |
|
void | getCurrentNB (TreeNBStruct< PType > *tree, IndexType *particles, IndexType *nparticles) |
|
unsigned long | getNbranchesNB (TreeNBStruct< PType > *tree) |
|
void | moveTopNB (TreeNBStruct< PType > *tree) |
|
void | moveUpNB (TreeNBStruct< PType > *tree) |
|
void | moveToChildNB (TreeNBStruct< PType > *tree, int child) |
|
void | insertChildToCurrentNB (TreeNBStruct< PType > *tree, IndexType *particles, IndexType nparticles, PosType boundary_p1[], PosType boundary_p2[], PosType center[], int child) |
|
void | attachChildToCurrentNB (TreeNBStruct< PType > *tree, BranchNB &data, int child) |
|
bool | TreeNBWalkStep (TreeNBStruct< PType > *tree, bool allowDescent) |
|
bool | atLeaf () |
|
template<typename T > |
bool | inbox (const T *center, PosType *p1, PosType *p2) const |
|
template<typename PType>
class TreeSimple< PType >
A C++ class wrapper for the bianary treeNB used in the Nbody force calculation, but also useful for general purpose searches.
Most of the code in TreeNB.c and TreeDriverNB.c is duplicated here as private methods and a few public ones.
PType must have a dereferencing operator [] that gives the value to be sorterd. THIS CAN ONLY BE IN 2 OR 3 DIMENSIONS.
template<typename PType >
template<typename T >
T TreeSimple< PType >::NNDistance |
( |
T * | ray, |
|
|
int | Nneighbors ) const |
Finds the nearest N neighbors and puts their index numbers in an array, also returns the distance to the Nth neighbor for calculating smoothing.
Nearest neighbor distance.
Finds the distance to the Nth nearest neighbors in whatever dimensions tree is defined in.
walk tree from the top
- Parameters
-
ray | position |
Nneighbors | number of neighbors to be found |