Auxiliary class for determination of smallest distance between pair of 3D points.
More...
#include <JGeometry3DToolkit.hh>
|
template<class T > |
static double | getDmin (T __begin, T __end) |
| Recursive method to find the smallest distance. More...
|
|
Auxiliary class for determination of smallest distance between pair of 3D points.
Definition at line 131 of file JGeometry3DToolkit.hh.
◆ JSmallestDistance3D()
JGEOMETRY3D::JSmallestDistance3D::JSmallestDistance3D |
( |
| ) |
|
|
inline |
◆ getDmin()
template<class T >
static double JGEOMETRY3D::JSmallestDistance3D::getDmin |
( |
T |
__begin, |
|
|
T |
__end |
|
) |
| |
|
inlinestaticprotected |
Recursive method to find the smallest distance.
- Parameters
-
__begin | begin of data |
__end | end of data |
- Returns
- minimal distance
Definition at line 141 of file JGeometry3DToolkit.hh.
145 const int N =
distance(__begin, __end);
149 double Dmin = numeric_limits<double>::max();
151 for (T i = __begin; i != __end; ++i) {
152 for (T
j = i; ++
j != __end; ) {
170 const double dl =
getDmin(__begin, i);
171 const double dr =
getDmin(i, __end);
173 const double Dmin = min(dl, dr);
178 while (--il != __begin && i ->getZ() - il->getZ() < Dmin) {}
179 while (++ir != __end && ir->getZ() - i ->getZ() < Dmin) {}
185 return min(Dmin, dz);
◆ operator()()
template<class T >
double JGEOMETRY3D::JSmallestDistance3D::operator() |
( |
T |
__begin, |
|
|
T |
__end |
|
) |
| const |
|
inline |
Get smallest distance between two points.
Note that this method changes the order of the elements.
- Parameters
-
__begin | begin of data |
__end | end of data |
- Returns
- minimal distance
Definition at line 229 of file JGeometry3DToolkit.hh.
235 return getDmin(__begin, __end);
◆ compareZ
const JCompareZ JGEOMETRY3D::JSmallestDistance3D::compareZ |
|
static |
The documentation for this class was generated from the following file:
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.