Skip to content

Commit 28f2c7f

Browse files
committed
bug fix
1 parent fdefcd2 commit 28f2c7f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/geode/geometry/nn_search.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,13 @@ namespace geode
9595
indices.reserve( nb_results );
9696
for( auto&& result : results )
9797
{
98-
Segment< dimension > segment{ point,
99-
this->point( result.first ) };
98+
const auto& neighbor = this->point( result.first );
99+
if( point.inexact_equal( neighbor ) )
100+
{
101+
indices.emplace_back( result.first );
102+
continue;
103+
}
104+
Segment< dimension > segment{ point, neighbor };
100105
if( segment_ellipse_intersection(
101106
segment, Ellipse< dimension >{ point, epsilons_frame } )
102107
.type
@@ -131,8 +136,7 @@ namespace geode
131136
std::vector< index_t > mapping( nb_points, NO_ID );
132137
std::mutex mutex;
133138
async::parallel_for( async::irange( index_t{ 0 }, nb_points ),
134-
[&nn_search, &epsilon, &mapping, &mutex, this](
135-
index_t point_id ) {
139+
[&epsilon, &mapping, &mutex, this]( index_t point_id ) {
136140
if( mapping[point_id] != NO_ID )
137141
{
138142
return;

0 commit comments

Comments
 (0)