Skip to content

Commit

Permalink
feat(NnSearch): add temporary possibility to find mapping in nn_search
Browse files Browse the repository at this point in the history
  • Loading branch information
BenPinet committed Nov 28, 2024
1 parent 784f19d commit fd41b99
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 fd41b99

Please sign in to comment.