Skip to content

Commit

Permalink
Merge pull request #1051 from Geode-solutions/feat/mapping_nn_search
Browse files Browse the repository at this point in the history
feat(NnSearch): add temporary possibility to find mapping in nn_search
  • Loading branch information
MelchiorSchuh authored Nov 28, 2024
2 parents 784f19d + fd41b99 commit 185dbab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/geode/geometry/nn_search.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#pragma once

#include <geode/basic/mapping.hpp>
#include <geode/basic/pimpl.hpp>

#include <geode/geometry/common.hpp>
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 185dbab

Please sign in to comment.