mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
integrating c++17 fixes from #959 (ref:https://github.com/flann-lib/flann/pull/392), fixed pop_t error (b6e37553de)
This commit is contained in:
@@ -477,6 +477,10 @@ struct HammingPopcnt
|
||||
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
|
||||
{
|
||||
ResultType result = 0;
|
||||
|
||||
//for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)
|
||||
typedef unsigned long long pop_t;
|
||||
|
||||
#if __GNUC__
|
||||
#if ANDROID && HAVE_NEON
|
||||
static uint64_t features = android_getCpuFeatures();
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <cstring>
|
||||
#include <stdarg.h>
|
||||
#include <cmath>
|
||||
#include <random>
|
||||
|
||||
#include "rtflann/general.h"
|
||||
#include "rtflann/algorithms/nn_index.h"
|
||||
@@ -677,7 +678,9 @@ protected:
|
||||
/* Construct the randomized trees. */
|
||||
for (int i = 0; i < trees_; i++) {
|
||||
/* Randomize the order of vectors to allow for unbiased sampling. */
|
||||
std::random_shuffle(ind.begin(), ind.end());
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(ind.begin(), ind.end(), g);
|
||||
tree_roots_[i] = divideTree(&ind[0], int(size_) );
|
||||
}
|
||||
delete[] mean_;
|
||||
|
||||
Reference in New Issue
Block a user