Skip to content

Commit 185dbab

Browse files
Merge pull request #1051 from Geode-solutions/feat/mapping_nn_search
feat(NnSearch): add temporary possibility to find mapping in nn_search
2 parents 784f19d + fd41b99 commit 185dbab

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/geode/geometry/nn_search.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#pragma once
2525

26+
#include <geode/basic/mapping.hpp>
2627
#include <geode/basic/pimpl.hpp>
2728

2829
#include <geode/geometry/common.hpp>
@@ -53,6 +54,17 @@ namespace geode
5354
return colocated_mapping.size() - nb_unique_points();
5455
}
5556

57+
[[nodiscard]] geode::GenericMapping< geode::index_t >
58+
points_mapping() const
59+
{
60+
geode::GenericMapping< geode::index_t > mapping;
61+
for( const auto& p : geode::Indices{ colocated_mapping } )
62+
{
63+
mapping.map( p, colocated_mapping[p] );
64+
}
65+
return mapping;
66+
}
67+
5668
std::vector< Point< dimension > > unique_points;
5769
/*!
5870
* This list has the size of the number of points in the tree.

0 commit comments

Comments
 (0)