-
Notifications
You must be signed in to change notification settings - Fork 1
Kdtree #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: executor-integration
Are you sure you want to change the base?
Kdtree #5
Conversation
{ | ||
using Self = KdTreeFLANN<PointT, KdTreeFLANN<PointT>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self is a bad name for parent class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah didn't notice I was referencing to base class. WIll update it to 'Base
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial (0/3)
|
||
namespace pcl | ||
{ | ||
/** \brief KdTree represents the base spatial locator class for kd-tree implementations. | ||
* \author Radu B Rusu, Bastian Steder, Michael Dixon | ||
* \ingroup kdtree | ||
*/ | ||
template <typename PointT> | ||
template <typename PointT, typename Derived> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not supplying a default argument can break user's code.
return (exec, nearestKSearch (input_->points[index], k, k_indices, k_sqr_distances)); | ||
} | ||
assert (index >= 0 && index < static_cast<int> (indices_->size ()) && "Out-of-bounds error in nearestKSearch!"); | ||
return (nearestKSearch (input_->points[(*indices_)[index]], k, k_indices, k_sqr_distances)); | ||
return (exec, nearestKSearch (input_->points[(*indices_)[index]], k, k_indices, k_sqr_distances)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you trying to return Python tuples? :o
std::vector<int> &k_indices, std::vector<float> &k_sqr_distances) const | ||
{ | ||
PointT p; | ||
copyPoint (point, p); | ||
return (nearestKSearch (p, k, k_indices, k_sqr_distances)); | ||
return (nearestKSearch (exec, p, k, k_indices, k_sqr_distances)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove parens after return
int | ||
nearestKSearch (const Executor &exec, const PointT &p_q, int k, | ||
std::vector<int> &k_indices, std::vector<float> &k_sqr_distances) const { | ||
return static_cast<Derived&>(*this).nearestKSearch(exec, p_q, k, k_indices, k_sqr_distances); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is potentially confusing IMO. You're hiding the function in the derived class without overloading. Some note somewhere detailing what's happening and more importantly why it's happening the way it is
1f11251
to
caabb6f
Compare
6d88bfe
to
7c3b82c
Compare
TODO: