Work function invokes sequential (i.e., STL) adjacent_find
.
More...
Public Member Functions | |
range_adjacent_find (Predicate predicate) | |
template<typename View > | |
View::reference::reference | operator() (View const &vw) const |
Work function invokes sequential (i.e., STL) adjacent_find
.
The function operator will be called for each local set of overlapping intervals (for range_adjacent_find, the overlap is just one element and the intervals are simply pairs of adjacent elements) and for each set of overlapping intervals that span across locations (and need to fetch remote elements):
LOC 1 || LOC 2 –*—-*—-*–||–*—-*– __|____|____| | | CALL 1 |______| | CALL 2|____|__ CALL 3
The domain of the coarsened Overlap passed in the input argument will contain the first elements of (the domains of) all the intervals in the current set; hence, in the calls for the internal subdomains (CALL 1/3), we extend the domain by the size of the right overlap (= 1 in this case) in order to cover the whole local chunk.
At the boundary of the global domain, there is a degenerate interval with size smaller than the overlap - it has been clipped so that the overlap doesn't fall beyound the domain (see overlap_partition):
LOC 1 –*—-*—-* __|____|____| |_| CALL 1
Therefore, there is no need to extend the domain. If, however, the degenerate interval is on a different location:
LOC 1 || LOC 2 –*——*—-||—-* __|______| CALL 1 |__________| CALL 2 |___| CALL 3
we skip it (returning a null_reference in CALL 3), as it has been covered by the previous call.
Note that in other range-based algorithms, the size and number of the degenerate intervals to be skipped may be greater than one (cf. the algorithms in the "See also" section below).