-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add Comprehensive Test for Multigeometry Range Classes #1197
Changes from 20 commits
b4a2421
a924ed7
ebfa699
0733e33
4f1a330
6c24e2b
08ebf2d
613ed2b
e271ff3
9f79718
75c5872
804032d
882b67a
5e326c9
b00606c
e72ec4b
9c655e8
75a8657
293e4c3
95cc443
7dfc481
4c63081
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -74,13 +74,15 @@ CUSPATIAL_HOST_DEVICE auto multilinestring_ref<PartIterator, VecIterator>::part_ | |||||
template <typename PartIterator, typename VecIterator> | ||||||
CUSPATIAL_HOST_DEVICE auto multilinestring_ref<PartIterator, VecIterator>::point_begin() const | ||||||
{ | ||||||
return _point_begin; | ||||||
return thrust::next(_point_begin, *_part_begin); | ||||||
} | ||||||
|
||||||
template <typename PartIterator, typename VecIterator> | ||||||
CUSPATIAL_HOST_DEVICE auto multilinestring_ref<PartIterator, VecIterator>::point_end() const | ||||||
{ | ||||||
return _point_end; | ||||||
// _part_end is the one-past the last part index to the point of this multilinestring. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I don't quite understand this. A part index indexes points? Is it one past the last point of the part? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See how multilinestring_ref is constructed:
|
||||||
// So prior to computing the end point index, we need to decrement _part_end. | ||||||
return thrust::next(_point_begin, *thrust::prev(_part_end)); | ||||||
} | ||||||
|
||||||
template <typename PartIterator, typename VecIterator> | ||||||
|
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.
Can you explain these changes? Why can't point_begin be used as stored?
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.
tl;dr. Because
point_begin
API is supposed to return only the point range to the current multilinestring (not all multilinestrings). And that the offsets stored in a*_ref
are global offsets to the lower level range.Consider this example:
A
multilinestring_ref
constructed for the second multilinestring is stored as below:Notice that in part offset, the offsets are global offsets (4 means that the first point to the multilinestring locates at _point_begin + 4). You may ask why we don't store as below:
That's an alternative too. Just different ways to skin a cat. I don't see an advantage to either one.