-
Notifications
You must be signed in to change notification settings - Fork 469
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
Optimize the implementation of IntervalSet intersection #2300
Conversation
13015517713
commented
May 7, 2024
- Optimize the implementation of IntervalSet intersection
- add some unittest for IntervalSet &(op)
related issue: #2295 |
|
done |
Format problems occurs frequently, let me create an extra issue for that: #2301 |
Use rand() function in unit testing. That check could be ignored, I guees. |
auto it_r = r.intervals.begin(); | ||
|
||
while (it_l != l.intervals.end() && it_r != r.intervals.end()) { | ||
// Find overlap between current intervals |
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.
@PragmaTwice quick question, does our interval prevent from generating qNaN?
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.
We assume that there's no NaN in the input.
.gitignore
Outdated
@@ -46,3 +46,4 @@ testdb | |||
|
|||
build | |||
cmake-build-* | |||
unittest |
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.
Hmm seems not necessary to be added into gitignore?
src/search/interval.h
Outdated
double end = std::min(it_l->second, it_r->second); | ||
|
||
if (start <= end) { | ||
result.intervals.push_back(std::make_pair(start, end)); |
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.
result.intervals.push_back(std::make_pair(start, end)); | |
result.intervals.emplace_back(start, end); |
2.Change rand() to std::rand() and remove the header stdlib.h
Quality Gate failedFailed conditions |