Class
RankDictionaryA rank dictionary is a data structure storing the rank of an element in a sequence at every position of
the sequence. Only supports sequences containing SimpleType or bool.
A rank dictionary is a data structure storing the rank of an element in a sequence at every position of
the sequence. Only supports sequences containing SimpleType or bool.
All Subcl's | Levels, WaveletTree |
---|---|
Defined in | <seqan/index.h> |
Signature |
template <typename TValue, typename TSpec>
struct RankDictionary;
|
Template Parameters
TSpec |
The rank dictionary specialisation. Default: WaveletTree, Levels. |
---|
Interface Function Overview
-
void clear(dictionary);
Resets the rank dictionary. -
void createRankDictionary(dictionary, text);
This functions creates the dictionary. -
bool empty(dictionary);
Returns whether or not the rank dictionary is empty. -
TFibre getFibre(dictionary, fibreTag);
Returns a specific fibre of a dictionary. -
TSize countOccurrences(dictionary, pos[, character]);
Returns the rank of a specified character up to a specified position. -
TValue getValue(dictionary, pos);
Returns the character of a specified position. -
TSize length(dict)
Retruns the number of element in the rank dictionary. -
bool open(dictionary, fileName[, openMode]);
This functions loads a rank dictionary from disk. -
TSize reserve(dict, newCapacity, tag)
Reserves memory for a specified number of elements in the rank dictionary -
TSize resize(dict, newLength, tag)
Increases the length of a rank dictionary to a specified value. -
bool save(dictionary, fileName[, openMode]);
This functions saves a dictionary to disk. -
void setValue(dictionary, pos, character);
Sets the character at a specified position. -
void updateRanks(dict)
Updates the rank information.
Interface Functions Detail
void clear(dictionary);
Resets the rank dictionary.
Parameters
dictionary
|
The rank dictionary to be cleared. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
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
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
void updateRanks(dict)
Updates the rank information.
Parameters
dict
|
The RankDictionary. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.