diff --git a/python/setup.py b/python/setup.py index 9905a97..aaa820e 100755 --- a/python/setup.py +++ b/python/setup.py @@ -8,6 +8,7 @@ aabb_module = Extension('_aabb', sources = ['aabb_wrap.cxx', '../src/AABB.cc'], + extra_compile_args = ["-O3", "-std=c++11"], ) setup (name = 'aabb', diff --git a/src/AABB.cc b/src/AABB.cc index 75ba2fe..612746b 100644 --- a/src/AABB.cc +++ b/src/AABB.cc @@ -379,7 +379,7 @@ namespace aabb insertLeaf(node); // Add the new particle to the map. - particleMap.insert(std::map::value_type(particle, node)); + particleMap.insert(std::unordered_map::value_type(particle, node)); // Store the particle index. nodes[node].particle = particle; @@ -435,7 +435,7 @@ namespace aabb insertLeaf(node); // Add the new particle to the map. - particleMap.insert(std::map::value_type(particle, node)); + particleMap.insert(std::unordered_map::value_type(particle, node)); // Store the particle index. nodes[node].particle = particle; @@ -449,7 +449,7 @@ namespace aabb void Tree::removeParticle(unsigned int particle) { // Map iterator. - std::map::iterator it; + std::unordered_map::iterator it; // Find the particle. it = particleMap.find(particle); @@ -476,7 +476,7 @@ namespace aabb void Tree::removeAll() { // Iterator pointing to the start of the particle map. - std::map::iterator it = particleMap.begin(); + std::unordered_map::iterator it = particleMap.begin(); // Iterate over the map. while (it != particleMap.end()) @@ -531,7 +531,7 @@ namespace aabb } // Map iterator. - std::map::iterator it; + std::unordered_map::iterator it; // Find the particle. it = particleMap.find(particle); diff --git a/src/AABB.h b/src/AABB.h index 9c9f4ce..3c3b8b9 100644 --- a/src/AABB.h +++ b/src/AABB.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include /// Null node flag. @@ -416,7 +416,7 @@ namespace aabb std::vector posMinImage; /// A map between particle and node indices. - std::map particleMap; + std::unordered_map particleMap; /// Does touching count as overlapping in tree queries? bool touchIsOverlap;