31 #ifndef RTABMAP_FLANN_GROUND_TRUTH_H_
32 #define RTABMAP_FLANN_GROUND_TRUTH_H_
41 template <
typename Distance>
43 size_t skip = 0, Distance distance = Distance())
46 typedef typename Distance::ResultType DistanceType;
50 DistanceType* dists =
new DistanceType[
n];
56 for (
size_t i=1;
i<dataset.
rows; ++
i) {
57 DistanceType tmp =
distance(dataset[i], query, dataset.
cols);
63 else if (tmp < dists[dcnt-1]) {
70 while (j>=1 && dists[j]<dists[j-1]) {
77 for (
size_t i=0;
i<
nn; ++
i) {
86 template <
typename Distance>
88 int skip=0, Distance d = Distance())
90 for (
size_t i=0;
i<testset.
rows; ++
i) {
91 find_nearest<Distance>(dataset, testset[i], matches[i],
matches.cols, skip, d);
98 #endif //FLANN_GROUND_TRUTH_H_