# Spec OpenAddressingQGramIndex
A q-gram that uses open addressing hashing instead of an array.

Extends | IndexQGram
All Extended | Index, IndexQGram
All Impl'd | StringTrieConcept
Defined in | <seqan/index.h>
Signature | `template <typename TIndex, typename TShapeSpec> class Index<TText, IndexQGram<TShapeSpec, OpenAddressing> >;`

## Template Parameters

`TText` | The text type.
`TShapeSpec` | The Shape specialization type.

## Member Function Overview

- `Index::Index();, Index::Index(index);, Index::Index(text[, shape]);`
  Constructor

### Member Functions Inherited From IndexQGram

- `Index`

## Interface Function Overview

### Interface Functions Inherited From Index

- `clear`
- `countSequences`
- `getFibre`
- `indexCreate`
- `indexRawText`
- `indexRequire`
- `indexSupplied`
- `indexText`
- `length`
- `open`
- `rawtextAt`
- `save`

### Interface Functions Inherited From IndexQGram

- `countOccurrences`
- `countOccurrencesMultiple`
- `createCountArray`
- `createQGramIndex`
- `createQGramIndexDirOnly`
- `createQGramIndexSAOnly`
- `dirAt`
- `getKmerSimilarityMatrix`
- `getOccurrence`
- `getOccurrences`
- `getStepSize`
- `indexBucketMap`
- `indexCounts`
- `indexCountsDir`
- `indexDir`
- `indexSA`
- `indexShape`
- `range`
- `saAt`
- `setStepSize`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From Index

- `DefaultIndexCreator`
- `DefaultIndexSpec`
- `DefaultIndexStringSpec`
- `GetVSTreeIteratorTraits`
- `Size`

## Member Variable Overview

- `double OpenAddressingQGramIndex::alpha`
  Load factor. Controls space/time-tradeoff and must be greater 1. Default value is 1.6.

## Detailed Description

This index uses a non-trivial hashing for mapping q-gram hash values to buckets. This reduces the sizes of bucket directories (QGramDir, QGramCountsDir fibres) from Σq to min(α · n, \Sigmaq), for a load factor α > 1. A bucket still stores occurrences (or counts) of the same q-gram, but in contrast to the IndexQGram index, buckets are in random order due to the hashing.

## Member Functions Detail

### `Index::Index(); Index::Index(index); Index::Index(text[, shape]);`

Constructor

#### Parameters

`index` | Other Index object to copy from.
`text` | The text to be indexed.
`shape` | The qgram Shape to be applied.

#### Data Races

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

## Member Variables Detail

### `double OpenAddressingQGramIndex::alpha`

Load factor. Controls space/time-tradeoff and must be greater 1. Default value is 1.6.

#### Dox Sources

    /*!
     * @class OpenAddressingQGramIndex
     *
     * @extends IndexQGram
     *
     * @headerfile <seqan/index.h>
     *
     * @brief A <i>q</i>-gram that uses open addressing hashing instead of an array.
     *
     * @signature template <typename TIndex, typename TShapeSpec> class Index<TText,
     *            IndexQGram<TShapeSpec, OpenAddressing> >;
     *
     * @tparam TText The @link TextConcept text type @endlink.
     * @tparam TShapeSpec The @link Shape @endlink specialization type.
     *
     * This index uses a non-trivial hashing for mapping q-gram hash values to
     * buckets. This reduces the sizes of bucket directories (QGramDir,
     * QGramCountsDir fibres) from &Sigma;<i><sup>q</sup></i> to min(<i>&alpha;
     * &middot; n</i>, \Sigma<i><sup>q</sup></i>), for a load factor <i>&alpha; &gt;
     * 1</i>. A bucket still stores occurrences (or counts) of the same
     * <i>q</i>-gram, but in contrast to the @link IndexQGram @endlink index,
     * buckets are in random order due to the hashing.
     *
     * @fn OpenAddressingQGramIndex::Index
     *
     * @brief Constructor
     *
     * @signature Index::Index();
     * @signature Index::Index(index);
     * @signature Index::Index(text[, shape]);
     *
     * @param[in] index Other Index object to copy from.
     * @param[in] text The text to be indexed.
     * @param[in] shape The qgram @link Shape @endlink to be applied.
     *
     * @var double OpenAddressingQGramIndex::alpha;
     *
     * @brief Load factor. Controls space/time-tradeoff and must be greater 1.
     *        Default value is 1.6.
     */