kd_util.cpp File Reference

#include "kd_util.h"
#include <ANN/ANNperf.h>

Go to the source code of this file.

Defines

#define PA(i, d)   (pa[pidx[(i)]][(d)])
#define PASWAP(a, b)   { int tmp = pidx[a]; pidx[a] = pidx[b]; pidx[b] = tmp; }
#define PP(i)   (pa[pidx[(i)]])

Functions

double annAspectRatio (int dim, const ANNorthRect &bnd_box)
void annBnds2Box (const ANNorthRect &bnd_box, int dim, int n_bnds, ANNorthHSArray bnds, ANNorthRect &inner_box)
void annBox2Bnds (const ANNorthRect &inner_box, const ANNorthRect &bnd_box, int dim, int &n_bnds, ANNorthHSArray &bnds)
ANNdist annBoxDistance (const ANNpoint q, const ANNpoint lo, const ANNpoint hi, int dim)
void annBoxSplit (ANNpointArray pa, ANNidxArray pidx, int n, int dim, ANNorthRect &box, int &n_in)
void annEnclCube (ANNpointArray pa, ANNidxArray pidx, int n, int dim, ANNorthRect &bnds)
void annEnclRect (ANNpointArray pa, ANNidxArray pidx, int n, int dim, ANNorthRect &bnds)
int annMaxSpread (ANNpointArray pa, ANNidxArray pidx, int n, int dim)
void annMedianSplit (ANNpointArray pa, ANNidxArray pidx, int n, int d, ANNcoord &cv, int n_lo)
void annMinMax (ANNpointArray pa, ANNidxArray pidx, int n, int d, ANNcoord &min, ANNcoord &max)
void annPlaneSplit (ANNpointArray pa, ANNidxArray pidx, int n, int d, ANNcoord cv, int &br1, int &br2)
int annSplitBalance (ANNpointArray pa, ANNidxArray pidx, int n, int d, ANNcoord cv)
ANNcoord annSpread (ANNpointArray pa, ANNidxArray pidx, int n, int d)

Define Documentation

#define PA ( i,
 )     (pa[pidx[(i)]][(d)])
#define PASWAP ( a,
 )     { int tmp = pidx[a]; pidx[a] = pidx[b]; pidx[b] = tmp; }

Definition at line 228 of file kd_util.cpp.

Referenced by annBoxSplit(), annMedianSplit(), and annPlaneSplit().

#define PP (  )     (pa[pidx[(i)]])

Definition at line 44 of file kd_util.cpp.

Referenced by annBoxSplit().


Function Documentation

double annAspectRatio ( int  dim,
const ANNorthRect bnd_box 
)

Definition at line 52 of file kd_util.cpp.

References ANNorthRect::hi, ANNorthRect::lo, and Mesh2Shape::max_length.

Referenced by ANNkd_leaf::getStats().

void annBnds2Box ( const ANNorthRect bnd_box,
int  dim,
int  n_bnds,
ANNorthHSArray  bnds,
ANNorthRect inner_box 
)
void annBox2Bnds ( const ANNorthRect inner_box,
const ANNorthRect bnd_box,
int  dim,
int &  n_bnds,
ANNorthHSArray bnds 
)
ANNdist annBoxDistance ( const ANNpoint  q,
const ANNpoint  lo,
const ANNpoint  hi,
int  dim 
)
void annBoxSplit ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  dim,
ANNorthRect box,
int &  n_in 
)

Definition at line 332 of file kd_util.cpp.

References ANNorthRect::inside(), RobotExample::l, PASWAP, and PP.

Referenced by rbd_tree().

void annEnclCube ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  dim,
ANNorthRect bnds 
)

Definition at line 92 of file kd_util.cpp.

References annEnclRect(), ANNorthRect::hi, and ANNorthRect::lo.

void annEnclRect ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  dim,
ANNorthRect bnds 
)
int annMaxSpread ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  dim 
)

Definition at line 187 of file kd_util.cpp.

References annSpread(), max_dim, and boost::numeric::bindings::atlas::spr().

Referenced by kd_split().

void annMedianSplit ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  d,
ANNcoord cv,
int  n_lo 
)

Definition at line 230 of file kd_util.cpp.

References k, RobotExample::l, PA, and PASWAP.

Referenced by fair_split(), kd_split(), and sl_fair_split().

void annMinMax ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  d,
ANNcoord min,
ANNcoord max 
)

Definition at line 170 of file kd_util.cpp.

References PA.

Referenced by sl_fair_split(), and sl_midpt_split().

void annPlaneSplit ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  d,
ANNcoord  cv,
int &  br1,
int &  br2 
)

Definition at line 291 of file kd_util.cpp.

References RobotExample::l, PA, and PASWAP.

Referenced by fair_split(), midpt_split(), sl_fair_split(), and sl_midpt_split().

int annSplitBalance ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  d,
ANNcoord  cv 
)

Definition at line 360 of file kd_util.cpp.

References PA.

Referenced by fair_split(), and sl_fair_split().

ANNcoord annSpread ( ANNpointArray  pa,
ANNidxArray  pidx,
int  n,
int  d 
)

Definition at line 154 of file kd_util.cpp.

References KDL::max(), zipios::min(), and PA.

Referenced by annMaxSpread(), fair_split(), midpt_split(), sl_fair_split(), and sl_midpt_split().


Generated on Wed Nov 23 19:01:17 2011 for FreeCAD by  doxygen 1.6.1