SeqAn3
seqan3::bi_fm_index< text_t, index_traits_t > Class Template Reference

The SeqAn Bidirectional FM Index. More...

#include <seqan3/search/fm_index/bi_fm_index.hpp>

Inheritance diagram for seqan3::bi_fm_index< text_t, index_traits_t >:
[legend]

Public Types

using index_traits = index_traits_t
 The index traits object.
 
Text types
using text_type = text_t
 The type of the forward indexed text.
 
using rev_text_type = decltype(view::reverse(*text))
 The type of the forward indexed text.
 
using char_type = innermost_value_type_t< text_t >
 The type of the underlying character of text_type.
 
using size_type = typename sdsl_index_type::size_type
 Type for representing positions in the indexed text.
 
Iterator types
using iterator_type = bi_fm_index_iterator< bi_fm_index< text_t, index_traits_t > >
 The type of the bidirectional iterator.
 
using fwd_iterator_type = fm_index_iterator< fm_index_type >
 The type of the unidirectional iterator on the original text.
 
using rev_iterator_type = fm_index_iterator< rev_fm_index_type >
 The type of the unidirectional iterator on the reversed text.
 

Public Member Functions

iterator_type begin () const noexcept
 Returns a seqan3::bi_fm_index_iterator on the index that can be used for searching. More...
 
void construct (text_t const &text)
 Constructs the index given a range. The range cannot be an rvalue (i.e. a temporary object) and has to be non-empty. More...
 
void construct (text_t &&)=delete
 
void construct (text_t const &&)=delete
 
bool empty () const noexcept
 Checks whether the index is empty. More...
 
fwd_iterator_type fwd_begin () const noexcept
 Returns a unidirectional seqan3::fm_index_iterator on the original text of the bidirectional index that can be used for searching. More...
 
bool load (filesystem::path const &path)
 Loads the index from disk. Temporary function until cereal is supported. More...
 
rev_iterator_type rev_begin () const noexcept
 Returns a unidirectional seqan3::fm_index_iterator on the reversed text of the bidirectional index that can be used for searching. Note that because of the text being reversed, extend_right() resp. cycle_back() correspond to extend_left() resp. cycle_front() on the bidirectional index iterator. More...
 
size_type size () const noexcept
 Returns the length of the indexed text including sentinel characters. More...
 
bool store (filesystem::path const &path) const
 Stores the index to disk. Temporary function until cereal is supported. More...
 
Constructors, destructor and assignment
 bi_fm_index ()=default
 
 bi_fm_index (bi_fm_index const &)=default
 
bi_fm_indexoperator= (bi_fm_index const &)=default
 
 bi_fm_index (bi_fm_index &&)=default
 
bi_fm_indexoperator= (bi_fm_index &&)=default
 
 ~bi_fm_index ()=default
 
 bi_fm_index (text_t const &text)
 Constructor that immediately constructs the index given a range. The range cannot be an rvalue (i.e. a temporary object) and has to be non-empty. More...
 
 bi_fm_index (text_t &&)=delete
 
 bi_fm_index (text_t const &&)=delete
 

Friends

template<typename bi_fm_index_t >
class bi_fm_index_iterator
 
template<typename fm_index_t >
class fm_index_iterator
 

Detailed Description

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
class seqan3::bi_fm_index< text_t, index_traits_t >

The SeqAn Bidirectional FM Index.

Template Parameters
text_tThe type of the text to be indexed; must model std::ranges::RandomAccessRange.
bi_fm_index_traitsThe traits determining the implementation of the underlying SDSL indices; must model seqan3::bi_fm_index_traits_concept.
Todo:
write me

Constructor & Destructor Documentation

◆ bi_fm_index() [1/3]

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
seqan3::bi_fm_index< text_t, index_traits_t >::bi_fm_index ( text_t const &  text)
inline

Constructor that immediately constructs the index given a range. The range cannot be an rvalue (i.e. a temporary object) and has to be non-empty.

Template Parameters
text_tThe type of range to construct from; must model std::ranges::RandomAccessRange.
Parameters
[in]textThe text to construct from.

Complexity

Todo:
At least linear.

◆ bi_fm_index() [2/3]

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
seqan3::bi_fm_index< text_t, index_traits_t >::bi_fm_index ( text_t &&  )
delete

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ bi_fm_index() [3/3]

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
seqan3::bi_fm_index< text_t, index_traits_t >::bi_fm_index ( text_t const &&  )
delete

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

◆ begin()

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
iterator_type seqan3::bi_fm_index< text_t, index_traits_t >::begin ( ) const
inlinenoexcept

Returns a seqan3::bi_fm_index_iterator on the index that can be used for searching.

Returns
Returns a bidirectional seqan3::bi_fm_index_iterator on the index.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ construct() [1/3]

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
void seqan3::bi_fm_index< text_t, index_traits_t >::construct ( text_t const &  text)
inline

Constructs the index given a range. The range cannot be an rvalue (i.e. a temporary object) and has to be non-empty.

Template Parameters
text_tThe type of range to construct from; must model std::ranges::RandomAccessRange.
Parameters
[in]textThe text to construct from.
Todo:
This has to be better implemented with regard to the memory peak due to not matching interfaces with the SDSL.

Complexity

Todo:
At least linear.

Exceptions

No guarantee.

Todo:
Ensure strong exception guarantee.

◆ construct() [2/3]

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
void seqan3::bi_fm_index< text_t, index_traits_t >::construct ( text_t &&  )
delete

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ construct() [3/3]

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
void seqan3::bi_fm_index< text_t, index_traits_t >::construct ( text_t const &&  )
delete

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ empty()

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
bool seqan3::bi_fm_index< text_t, index_traits_t >::empty ( ) const
inlinenoexcept

Checks whether the index is empty.

Returns
true if the index is empty, false otherwise.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ fwd_begin()

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
fwd_iterator_type seqan3::bi_fm_index< text_t, index_traits_t >::fwd_begin ( ) const
inlinenoexcept

Returns a unidirectional seqan3::fm_index_iterator on the original text of the bidirectional index that can be used for searching.

Returns
Returns a unidirectional seqan3::fm_index_iterator on the index of the original text.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ load()

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
bool seqan3::bi_fm_index< text_t, index_traits_t >::load ( filesystem::path const &  path)
inline

Loads the index from disk. Temporary function until cereal is supported.

Todo:
cereal
Returns
true if the index was successfully loaded from disk.

Complexity

Linear.

Exceptions

Strong exception guarantee.

◆ rev_begin()

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
rev_iterator_type seqan3::bi_fm_index< text_t, index_traits_t >::rev_begin ( ) const
inlinenoexcept

Returns a unidirectional seqan3::fm_index_iterator on the reversed text of the bidirectional index that can be used for searching. Note that because of the text being reversed, extend_right() resp. cycle_back() correspond to extend_left() resp. cycle_front() on the bidirectional index iterator.

Returns
Returns a unidirectional seqan3::fm_index_iterator on the index of the reversed text.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ size()

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
size_type seqan3::bi_fm_index< text_t, index_traits_t >::size ( ) const
inlinenoexcept

Returns the length of the indexed text including sentinel characters.

Returns
Returns the length of the indexed text including sentinel characters.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ store()

template<std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
bool seqan3::bi_fm_index< text_t, index_traits_t >::store ( filesystem::path const &  path) const
inline

Stores the index to disk. Temporary function until cereal is supported.

Todo:
cereal
Returns
true if the index was successfully stored to disk.

Complexity

Linear.

Exceptions

Strong exception guarantee.


The documentation for this class was generated from the following file: