diff --git a/include/geode/geometry/nn_search.hpp b/include/geode/geometry/nn_search.hpp index b785f5980..6f390e1e1 100644 --- a/include/geode/geometry/nn_search.hpp +++ b/include/geode/geometry/nn_search.hpp @@ -23,6 +23,7 @@ #pragma once +#include #include #include @@ -53,6 +54,17 @@ namespace geode return colocated_mapping.size() - nb_unique_points(); } + [[nodiscard]] geode::GenericMapping< geode::index_t > + points_mapping() const + { + geode::GenericMapping< geode::index_t > mapping; + for( const auto& p : geode::Indices{ colocated_mapping } ) + { + mapping.map( p, colocated_mapping[p] ); + } + return mapping; + } + std::vector< Point< dimension > > unique_points; /*! * This list has the size of the number of points in the tree.