Class Specialization
Equidistant Splitter
Splits an interval into equal-sized subintervals.
This Splitter specialization divides an interval into subintervals of (almost) equal length, i.e. two subintervals differ by at most 1 in size.

Splitter

Equidistant Splitter

Splitter<TValue[, Equidistant]>
Include Headers
seqan/parallel.h
Parameters

TValue | Type of the interval boundaries.

Specialization of
Splitter
Metafunctions

Size | Type of an object that is suitable to hold size information. (Splitter)
Value | Type of the items in the container or behind an iterator. (Splitter)

Member Functions

Splitter | Constructor (Splitter)

Functions

length | The number of items/characters. (Splitter)
resize | Resizes a container. If the new length exceeds the old length the new elements are filled with copies of value. (Splitter)

Examples
Simple example for equidistant splitting.
File "splitter_example.cpp"

1 | #include <iostream>
2 | #include <seqan/parallel.h>
3 |
4 | using namespace seqan;
5 |
6 | int main ()
7 | {
8 | // instantiate a Splitter to divide the interval [10,20) in 3 subintervals
9 | Splitter<unsigned> splitter(10, 20, 3);
10 |
11 | // output all subintervals
12 | for (unsigned i = 0; i < length(splitter); ++i)
13 | std::cout << '[' << splitter[i] << ',' << splitter[i + 1] << ')' << std::endl;
14 |
15 | return 0;
16 | }

[10,14)
[14,17)
[17,20)
SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2014/10/13 16:13:00