fn() computeSplittersCompute splitters for a sequence of objects.
Compute splitters for a sequence of objects.
Defined in | <seqan/parallel.h> |
---|---|
Signature |
void computeSplitters(splitters, size, count);
|
Parameters
splitters
|
Resulting splitters, will be resized to contain count + 1 elements, e.g. an AllocString of integers. |
---|---|
size
|
The number of objects to split. |
count
|
The number of chunks. |
Detailed Description
Remarks
The first count - 1 chunks will have the size ceil(size / count), the last chunk will contain the rest.
Examples
Most simple case for splitting.
String<unsigned> splitters; computeSplitters(splitters, 10, 5); // splitters == {0, 5, 10}
In this case, the last chunks will stay empty.
computeSplitters(splitters, 3, 5); // splitters == {0, 1, 2, 3, 3, 3}
Data Races
Thread safety unknown!