# Spec Splitter
Splits an interval into equal-sized subintervals.

Extends | Splitter
All Extended | Splitter
Defined in | <seqan/parallel.h>
Signature | `template <typename TValue> class Splitter<TValue, Equidistant>;`

## Template Parameters

`TValue` | Type of the interval boundaries.

## Member Function Overview

### Member Functions Inherited From Splitter

- `Splitter`

## Interface Function Overview

### Interface Functions Inherited From Splitter

- `length`
- `resize`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From Splitter

- `Size`
- `Value`

## Detailed Description

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

### Examples

Simple example for equidistant splitting.

    #include <iostream>
    #include <seqan/parallel.h>

    using namespace seqan;

    int main()
    {
        // instantiate a Splitter to divide the interval [10,20) in 3 subintervals
        Splitter<unsigned> splitter(10, 20, 3);

        // output all subintervals
        for (unsigned i = 0; i < length(splitter); ++i)
            std::cout << '[' << splitter[i] << ',' << splitter[i + 1] << ')' << std::endl;

        return 0;
    }

Demo: demos/dox/parallel/splitter_example.cpp

Output:

    4)
    [14,17)
    [17,20)

#### Dox Sources

    /*!
     * @class Equidistant Splitter
     *
     * @extends Splitter
     *
     * @headerfile <seqan/parallel.h>
     *
     * @brief Splits an interval into equal-sized subintervals.
     *
     * @signature template <typename TValue> class Splitter<TValue, Equidistant>;
     *
     * @tparam TValue Type of the interval boundaries.
     *
     * This @link Splitter @endlink specialization divides an interval into
     * subintervals of (almost) equal length, i.e. two subintervals differ by at
     * most 1 in size.
     *
     * @section Examples
     *
     * Simple example for equidistant splitting.
     *
     * @include demos/dox/parallel/splitter_example.cpp
     *
     * Output:
     *
     * @code
     * [10,14)
     * [14,17)
     * [17,20)
     * @endcode
     */