Skip to content

Commit 6df98d8

Browse files
committed
fix(NNSearch): add trace log for future debug on CI
1 parent 1d46405 commit 6df98d8

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/geode/geometry/nn_search.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,28 @@ namespace geode
219219
}
220220
const auto vertices = radius_neighbors( point( p ), epsilon );
221221
auto min_index = find_min_unmapped_element( vertices, mapping );
222+
Logger::trace( p, " : Min index ", min_index );
222223
std::lock_guard< std::mutex > lock( mutex );
223224
if( mapping[p] != p )
224225
{
226+
Logger::trace(
227+
p, " : correction 1 / mapping[p]", mapping[p] );
225228
return;
226229
}
227230
if( min_index != mapping[min_index] )
228231
{
232+
Logger::trace( p, " : correction 2 / min_index before",
233+
min_index, " / mapping[min_index]",
234+
mapping[min_index] );
229235
min_index = find_min_unmapped_element( vertices, mapping );
236+
Logger::trace(
237+
p, " : correction 2 / min_index after", min_index );
230238
}
239+
Logger::trace( p, " : Difinitive min index ", min_index );
231240
for( const auto id : vertices )
232241
{
242+
Logger::trace(
243+
p, " : id ", id " / mapping[id]", mapping[id] );
233244
if( id == mapping[id] )
234245
{
235246
mapping[id] = min_index;

tests/geometry/test-nnsearch.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void first_test()
7373

7474
void second_test()
7575
{
76-
geode::Logger::set_level( geode::Logger::LEVEL::debug );
76+
geode::Logger::set_level( geode::Logger::LEVEL::trace );
7777
std::vector< geode::Point2D > points{
7878
geode::Point2D{ { 0, 0.2 } },
7979
geode::Point2D{ { 0.25, 0 } },
@@ -87,6 +87,12 @@ void second_test()
8787

8888
const auto colocated_info = colocator.colocated_index_mapping( DISTANCE );
8989
DEBUG( colocated_info.nb_unique_points() );
90+
for( const auto v : geode::Range{ 6 } )
91+
{
92+
geode::Logger::trace( v, " : ",
93+
colocated_info.colocated_input_points[v], " / ",
94+
colocated_info.colocated_mapping[v] );
95+
}
9096
for( const auto p : geode::Indices{ points } )
9197
{
9298
OPENGEODE_EXCEPTION( colocated_info.colocated_mapping[p]

0 commit comments

Comments
 (0)