Class
Splitter
Splits an interval into subintervals.
This class divides an interval into the disjoint union of subintervals and enumerates its boundaries.
It can be used to parallelize large for-loops that iterate over a contiguous range of elements.
The interval and the number of subintervals can be set in the constructor Splitter.
length and resize can be used to retrieve or change the number of subintervals later.
In contrast to other containers the Splitter allows to access one more element than its length would imply to allow to retrieve the right boundary of each subinterval (see example code below).
Splitter | |||||||
Include Headers
seqan/parallel.h
Parameters
Type of the interval boundaries. | |
Tag to select the way the values are sampled. Default: Equidistant Splitter |
Specializations
Splits an interval into equal-sized subintervals. |
Metafunctions
Type of an object that is suitable to hold size information. | |
Type of the items in the container or behind an iterator. |
Member Functions
Constructor |
Functions
The number of items/characters. | |
Resizes a container. If the new length exceeds the old length the new elements are filled with copies of |
Examples
Simple example for equidistant (default) splitting.
File "splitter_example.cpp"
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 |
[14,17)
[17,20)
SeqAn - Sequence Analysis Library - www.seqan.de