44 template<
typename T,
typename CloudType>
49 const_cast<Vector&
>(this->
minBound) = cloud.topRows(this->dim).rowwise().minCoeff();
50 const_cast<Vector&
>(this->
maxBound) = cloud.topRows(this->dim).rowwise().maxCoeff();
53 for (
int i = 0; i <
cloud.cols(); ++i)
63 template<
typename T,
typename CloudType>
66 const Vector maxRadii(Vector::Constant(query.cols(), maxRadius));
67 return knn(query, indices, dists2, maxRadii, k, epsilon, optionFlags);
70 template<
typename T,
typename CloudType>
73 checkSizesKnn(query, indices, dists2, k, optionFlags, &maxRadii);
81 for (
int c = 0; c < query.cols(); ++c)
83 const T maxRadius(maxRadii[c]);
84 const T maxRadius2(maxRadius * maxRadius);
85 const Vector&
q(query.block(0,c,dim,1));
87 for (
int i = 0; i < this->cloud.cols(); ++i)
89 const T dist(dist2<T>(this->cloud.block(0,i,dim,1),
q));
90 if ((dist <= maxRadius2) &&
92 (allowSelfMatch || (dist > numeric_limits<T>::epsilon())))
97 heap.
getData(indices.col(c), dists2.col(c));
99 if (collectStatistics)
100 return (
unsigned long)query.cols() * (
unsigned long)this->cloud.cols();