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 130 of file JGeometry3DToolkit.hh.
JGEOMETRY3D::JSmallestDistance3D::JSmallestDistance3D |
( |
| ) |
|
|
inline |
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 140 of file JGeometry3DToolkit.hh.
144 const int N = distance(__begin, __end);
148 double Dmin = numeric_limits<double>::max();
150 for (T i = __begin; i != __end; ++i) {
151 for (T j = i; ++j != __end; ) {
169 const double dl =
getDmin(__begin, i);
170 const double dr =
getDmin(i, __end);
172 const double Dmin = min(dl, dr);
177 while (--il != __begin && i ->getZ() - il->getZ() < Dmin) {}
178 while (++ir != __end && ir->getZ() - i ->getZ() < Dmin) {}
184 return min(Dmin, dz);
static const JSmallestDistance2D getSmallestDistance2D
Function object for smallest distance determination.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
static double getDmin(T __begin, T __end)
Recursive method to find the smallest distance.
static const JCompareZ compareZ
Function object for sorting elements.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
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 228 of file JGeometry3DToolkit.hh.
234 return getDmin(__begin, __end);
static double getDmin(T __begin, T __end)
Recursive method to find the smallest distance.
static const JCompareZ compareZ
Function object for sorting elements.
const JCompareZ JGEOMETRY3D::JSmallestDistance3D::compareZ |
|
static |
The documentation for this class was generated from the following file: