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
Metafunctions
SizeType of an object that is suitable to hold size information. (Splitter)
ValueType of the items in the container or behind an iterator. (Splitter)
Member Functions
SplitterConstructor (Splitter)
Functions
lengthThe number of items/characters. (Splitter)
resizeResizes 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.
1#include <iostream>
2#include <seqan/parallel.h>
3
4using namespace seqan;
5
6int 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 @2013/07/11 09:12:38