# Spec Sampler
Outputs m-tuples beginning at a position of difference cover DC.

Extends | Pipe
All Extended | Pipe
Defined in | <seqan/pipe.h>
Signature | `template <typename TInput, unsigned M[, typename TPack]> class Pipe<TInput, Sampler<M, TPack> >;`

## Template Parameters

`TInput` | The type of the pipeline module this module reads from.
`m` | The tuple size.
`TPack` | Specifies the packing method of the tuples (`void` = no packing), default is `Pack`.

## Member Function Overview

### Member Functions Inherited From Pipe

- `Pipe`

## Interface Function Overview

### Interface Functions Inherited From Pipe

- `assign`
- `atEnd`
- `beginRead`
- `endRead`
- `front`
- `length`
- `pop`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From Pipe

- `Size`
- `Value`

## Detailed Description

The output type is a Pair of size type and Tuple of input elements and length m (i.e. `Pair<Size<TInput>::Type, Tuple<Value<TInput>::Type, m, TPack> >`).

The first output field contains the number of remaining pipe elements. The m-tuple in the second field contains the first m elements of them. The m-tuples are substrings of the input stream beginning at positions `i`, with `(n-i) mod m` is element of the set DC (n is the input stream length).

### Examples

The set `{1,2,4}` is represented by `int DC[] = { 3, 1, 2, 4 }`.

## See Also

- BitPackedTuple

#### Dox Sources

    /*!
     * @class Sampler
     *
     * @extends Pipe
     *
     * @headerfile <seqan/pipe.h>
     *
     * @brief Outputs m-tuples beginning at a position of difference cover DC.
     *
     * @signature template <typename TInput, unsigned M[, typename TPack]> class
     *            Pipe<TInput, Sampler<M, TPack> >;
     *
     * @tparam TInput The type of the pipeline module this module reads from.
     * @tparam m The tuple size.
     * @tparam TPack Specifies the packing method of the tuples (<tt>void</tt> = no
     *               packing), default is <tt>Pack</tt>.
     *
     * The output type is a Pair of size type and Tuple of input elements and length
     * m (i.e. <tt>Pair&lt;Size&lt;TInput&gt;::Type,
     * Tuple&lt;Value&lt;TInput&gt;::Type, m, TPack&gt; &gt;</tt>).
     *
     * The first output field contains the number of remaining pipe elements. The
     * m-tuple in the second field contains the first m elements of them. The
     * m-tuples are substrings of the input stream beginning at positions
     * <tt>i</tt>, with <tt>(n-i) mod m</tt> is element of the set DC (n is the
     * input stream length).
     *
     * @section Examples
     *
     * The set <tt>{1,2,4}</tt> is represented by <tt>int DC[] = { 3, 1, 2, 4
     * }</tt>.
     *
     * @see BitPackedTuple
     */