Skip to content
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

Modify inrange to accept hyper-rectangle? #62

Open
halleysfifthinc opened this issue Mar 4, 2018 · 3 comments
Open

Modify inrange to accept hyper-rectangle? #62

halleysfifthinc opened this issue Mar 4, 2018 · 3 comments

Comments

@halleysfifthinc
Copy link

As I understand, inrange currently accepts a radius r which is used to determine if points exist within the hypersphere with radius r. I need to find the points existing within the hyperrectangle ϵ, a vector of the lengths of each dimension of the hyperrectangle.

I wanted to get your thoughts (and any pointers on how to go about implementing this) before I wasted any time.

@jaakkor2
Copy link

Curious to know was there a good solution? The issue was closed the same day it was opened.

@halleysfifthinc
Copy link
Author

Honestly, I don't recall what exactly I was working on at the time. I believe I realized I could do what I needed to do without a hyperrectangle inrange.

@jaakkor2
Copy link

This functionality would be useful. Could you @halleysfifthinc re-open the issue, otherwise I have to open a new issue.

I feel embarrassed to write something like this

idx_x = inrange(tree_x, x, dx)
idx_y = inrange(tree_y, y, dy)
#idx = intersect(idx_x, idx_y)
#idx = intersect(Set(idx_x), Set(idx_y))
idx = intersect(BitSet(idx_x), BitSet(idx_y)) # faster that the two above for my use case

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

No branches or pull requests

2 participants