Public Member Functions | |
HyperRect (int dim, const double *min, const double *max) | |
~HyperRect () | |
HyperRect (const HyperRect &rect) | |
void | Extend (const double *pos) |
bool | CompareDistSqr (const double *pos, const double *bestmatch) |
int | GetDim () |
double * | GetMin () |
double * | GetMax () |
Protected Attributes | |
int | fDim |
double * | fMin |
double * | fMax |
Definition at line 82 of file G4KDTree.cc.
HyperRect::HyperRect | ( | int | dim, | |
const double * | min, | |||
const double * | max | |||
) | [inline] |
HyperRect::~HyperRect | ( | ) | [inline] |
HyperRect::HyperRect | ( | const HyperRect & | rect | ) | [inline] |
bool HyperRect::CompareDistSqr | ( | const double * | pos, | |
const double * | bestmatch | |||
) | [inline] |
Definition at line 129 of file G4KDTree.cc.
References fDim, fMax, fMin, and sqr().
Referenced by G4KDTree::__NearestToNode(), and G4KDTree::__NearestToPosition().
00130 { 00131 double result = 0; 00132 00133 for (int i=0; i < fDim; i++) 00134 { 00135 if (pos[i] < fMin[i]) 00136 { 00137 result += sqr(fMin[i] - pos[i]); 00138 } 00139 else if (pos[i] > fMax[i]) 00140 { 00141 result += sqr(fMax[i] - pos[i]); 00142 } 00143 00144 if(result >= *bestmatch) return false ; 00145 } 00146 00147 return true ; 00148 }
void HyperRect::Extend | ( | const double * | pos | ) | [inline] |
Definition at line 112 of file G4KDTree.cc.
References fDim, fMax, and fMin.
Referenced by G4KDTree::Insert().
00113 { 00114 int i; 00115 00116 for (i=0; i < fDim; i++) 00117 { 00118 if (pos[i] < fMin[i]) 00119 { 00120 fMin[i] = pos[i]; 00121 } 00122 if (pos[i] > fMax[i]) 00123 { 00124 fMax[i] = pos[i]; 00125 } 00126 } 00127 }
int HyperRect::GetDim | ( | ) | [inline] |
double* HyperRect::GetMax | ( | ) | [inline] |
Definition at line 152 of file G4KDTree.cc.
References fMax.
Referenced by G4KDTree::__NearestToNode(), and G4KDTree::__NearestToPosition().
00152 {return fMax;}
double* HyperRect::GetMin | ( | ) | [inline] |
Definition at line 151 of file G4KDTree.cc.
References fMin.
Referenced by G4KDTree::__NearestToNode(), and G4KDTree::__NearestToPosition().
00151 {return fMin;}
int HyperRect::fDim [protected] |
Definition at line 155 of file G4KDTree.cc.
Referenced by CompareDistSqr(), Extend(), G4KDTree::GetDim(), GetDim(), and HyperRect().
double * HyperRect::fMax [protected] |
Definition at line 156 of file G4KDTree.cc.
Referenced by CompareDistSqr(), Extend(), GetMax(), HyperRect(), and ~HyperRect().
double* HyperRect::fMin [protected] |
Definition at line 156 of file G4KDTree.cc.
Referenced by CompareDistSqr(), Extend(), GetMin(), HyperRect(), and ~HyperRect().