jlblancoc / nanoflann

nanoflann: a C++11 header-only library for Nearest Neighbor (NN) search with KD-trees
Other
2.22k stars 488 forks source link

KDTreeEigenMatrixAdaptor Build Index Issue after the Update 1.5.0 #233

Closed mauzaomin closed 7 months ago

mauzaomin commented 7 months ago

Hi,

Not sure if it worth taking a look. I'm not able to build a tree per the example in the documentation below after the update 1.5.0. Example below still works if I use version 1.4.3

Error Message from g++ 13.2.0 Capture

Eigen::Matrix<num_t,Dynamic,Dynamic> mat; // Fill out "mat"... typedef KDTreeEigenMatrixAdaptor< Eigen::Matrix<num_t,Dynamic,Dynamic> > my_kd_tree_t; const int max_leaf = 10; my_kd_tree_t mat_index(dimdim, mat, max_leaf ); mat_index.index->buildIndex(); mat_index.index->...

jlblancoc commented 7 months ago

Yes, just use the member named "index_" instead of "index", it was changed long time ago to comply with common naming practices...