# Group Position Calculation
Position calculation functions.

## Grouped Function Overview

- `TPos posAdd(pos, delta);`
  Returns a position where the local offset is increased by a value `delta`.
- `bool posAddAndCheck(pos, delta, text);`
  Increases the local offset of a position by a value `delta` and check for overflow.
- `void posInc(pos);`
  Increments the local offset of a position type.
- `TPos posNext(pos);`
  Returns a position where the local offset is increased by one.
- `TPos posPrev(pos);`
  Returns a position where the local offset is decreased by one.
- `TPos posSub(pos, delta);`
  Returns a position where the local offset is decreased by a value `delta`.

## Grouped Functions Detail

### `TPos posAdd(pos, delta);`

Defined in
  <seqan/sequence.h>

Returns a position where the local offset is increased by a value `delta`.

#### Parameters

`pos` | A position type, an integer with `seqOfs` or a pair `(seqNo, seqOfs)`.
`delta` | Increase the local offset of `pos` by this value.

#### Returns

`TPos` | Returns a value of the same type as `pos` where `seqOfs` is increased by `delta`.

#### Data Races

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

#### See Also

- posInc
- posNext
- posPrev

### `bool posAddAndCheck(pos, delta, text);`

Defined in
  <seqan/sequence.h>

Increases the local offset of a position by a value `delta` and check for overflow.

#### Parameters

`pos` | A position type, an integer with `seqOfs` or a pair `(seqNo, seqOfs)`.
`delta` | Increase the local offset of `pos` by this value.
`text` | The text to use for checking.

#### Data Races

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

#### See Also

- posAdd
- posInc

### `void posInc(pos);`

Defined in
  <seqan/sequence.h>

Increments the local offset of a position type.

#### Parameters

`pos` | A position type, an integer with `seqOfs` or a pair `(seqNo, seqOfs)`. In both cases, `seqOfs` will be incremented by one.

#### Data Races

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

#### See Also

- posAdd
- posNext
- posPrev

### `TPos posNext(pos);`

Defined in
  <seqan/sequence.h>

Returns a position where the local offset is increased by one.

#### Parameters

`pos` | A position type, an integer with `seqOfs` or a pair `(seqNo, seqOfs)`.

#### Returns

`TPos` | Returns a value of the same type as `pos` where `seqOfs` is increased by one.

#### Data Races

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

#### See Also

- posAdd
- posInc
- posPrev

### `TPos posPrev(pos);`

Defined in
  <seqan/sequence.h>

Returns a position where the local offset is decreased by one.

#### Parameters

`pos` | A position type, an integer with `seqOfs` or a pair `(seqNo, seqOfs)`.

#### Returns

`TPos` | The predecessor. TPos is the type of `pos`.

#### Data Races

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

#### See Also

- posAdd
- posInc
- posNext

### `TPos posSub(pos, delta);`

Defined in
  <seqan/sequence.h>

Returns a position where the local offset is decreased by a value `delta`.

#### Parameters

`pos` | A position type, an integer with `seqOfs` or a pair `(seqNo, seqOfs)`.
`delta` | Decrease the local offset of `pos` by this value.

#### Returns

`TPos` | Returns a value of the same type as `pos` where `seqOfs` is decreased by `delta`.

#### Data Races

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

#### See Also

- posAdd
- posInc
- posNext

#### Dox Sources

    /*!
     * @defgroup PositionCalculation Position Calculation
     *
     * @brief Position calculation functions.
     *
     * @fn PositionCalculation#posPrev
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Returns a position where the local offset is decreased by one.
     *
     * @signature TPos posPrev(pos);
     *
     * @param[in] pos A position type, an integer with <tt>seqOfs</tt> or a pair
     *                <tt>(seqNo, seqOfs)</tt>.
     *
     * @return TPos The predecessor. TPos is the type of <tt>pos</tt>.
     *
     * @see PositionCalculation#posNext
     * @see PositionCalculation#posInc
     * @see PositionCalculation#posAdd
     *
     * @fn PositionCalculation#posInc
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Increments the local offset of a position type.
     *
     * @signature void posInc(pos);
     *
     * @param[in,out] pos A position type, an integer with <tt>seqOfs</tt> or a pair
     *                    <tt>(seqNo, seqOfs)</tt>. In both cases, <tt>seqOfs</tt>
     *                    will be incremented by one.
     *
     * @see PositionCalculation#posNext
     * @see PositionCalculation#posPrev
     * @see PositionCalculation#posAdd
     *
     * @fn PositionCalculation#posNext
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Returns a position where the local offset is increased by one.
     *
     * @signature TPos posNext(pos);
     *
     * @param[in] pos A position type, an integer with <tt>seqOfs</tt> or a pair
     *                <tt>(seqNo, seqOfs)</tt>.
     *
     * @return TPos Returns a value of the same type as <tt>pos</tt> where
     *              <tt>seqOfs</tt> is increased by one.
     *
     * @see PositionCalculation#posInc
     * @see PositionCalculation#posPrev
     * @see PositionCalculation#posAdd
     *
     * @fn PositionCalculation#posAdd
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Returns a position where the local offset is increased by a value
     *        <tt>delta</tt>.
     *
     * @signature TPos posAdd(pos, delta);
     *
     * @param[in] pos A position type, an integer with <tt>seqOfs</tt> or a pair
     *                <tt>(seqNo, seqOfs)</tt>.
     * @param[in] delta Increase the local offset of <tt>pos</tt> by this value.
     *
     * @return TPos Returns a value of the same type as <tt>pos</tt> where
     *              <tt>seqOfs</tt> is increased by <tt>delta</tt>.
     *
     * @see PositionCalculation#posInc
     * @see PositionCalculation#posPrev
     * @see PositionCalculation#posNext
     *
     * @fn PositionCalculation#posAddAndCheck
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Increases the local offset of a position by a value <tt>delta</tt> and
     *        check for overflow.
     *
     * @signature bool posAddAndCheck(pos, delta, text);
     *
     * @param[in,out] pos A position type, an integer with <tt>seqOfs</tt> or a pair
     *                    <tt>(seqNo, seqOfs)</tt>.
     * @param[in] delta Increase the local offset of <tt>pos</tt> by this value.
     * @param[in] text The @link TextConcept text @endlink to use for checking.
     *
     * @see PositionCalculation#posAdd
     * @see PositionCalculation#posInc
     *
     * @fn PositionCalculation#posSub
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Returns a position where the local offset is decreased by a value
     *        <tt>delta</tt>.
     *
     * @signature TPos posSub(pos, delta);
     *
     * @param[in] pos A position type, an integer with <tt>seqOfs</tt> or a pair
     *                <tt>(seqNo, seqOfs)</tt>.
     * @param[in] delta Decrease the local offset of <tt>pos</tt> by this value.
     *
     * @return TPos Returns a value of the same type as <tt>pos</tt> where
     *              <tt>seqOfs</tt> is decreased by <tt>delta</tt>.
     *
     * @see PositionCalculation#posAdd
     * @see PositionCalculation#posInc
     * @see PositionCalculation#posNext
     */