82 template <std::ranges::RandomAccessRange text_t, bi_fm_index_traits_concept index_traits_t = bi_fm_index_default_traits>
93 text_t
const * text =
nullptr;
112 using sdsl_index_type =
typename index_traits_t::fm_index_traits::sdsl_index_type;
116 using rev_sdsl_index_type =
typename index_traits_t::rev_fm_index_traits::sdsl_index_type;
121 using sdsl_char_type =
typename sdsl_index_type::alphabet_type::char_type;
165 template <
typename bi_fm_index_t>
168 template <
typename fm_index_t>
221 if (text.begin() == text.end())
222 throw std::invalid_argument(
"The text that is indexed cannot be empty.");
241 void construct(text_t &&) =
delete;
244 void construct(text_t
const &&) =
delete;
259 return fwd_fm.
size();
356 bool load(filesystem::path
const & path)
358 filesystem::path path_fwd{path};
359 filesystem::path path_rev{path};
360 path_fwd += filesystem::path{
".fwd"};
361 path_rev += filesystem::path{
".rev"};
362 return fwd_fm.
load(path_fwd) && rev_fm.
load(path_rev);
377 bool store(filesystem::path
const & path)
const 379 filesystem::path path_fwd{path};
380 filesystem::path path_rev{path};
381 path_fwd += filesystem::path{
".fwd"};
382 path_rev += filesystem::path{
".rev"};
383 return fwd_fm.
store(path_fwd) && rev_fm.
store(path_rev);
Provides seqan3::view::reverse.
bi_fm_index(text_t const &text)
Constructor that immediately constructs the index given a range. The range cannot be an rvalue (i...
Definition: bi_fm_index.hpp:190
text_t text_type
The type of the forward indexed text.
Definition: bi_fm_index.hpp:101
rev_iterator_type rev_begin() const noexcept
Returns a unidirectional seqan3::fm_index_iterator on the reversed text of the bidirectional index th...
Definition: bi_fm_index.hpp:339
bool empty() const noexcept
Checks whether the index is empty.
Definition: bi_fm_index.hpp:273
bool load(filesystem::path const &path)
Loads the index from disk. Temporary function until cereal is supported.
Definition: fm_index.hpp:333
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 t...
Definition: fm_index.hpp:225
decltype(view::reverse(*text)) rev_text_type
The type of the forward indexed text.
Definition: bi_fm_index.hpp:103
Provides the seqan3::bi_fm_index_iterator for searching in the bidirectional seqan3::bi_fm_index.
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 t...
Definition: bi_fm_index.hpp:218
::ranges::size size
Alias for ranges::size. Obtains the size of a range whose size can be calculated in constant time...
Definition: ranges:195
The generic alphabet concept that covers most data types used in ranges.This is the core alphabet con...
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
bool store(filesystem::path const &path) const
Stores the index to disk. Temporary function until cereal is supported.
Definition: bi_fm_index.hpp:377
bool store(filesystem::path const &path) const
Stores the index to disk. Temporary function until cereal is supported.
Definition: fm_index.hpp:356
The SeqAn FM Index Iterator.
Definition: fm_index_iterator.hpp:91
bool load(filesystem::path const &path)
Loads the index from disk. Temporary function until cereal is supported.
Definition: bi_fm_index.hpp:356
fwd_iterator_type fwd_begin() const noexcept
Returns a unidirectional seqan3::fm_index_iterator on the original text of the bidirectional index th...
Definition: bi_fm_index.hpp:321
The default FM Index Configuration.
Definition: fm_index.hpp:87
The default Bidirectional FM Index Configuration.
Definition: bi_fm_index.hpp:64
The concept std::Same<T, U> is satisfied if and only if T and U denote the same type.
size_type size() const noexcept
Returns the length of the indexed text including sentinel characters.
Definition: fm_index.hpp:269
This header includes C++17 filesystem support and imports it into namespace seqan3::filesystem (indep...
iterator_type begin() const noexcept
Returns a seqan3::bi_fm_index_iterator on the index that can be used for searching.
Definition: bi_fm_index.hpp:304
index_traits_t index_traits
The index traits object.
Definition: bi_fm_index.hpp:152
The SeqAn Bidirectional FM Index Iterator.
Definition: bi_fm_index_iterator.hpp:83
Provides various metafunctions used by the range module.
The SeqAn Bidirectional FM Index.
Definition: bi_fm_index.hpp:87
size_type size() const noexcept
Returns the length of the indexed text including sentinel characters.
Definition: bi_fm_index.hpp:257
innermost_value_type_t< text_t > char_type
The type of the underlying character of text_type.
Definition: bi_fm_index.hpp:146
Provides the unidirectional seqan3::fm_index.
constexpr auto reverse
A range adaptor that presents the underlying range in reverse order.
Definition: reverse.hpp:93
typename sdsl_index_type::size_type size_type
Type for representing positions in the indexed text.
Definition: bi_fm_index.hpp:148