# Class LF
LF is an object storing all necessary information for the LF-mapping.

Defined in | <seqan/Index.h>
Signature | `template <typename TText, typename TSpec, typename TConfig> struct LF;`

## Template Parameters

`TText` | The type of the text the LF table is constructed from.
`TSpec` | A possibility to specialize the LF table. Default: `void`
`TConfig` | A configuration object for easily defining the LF table fibres.

## Interface Function Overview

- `void clear(lfTable);`
  Resets the LF table.
- `void createLF(lfTable, text, sa);`
  Creates the LF table
- `bool empty(lfTable);`
  Clears the LF table.
- `TFibre getFibre(lfTable, fibreTag);`
  Returns a specific fibre of a LF table.
- `lfMapping(lfTable, pos)`
  Returns the position of an character at a specified position of L in F. L corresponds to the last column of the sorted cyclic rotations of the original text, while F correspond to the first column.
- `bool open(lfTable, fileName[, openMode]);`
  This functions loads a LF table from disk.
- `bool save(lfTable, fileName[, openMode]);`
  This functions saves a LF table to disk.

## Interface Functions Detail

### `void clear(lfTable);`

Resets the LF table.

#### Parameters

`lfTable` | The LF table to be cleared.

#### Data Races

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

### `void createLF(lfTable, text, sa);`

Creates the LF table

#### Parameters

`lfTable` | The LF table to be constructed.
`text` | The underlying text Types: String.
`sa` | The suffix array of the LF table underlying text. Types: String, StringSet.

#### Returns

`TReturn` | Returns a `bool` which is `true` on successes and `false` otherwise.

#### Data Races

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

### `bool empty(lfTable);`

Clears the LF table.

#### Parameters

`lfTable` | The LF table to be checked.

#### Returns

`bool` | `true` if the LF table is empty, `false` otherwise.

#### Data Races

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

### `TFibre getFibre(lfTable, fibreTag);`

Returns a specific fibre of a LF table.

#### Parameters

`fibreTag` | A tag that identifies the Fibre. Types: LFTableFibres
`lfTable` | The LF table.

#### Returns

`TFibre` | A reference to the Fibre object of type Fibre<LF<TText, TSpec, TConfig>, FibrePrefixSums>::Type

#### Data Races

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

### `lfMapping(lfTable, pos)`

Returns the position of an character at a specified position of L in F. L corresponds to the last column of the sorted cyclic rotations of the original text, while F correspond to the first column.

#### Parameters

`lfTable` | The LF holding the occurrence and prefix sum table.
`pos` | The position in L. Types: UnsignedIntegerConcept

#### Returns

`TReturn` | Returns the position of the character L[c] in F. The returned position is of the same type as pos. Types: The type of the position.

#### Data Races

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

### `bool open(lfTable, fileName[, openMode]);`

This functions loads a LF table from disk.

#### Parameters

`lfTable` | The LF object.
`fileName` | C-style character string containing the file name.
`openMode` | The combination of flags defining how the file should be opened. To open a file read-only, write-only or to read and write use `OPEN_RDONLY`, `OPEN_WRONLY`, or `OPEN_RDWR`. To create or overwrite a file add `OPEN_CREATE`. To append a file if existing add `OPEN_APPEND`. To circumvent problems, files are always opened in binary mode. Default: `OPEN_RDWR | OPEN_CREATE | OPEN_APPEND`.

#### Returns

`bool` | `true` on success.

#### Data Races

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

### `bool save(lfTable, fileName[, openMode]);`

This functions saves a LF table to disk.

#### Parameters

`lfTable` | The LF object to save.
`fileName` | C-style character string containing the file name.
`openMode` | The combination of flags defining how the file should be opened. To open a file read-only, write-only or to read and write use `OPEN_RDONLY`, `OPEN_WRONLY`, or `OPEN_RDWR`. To create or overwrite a file add `OPEN_CREATE`. To append a file if existing add `OPEN_APPEND`. To circumvent problems, files are always opened in binary mode. Default: `OPEN_RDWR | OPEN_CREATE | OPEN_APPEND`.

#### Returns

`bool` | `true` on success.

#### Data Races

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

#### Dox Sources

    /*!
     * @class LF
     *
     * @headerfile <seqan/Index.h>
     *
     * @brief LF is an object storing all necessary information for the LF-mapping.
     *
     * @signature template <typename TText, typename TSpec, typename TConfig> struct
     *            LF;
     *
     * @tparam TText The type of the text the LF table is constructed from.
     * @tparam TSpec A possibility to specialize the LF table. Default:
     *               <tt>void</tt>
     * @tparam TConfig A configuration object for easily defining the LF table
     *                 fibres.
     *
     * @fn LF#getFibre
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Returns a specific fibre of a LF table.
     *
     * @signature TFibre getFibre(lfTable, fibreTag);
     *
     * @param[in] fibreTag A tag that identifies the @link Fibre @endlink. Types:
     *                     @link LFTableFibres @endlink
     * @param[in] lfTable The LF table.
     *
     * @return TFibre A reference to the @link Fibre @endlink object of type @link
     *                Fibre @endlink&lt;@link LF @endlink&lt;TText, TSpec,
     *                TConfig&gt;, FibrePrefixSums&gt;::Type
     *
     * @fn LF#empty
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Clears the LF table.
     *
     * @signature bool empty(lfTable);
     *
     * @param[in] lfTable The LF table to be checked.
     *
     * @return bool <tt>true</tt> if the LF table is empty, <tt>false</tt>
     *              otherwise.
     *
     * @fn LF#clear
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Resets the LF table.
     *
     * @signature void clear(lfTable);
     *
     * @param[in,out] lfTable The LF table to be cleared.
     *
     * @fn LF#createLF
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Creates the LF table
     *
     * @signature void createLF(lfTable, text, sa);
     *
     * @param[out] lfTable The LF table to be constructed.
     * @param[in] text The underlying text Types: @link String @endlink.
     * @param[in] sa The suffix array of the LF table underlying text. Types: @link
     *               String @endlink, @link StringSet @endlink.
     *
     * @return TReturn Returns a <tt>bool</tt> which is <tt>true</tt> on successes
     *                 and <tt>false</tt> otherwise.
     *
     * @fn LF#open
     *
     * @headerfile <seqan/index.h>
     *
     * @brief This functions loads a LF table from disk.
     *
     * @signature bool open(lfTable, fileName[, openMode]);
     *
     * @param[in,out] lfTable The LF object.
     * @param[in] fileName C-style character string containing the file name.
     * @param[in] openMode  The combination of flags defining how the file should be
     *                     opened. To open a file read-only, write-only or to read
     *                     and write use <tt>OPEN_RDONLY</tt>, <tt>OPEN_WRONLY</tt>,
     *                     or <tt>OPEN_RDWR</tt>. To create or overwrite a file add
     *                     <tt>OPEN_CREATE</tt>. To append a file if existing add
     *                     <tt>OPEN_APPEND</tt>. To circumvent problems, files are
     *                     always opened in binary mode. Default: <tt>OPEN_RDWR |
     *                     OPEN_CREATE | OPEN_APPEND</tt>.
     *
     * @return bool <tt>true</tt> on success.
     *
     * @fn LF#save
     *
     * @headerfile <seqan/index.h>
     *
     * @brief This functions saves a LF table to disk.
     *
     * @signature bool save(lfTable, fileName[, openMode]);
     *
     * @param[in] lfTable The LF object to save.
     * @param[in] fileName C-style character string containing the file name.
     * @param[in] openMode  The combination of flags defining how the file should be
     *                     opened. To open a file read-only, write-only or to read
     *                     and write use <tt>OPEN_RDONLY</tt>, <tt>OPEN_WRONLY</tt>,
     *                     or <tt>OPEN_RDWR</tt>. To create or overwrite a file add
     *                     <tt>OPEN_CREATE</tt>. To append a file if existing add
     *                     <tt>OPEN_APPEND</tt>. To circumvent problems, files are
     *                     always opened in binary mode. Default: <tt>OPEN_RDWR |
     *                     OPEN_CREATE | OPEN_APPEND</tt>.
     *
     * @return bool <tt>true</tt> on success.
     *
     * @fn LF#lfMapping
     *
     * @headerfile <seqan/index.h>
     *
     * @brief Returns the position of an character at a specified position of L in
     *        F. L corresponds to the last column of the sorted cyclic rotations of
     *        the original text, while F correspond to the first column.
     *
     * @signature lfMapping(lfTable, pos)
     *
     * @param lfTable The @link LF @endlink holding the occurrence and prefix sum
     *                table.
     * @param pos The position in L. Types: @link UnsignedIntegerConcept @endlink
     *
     * @return TReturn Returns the position of the character L[c] in F. The returned
     *                 position is of the same type as pos. Types: The type of the
     *                 position.
     */