NiHu
2.0
|
Merge two intervals. More...
#include <interval.hpp>
Classes | |
struct | compare_by_x_asc |
comparison condition to sort in ascending order by x More... | |
struct | compare_by_y_desc |
comparison condition to sort in descending order by y More... | |
struct | copy_cond |
Copy condition when zipping an interval. More... | |
struct | copy_cond< Begin, Begin > |
Copy condition when zipping an interval. More... | |
Public Types | |
typedef tmp::bubble_sort< typename tmp::concatenate< Inter1, Inter2 >::type, compare_by_x_asc< tmp::_1, tmp::_2 > >::type | half_sorted |
sort the concatenated intervals by x ascending | |
typedef tmp::bubble_sort< half_sorted, compare_by_y_desc< tmp::_1, tmp::_2 > >::type | sorted |
sort by y descending | |
typedef tmp::copy_if< sorted, tmp::inserter< typename tmp::empty< sorted >::type, tmp::push_back< tmp::_1, tmp::_2 > >, copy_cond< tmp::_1, typename tmp::begin< sorted >::type > >::type | type |
zip using the copy condition | |
Merge two intervals.
Inter1 | the first interval |
Inter2 | the second interval |
The result of the merge is a new interval containing all the breakpoints of both intervals. The x values are unique-sorted. If an x value appears in both intervals, the merged interval will contain the higher y value for that x value.
Definition at line 90 of file interval.hpp.