Class RankDictionary
A rank dictionary is a data structure storing the rank of an element in a sequence at every position of the sequence.

All Subcl's TwoLevelRankDictionary, WaveletTree
Defined in <seqan/index.h>
Signature template <typename TValue, typename TSpec> struct RankDictionary;

Template Parameters

TSpec The rank dictionary specialisation. Default: WaveletTree, TwoLevelRankDictionary.

Interface Function Overview

Interface Functions Detail

void clear(dictionary);

Resets the rank dictionary.

Parameters

dictionary The rank dictionary to be cleared.

Data Races

Thread safety unknown!

void createRankDictionary(dictionary, text);

This functions creates the dictionary.

Parameters

text A text to be transfered into a rank dictionary. Types: ContainerConcept
dictionary The dictionary.

Data Races

Thread safety unknown!

bool empty(dictionary);

Returns whether or not the rank dictionary is empty.

Parameters

dictionary The rank dictionary to be checked.

Returns

bool true if the dictionary is empty, false otherwise.

Data Races

Thread safety unknown!

TFibre getFibre(dictionary, fibreTag);

Returns a specific fibre of a dictionary.

Parameters

dictionary The dictionary holding the fibre.
fibreTag A tag that identifies the Fibre. Types: RankDictionaryFibres.

Returns

TFibre A reference to the Fibre object.

Data Races

Thread safety unknown!

TSize countOccurrences(dictionary, pos[, character]);

Returns the rank of a specified character up to a specified position.

Parameters

dictionary The dictionary.
pos The position (which is also included in the rank computation).
character The character of interest. Default: true

Returns

TSize The rank of a specified character up to a specified position. The result of the metafunction Size<RankDictionary>::Type

Data Races

Thread safety unknown!

TValue getValue(dictionary, pos);

Returns the character of a specified position.

Parameters

dictionary The dictionary.
pos The position. Types: UnsignedIntegerConcept.

Returns

TValue Returns the character of a specified position. The result is of type Value<RankDictionary>::Type;

Data Races

Thread safety unknown!

TSize length(dict)

Retruns the number of element in the rank dictionary.

Parameters

dict The RankDictionary.

Returns

TSize The number of element in the rank dictionary. The result of the metafunction Size<RankDictionary>::Type

Data Races

Thread safety unknown!

bool open(dictionary, fileName[, openMode]);

This functions loads a rank dictionary from disk.

Parameters

dictionary The dictionary.
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

Thread safety unknown!

TSize reserve(dict, newCapacity, tag)

Reserves memory for a specified number of elements in the rank dictionary

Parameters

dict The RankDictionary.
newCapacity The number of elements one wants to reserve memory for.
tag The tag that specifies the memory allocation strategy. Types: OverflowStrategyTags.

Returns

TSize Retruns the number of element that could be reserved. The result of the metafunction Size<RankDictionary>::Type

Remarks

This operation does not changes the content of object.

This operation may invalidate iterators of object.

Data Races

Thread safety unknown!

TSize resize(dict, newLength, tag)

Increases the length of a rank dictionary to a specified value.

Parameters

dict The RankDictionary.
newLength The number of elements the rank dictionaru contains after resizing.
tag The tag that specifies the memory allocation strategy. Types: OverflowStrategyTags.

Returns

TSize Retruns the number of element that could be reserved. The result of the metafunction Size<RankDictionary>::Type

Remarks

This operation may invalidate iterators of object.

Data Races

Thread safety unknown!

bool save(dictionary, fileName[, openMode]);

This functions saves a dictionary to disk.

Parameters

dictionary The dictionary.
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

TReturn A bool which is true on success.

Data Races

Thread safety unknown!

void setValue(dictionary, pos, character);

Sets the character at a specified position.

Parameters

dictionary The dictionary.
pos The position. Types: UnsignedIntegerConcept.
character The character to be set.

Data Races

Thread safety unknown!

void updateRanks(dict)

Updates the rank information.

Parameters

dict The RankDictionary.

Data Races

Thread safety unknown!