# Spec IndexDfi
The Deferred Frequency Index (see Weese and Schulz, "Efficient string mining under constraints via the deferred frequency index").

Extends | IndexWotd
All Extended | Index, IndexWotd
All Impl'd | StringTreeConcept
Defined in | <seqan/index.h>
Signature | `template <typename TText, typename TPredHull, typename TPred> class Index<TText, IndexWotd< Dfi<TPredHull, TPred> > >;`

## Template Parameters

`TText` | The text.
`TPred` | An arbitrary frequency predicate.
`TPredHull` | A monotonic hull of `TPred`

## Interface Function Overview

- `TFibre dirAt(position, index);`
  Shortcut for `value(indexDir(index), position)`.
- `TFibre indexDir(index);`
  Shortcut for `getFibre(.., DfiDir())`.
- `TSa indexSA(index);`
  Shortcut for `getFibre(.., DfiSA)`.
- `TValue saAt(position, index);`
  Shortcut for `value(indexSA(..), ..)`.

### Interface Functions Inherited From Index

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

### Interface Functions Inherited From IndexWotd

- `createWotdIndex`
- `dirAt`
- `indexDir`
- `indexSA`
- `saAt`

### Interface Functions Inherited From StringTreeConcept

- `resizeVertexMap`
- `begin`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From Index

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

### Interface Metafunctions Inherited From StringTreeConcept

- `Iterator`
- `VertexDescriptor`

## Detailed Description

This index is based on a lazy suffix tree (see IndexWotd). All `TPredHull` sufficing nodes can be iterated using a TopDownIterator. To iterate the exact solution set of `TPred`, use a TopDownHistoryIterator of this index.

## Interface Functions Detail

### `TFibre dirAt(position, index);`

Shortcut for `value(indexDir(index), position)`.

#### Parameters

`index` | The IndexDfi object holding the fibre.
`position` | A position in the array on which the value should be accessed.

#### Returns

`TFibre` | A reference to the DfiDir fibre.

#### Data Races

Thread safety unknown!

### `TFibre indexDir(index);`

Shortcut for `getFibre(.., DfiDir())`.

#### Parameters

`index` | The IndexDfi object holding the fibre.

#### Returns

`TFibre` | A reference to the DfiDir fibre (tree structure).

#### Data Races

Thread safety unknown!

### `TSa indexSA(index);`

Shortcut for `getFibre(.., DfiSA)`.

#### Parameters

`index` | The IndexDfi object holding the fibre.

#### Returns

`TSa` | A reference to the DfiSA fibre (partially sorted suffix array).

#### Data Races

Thread safety unknown!

### `TValue saAt(position, index);`

Note.

Advanced functionality, not commonly used.

Shortcut for `value(indexSA(..), ..)`.

#### Parameters

`index` | The IndexDfi object holding the fibre.
`position` | A position in the array on which the value should be accessed.

#### Returns

`TValue` | A reference or proxy to the value in the DfiSA fibre. To be more precise, a reference to a position containing a value of type SAValue is returned (or a proxy).

#### Data Races

Thread safety unknown!

#### Dox Sources

    /*!
     * @class IndexDfi
     *
     * @extends IndexWotd
     *
     * @headerfile <seqan/index.h>
     *
     * @brief The Deferred Frequency Index (see Weese and Schulz, "Efficient string
     *        mining under constraints via the deferred frequency index").
     *
     * @signature template <typename TText, typename TPredHull, typename TPred>
     *            class Index<TText, IndexWotd< Dfi<TPredHull, TPred> > >;
     *
     * @tparam TText The @link TextConcept text @endlink.
     * @tparam TPred An arbitrary frequency predicate.
     * @tparam TPredHull A monotonic hull of <tt>TPred</tt>
     *
     * This index is based on a lazy suffix tree (see @link IndexWotd @endlink). All
     * <tt>TPredHull</tt> sufficing nodes can be iterated using a @link
     * TopDownIterator @endlink. To iterate the exact solution set of
     * <tt>TPred</tt>, use a @link TopDownHistoryIterator @endlink of this index.
     *
     * @fn IndexDfi#indexSA
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Shortcut for <tt>getFibre(.., DfiSA)</tt>.
     *
     * @signature TSa indexSA(index);
     *
     * @param[in] index The @link IndexDfi @endlink object holding the fibre.
     *
     * @return TSa A reference to the @link DfiIndexFibres#DfiSA @endlink fibre
     *             (partially sorted suffix array).
     *
     * @fn IndexDfi#indexDir
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Shortcut for <tt>getFibre(.., DfiDir())</tt>.
     *
     * @signature TFibre indexDir(index);
     *
     * @param[in] index The @link IndexDfi @endlink object holding the fibre.
     *
     * @return TFibre A reference to the @link DfiIndexFibres#DfiDir @endlink fibre
     *                (tree structure).
     *
     * @fn IndexDfi#saAt
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Shortcut for <tt>value(indexSA(..), ..)</tt>.
     *
     * @note Advanced functionality, not commonly used.
     *
     * @signature TValue saAt(position, index);
     *
     * @param[in] index The @link IndexDfi @endlink object holding the fibre.
     * @param[in] position A position in the array on which the value should be
     *                     accessed.
     *
     * @return TValue A reference or proxy to the value in the @link
     *                DfiIndexFibres#DfiSA @endlink fibre. To be more precise, a
     *                reference to a position containing a value of type @link
     *                SAValue @endlink is returned (or a proxy).
     *
     * @fn IndexDfi#dirAt
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Shortcut for <tt>value(indexDir(index), position)</tt>.
     *
     * @signature TFibre dirAt(position, index);
     *
     * @param[in] index The @link IndexDfi @endlink object holding the fibre.
     * @param[in] position A position in the array on which the value should be
     *                     accessed.
     *
     * @return TFibre A reference to the @link DfiIndexFibres#DfiDir @endlink fibre.
     */