Skip to content

Adding a recursive range query method to the KdTree class. #1

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

Closed
wants to merge 1 commit into from
Closed

Adding a recursive range query method to the KdTree class. #1

wants to merge 1 commit into from

Conversation

antoniocavalcante
Copy link

Adding a recursive range query. Two methods were added: searchNodeRangeRecursive and rangeRecursive.
Given a node and a range (eps), the method range recursive executes searchNodeRangeRecursive, that returns all the nodes within an eps distance.

Adding a recursive range query. Two methods were added: searchNodeRangeRecursive and rangeRecursive.
Given a node and a range (eps), the method range recursive executes searchNodeRangeRecursive, that returns all the nodes within an eps distance.
axisDistance = DBScan.getDistance(value.getX(), root.id.getX(), value.getY(), value.getY());
} else if (axis==Y_AXIS) {
axisDistance = DBScan.getDistance(value.getX(), value.getX(), value.getY(), root.id.getY());
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't account for Z_AXIS here.

@phishman3579
Copy link
Owner

@antoniocavalcante I'll merge the pull request when you account for Z_AXIS. But it won't be a direct merge since you changed the package name and reformatted.

}

@SuppressWarnings("unchecked")
public Collection<Integer> rangeRecursive(T value, double eps) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antoniocavalcante You should probably rename to searchRange since the user shouldn't care how (recursive) you are searching. Also, it'd be nice to know the units of eps and if it's <= eps or < eps for the results,

@phishman3579
Copy link
Owner

@antoniocavalcante By the way, thanks for the pull request!

@phishman3579
Copy link
Owner

@antoniocavalcante Also.. DBScan.getDistance() is undefined. You should probably include that in the KDTree; how is it different than euclidean distance?

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.

2 participants