Skip to content

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

Open
wants to merge 4 commits into
base: executor-integration
Choose a base branch
from
Open

Kdtree #5

wants to merge 4 commits into from

Conversation

shrijitsingh99
Copy link
Owner

TODO:

  1. Add docstrings
  2. Discuss with GSoC GPU team regarding the possibility of CUDA implementation

@shrijitsingh99 shrijitsingh99 changed the base branch from master to executor-integration July 13, 2020 02:18
{
using Self = KdTreeFLANN<PointT, KdTreeFLANN<PointT>>;
Copy link
Collaborator

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

Copy link
Owner Author

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.

Copy link
Collaborator

@SergioRAgostinho SergioRAgostinho left a 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>
Copy link
Collaborator

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.

Comment on lines +237 to +240
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));
Copy link
Collaborator

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));
Copy link
Collaborator

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);
Copy link
Collaborator

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

@shrijitsingh99 shrijitsingh99 force-pushed the executor-integration branch 2 times, most recently from 1f11251 to caabb6f Compare August 12, 2020 11:55
@shrijitsingh99 shrijitsingh99 force-pushed the executor-integration branch 7 times, most recently from 6d88bfe to 7c3b82c Compare August 30, 2020 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants