The SeqAn FM Index Iterator. More...
#include <seqan3/search/fm_index/fm_index_iterator.hpp>
Public Member Functions | |
size_type | count () const noexcept |
Counts the number of occurrences of the searched query in the text. More... | |
bool | cycle_back () noexcept |
Tries to replace the rightmost character of the query by the next lexicographically larger character such that the query is found in the text. More... | |
bool | extend_right () noexcept |
Tries to extend the query by the smallest possible character to the right such that the query is found in the text. More... | |
template<alphabet_concept char_t> | |
bool | extend_right (char_t const c) noexcept |
Tries to extend the query by the character c to the right. More... | |
template<std::ranges::RandomAccessRange seq_t> | |
bool | extend_right (seq_t &&seq) noexcept |
Tries to extend the query by seq to the right. More... | |
index_t::char_type | last_char () noexcept |
Outputs the rightmost character. More... | |
auto | lazy_locate () const |
Locates the occurrences of the searched query in the text on demand, i.e. a ranges::view is returned and every position is located once it is accessed. More... | |
std::vector< size_type > | locate () const |
Locates the occurrences of the searched query in the text. More... | |
bool | operator!= (fm_index_iterator const &rhs) const noexcept |
Compares two iterators. More... | |
auto | operator* () const noexcept |
Returns the searched query. More... | |
bool | operator== (fm_index_iterator const &rhs) const noexcept |
Compares two iterators. More... | |
auto | query () const noexcept |
Returns the searched query. More... | |
size_type | query_length () const noexcept |
Returns the length of the searched query. More... | |
Constructors, destructor and assignment | |
fm_index_iterator () noexcept=default | |
Default constructor. Accessing member functions on a default constructed object is undefined behavior. | |
fm_index_iterator (fm_index_iterator const &) noexcept=default | |
fm_index_iterator & | operator= (fm_index_iterator const &) noexcept=default |
fm_index_iterator (fm_index_iterator &&) noexcept=default | |
fm_index_iterator & | operator= (fm_index_iterator &&) noexcept=default |
fm_index_iterator (index_t const &_index) noexcept | |
Friends | |
template<typename _index_t > | |
class | bi_fm_index_iterator |
Member types | |
using | index_type = index_t |
Type of the index. | |
using | size_type = typename index_type::size_type |
Type for representing positions in the indexed text. | |
The SeqAn FM Index Iterator.
index_t | The type of the underlying index; must model seqan3::fm_index_concept. |
The iterator's interface provides searching a string from left to right in the indexed text. All methods modifying the iterator (e.g. extending by a character with extend_right()) return a bool
value whether the operation was successful or not. In case of an unsuccessful operation the iterator remains unmodified, i.e. an iterator can never be in an invalid state except default constructed iterators that are always invalid.
The asymptotic running times for using the iterator depend on the SDSL index configuration. To determine the exact running times, you have to additionally look up the running times of the used traits (configuration).
|
inlinenoexcept |
Counts the number of occurrences of the searched query in the text.
Constant.
No-throw guarantee.
|
inlinenoexcept |
Tries to replace the rightmost character of the query by the next lexicographically larger character such that the query is found in the text.
true
if there exists a query in the text where the rightmost character of the query is lexicographically larger than the current rightmost character of the query.Example:
It scans linearly over the alphabet starting from the rightmost character until it finds the query with a larger rightmost character.
No-throw guarantee.
|
inlinenoexcept |
Tries to extend the query by the smallest possible character to the right such that the query is found in the text.
true
if the iterator could extend the query successfully.It scans linearly over the alphabet until it finds the smallest character that is represented by an edge.
No-throw guarantee.
|
inlinenoexcept |
Tries to extend the query by the character c
to the right.
char_t | Type of the character needs to be convertible to the character type char_type of the indexed text. |
[in] | c | Character to extend the query with to the right. |
true
if the iterator could extend the query successfully.No-throw guarantee.
|
inlinenoexcept |
Tries to extend the query by seq
to the right.
seq_t | The type of range of the sequence to search; must model std::ranges::RandomAccessRange. |
[in] | seq | Sequence to extend the query with to the right. |
true
if the iterator could extend the query successfully.If extending fails in the middle of the sequence, all previous computations are rewound to restore the iterator's state before calling this method.
No-throw guarantee.
|
inlinenoexcept |
Outputs the rightmost character.
Example:
Constant.
No-throw guarantee.
|
inline |
Locates the occurrences of the searched query in the text on demand, i.e. a ranges::view is returned and every position is located once it is accessed.
Strong exception guarantee (no data is modified in case an exception is thrown).
|
inline |
Locates the occurrences of the searched query in the text.
Strong exception guarantee (no data is modified in case an exception is thrown).
|
inlinenoexcept |
Compares two iterators.
[in] | rhs | Other iterator to compare it to. |
true
if the iterators are not equal, false
otherwise.Constant.
No-throw guarantee.
|
inlinenoexcept |
Returns the searched query.
No-throw guarantee.
|
inlinenoexcept |
Compares two iterators.
[in] | rhs | Other iterator to compare it to. |
true
if both iterators are equal, false
otherwise.Constant.
No-throw guarantee.
|
inlinenoexcept |
Returns the searched query.
No-throw guarantee.
|
inlinenoexcept |
Returns the length of the searched query.
Constant.
No-throw guarantee.