Class
SparseStringA string storing only a fraction of the values of the original string.
A string storing only a fraction of the values of the original string.
Defined in | <seqan/index.h> |
---|---|
Signature |
template <typename TValueString, typename TSpec>
class SparseString;
|
Template Parameters
TSpec |
The specialisation tag. Default: void. |
---|---|
TValueString |
The type of the string containing the values. |
Interface Function Overview
-
void clear(sparseString);
Resets the SparseString. -
bool empty(sparseString);
Returns whether or not the SparseString is empty. -
TFibre getFibre(sparseString, fibreTag);
Returns a specific fibre of a SparseString. -
TValue getValue(sparseString, pos);
Returns the value of a SparseString. -
TSize length(sparseString);
Returns the number of elements in the SparseString. -
bool open(string, fileName[, openMode]);
This functions open a sparse string from disk. -
TSize resize(sparseString, newLength);
Resets the number of elements in the compressed suffix array. -
bool save(string, fileName[, openMode]);
This functions saves a sparse string to disk. -
TReference value(sparseString, pos);
Returns the value of a SparseString.
Interface Functions Detail
void clear(sparseString);
Resets the SparseString.
Parameters
sparseString
|
The SparseString to be cleared. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
bool empty(sparseString);
Returns whether or not the SparseString is empty.
Parameters
sparseString
|
The SparseString to be checked. |
---|
Returns
bool |
true if there are no elements in the sparse string and false otherwise. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
TFibre getFibre(sparseString, fibreTag);
Returns a specific fibre of a SparseString.
Parameters
sparseString
|
The sparseString holding the fibre. |
---|---|
fibreTag
|
A tag that identifies the Fibre. Types: SparseString Fibres |
Returns
TFibre |
A reference to the Fibre object. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
TValue getValue(sparseString, pos);
Returns the value of a SparseString.
Parameters
sparseString
|
The SparseString. |
---|---|
pos
|
The position at which a value should be assign to the sparse string. Types: UnsignedIntegerConcept |
Returns
TValue |
The type GetValue of SparseString is returned. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
TSize length(sparseString);
Returns the number of elements in the SparseString.
Parameters
sparseString
|
The sparse string suffix array. |
---|
Returns
TSize |
The number of elements in the sparse string array. Types: The result of Size of the sparse string. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
bool open(string, fileName[, openMode]);
This functions open a sparse string from disk.
Parameters
string
|
The string to be opened. Types: SparseString |
---|---|
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 resize(sparseString, newLength);
Note.
If the new length is smaller than the actual one then the last x items of the compressed suffix array are deleted with x = oldLength - newLength.
Resets the number of elements in the compressed suffix array.
Parameters
sparseString
|
The sparse string. |
---|---|
newLength
|
The number of elements which should be stored in the sparse string. Types: UnsignedIntegerConcept. |
Returns
TSize |
The number of elements in the sparse string. Types: The result of Size of the sparse string. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.
bool save(string, fileName[, openMode]);
This functions saves a sparse string to disk.
Parameters
string
|
The string to be saved. Types: SparseString |
---|---|
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.
TReference value(sparseString, pos);
Returns the value of a SparseString.
Parameters
sparseString
|
The SparseString. |
---|---|
pos
|
The position at which a value should be assign to the sparse string. Types: UnsignedIntegerConcept |
Returns
TReference |
The type Reference of SparseString is returned. |
---|
Data Races
If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.