Fixed CyclicShape - SeqAn API Documentation

# Spec Fixed CyclicShape
CyclicShape defined at compile time.

Extends | CyclicShape
All Extended | CyclicShape
Defined in | <seqan/modifier.h>
Signature | `template <unsigned L, typename THardwiredShape, unsigned R> class CycledShape<FixedShape<L, GappedShape<THardwiredShape>, R> >;`

## Template Parameters

`L` | Left offset. Number of leading zeros of the Shape.
`R` | Right offset. Number of trailing zeros of the Shape.
`THardwiredShape` | A specialization of HardwiredShape
`TSize` | Size type of the CyclicShape

## Member Function Overview

- `CyclicShape();, CyclicShape(shape);`
  The constructor

## Interface Function Overview

### Interface Functions Inherited From CyclicShape

- `carePositions`
- `cyclicShapeToString`
- `cyclicShapeToSuffixLengths`
- `weight`

## Interface Metafunction Overview

- `WEIGHT<CyclicShape<FixedShape<L, TInnerShape, R> > >::VALUE;`
  Weight (number of care-positions) of Fixed CyclicShapes

### Interface Metafunctions Inherited From CyclicShape

- `Size`

## Member Variable Overview

- `TSize[] FixedCyclicShape::diffs`
  Distances between care positions.

### Member Variables Inherited From CyclicShape

- `loffset`
- `span`

## Detailed Description

Fixed CylcicShapes contain their information at compile time, so in most cases no object must be created. The notation is similar to the one of HardwiredShape: Template paramters code for the distance between ones. Additionally you have to specify the number of leading and trailing zeros.

The notation is chosen in such a way that predefined Shapes like PatternHunter can be plugged into a CyclicShape. Like HardwiredShapes, Fixed CyclicShapes are limited to a weight of 21.

See CyclicShape for an example on how to use a CyclicShape.

## See Also

- ModCyclicShapeModifiedIterator
- ModCyclicShapeModifiedString

## Member Functions Detail

### `CyclicShape(); CyclicShape(shape);`

The constructor

#### Parameters

`shape` | A FixedCyclicShape of this type

This constructor does not do anything, the FixedCyclicShape is defined by its type alone. See the example on how to create a CyclicShape:

            typedef GappedShape<HardwiredShape<1, 1, 3, 2> >       TInnerShape; // 11100101
            // ^--You can also use predefied Shapes here, e.g. Patternhunter

            typedef CyclicShape<FixedShape<2, TInnerShape, 1> > TShape;     // 00111001010
            TShape shape;

Snippet from: demos/dox/modifier/cyclic_shape_snippets.cpp

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## Interface Metafunctions Detail

### `WEIGHT<CyclicShape<FixedShape<L, TInnerShape, R> > >::VALUE;`

Weight (number of care-positions) of Fixed CyclicShapes

#### Template Parameters

`L` | left offset
`R` | right offset
`TInnerShape` | specialization of a hardwired GappedShape

#### Returns

`Weight` | of a fixed CyclicShape (enum).

## Member Variables Detail

### `TSize[] FixedCyclicShape::diffs`

Distances between care positions.

`static const TSize diffs[]` has weight many non-zero entries in the beginning, the remaining ones are zero. An additional entry at position weight1 holds the cyclic distance from the last "1" to the first one. During the iteration with a ModCyclicShapeModifiedIterator an index position keeps track of the position inside `diffs`.

#### Dox Sources

    /*!
     * @class FixedCyclicShape Fixed CyclicShape
     *
     * @extends CyclicShape
     *
     * @headerfile <seqan/modifier.h>
     *
     * @brief CyclicShape defined at compile time.
     *
     * @signature template <unsigned L, typename THardwiredShape, unsigned R> class
     *            CycledShape<FixedShape<L, GappedShape<THardwiredShape>, R> >;
     *
     * @tparam L Left offset. Number of leading zeros of the Shape.
     * @tparam R Right offset. Number of trailing zeros of the Shape.
     * @tparam THardwiredShape A specialization of @link HardwiredShape @endlink
     * @tparam TSize Size type of the CyclicShape
     *
     * Fixed CylcicShapes contain their information at compile time, so in most
     * cases no object must be created. The notation is similar to the one of @link
     * HardwiredShape @endlink: Template paramters code for the distance between
     * ones. Additionally you have to specify the number of leading and trailing
     * zeros.
     *
     * The notation is chosen in such a way that predefined Shapes like
     * PatternHunter can be plugged into a CyclicShape. Like HardwiredShapes, Fixed
     * CyclicShapes are limited to a weight of 21.
     *
     * See @link CyclicShape @endlink for an example on how to use a CyclicShape.
     *
     * @see ModCyclicShapeModifiedString
     * @see ModCyclicShapeModifiedIterator
     *
     * @fn FixedCyclicShape::CyclicShape
     *
     * @brief The constructor
     *
     * @signature CyclicShape();
     * @signature CyclicShape(shape);
     *
     * @param[in] shape A FixedCyclicShape of this type
     *
     * This constructor does not do anything, the FixedCyclicShape is defined by its
     * type alone. See the example on how to create a CyclicShape:
     *
     * @snippet demos/dox/modifier/cyclic_shape_snippets.cpp Define FixedCyclicShape
     *
     *
     *
     * @mfn FixedCyclicShape#WEIGHT
     *
     * @headerfile <seqan/modifier.h>
     *
     * @brief Weight (number of care-positions) of Fixed CyclicShapes
     *
     * @signature WEIGHT<CyclicShape<FixedShape<L, TInnerShape, R> > >::VALUE;
     *
     * @tparam L left offset
     * @tparam R right offset
     * @tparam TInnerShape specialization of a hardwired GappedShape
     *
     * @return Weight of a fixed CyclicShape (enum).
     *
     * @see CyclicShape#weight
     *
     * @var TSize[] FixedCyclicShape::diffs;
     *
     * @brief Distances between care positions.
     *
     * <tt>static const TSize diffs[]</tt> has <i>weight</i> many non-zero entries
     * in the beginning, the remaining ones are zero. An additional entry at
     * position <i>weight1</i> holds the cyclic distance from the last "1" to the
     * first one. During the iteration with a @link ModCyclicShapeModifiedIterator
     * @endlink an index position keeps track of the position inside <tt>diffs</tt>.
     */