SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
detail/fm_index_cursor.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <tuple>
13#include <type_traits>
14
16
17namespace seqan3::detail
18{
19
25template <typename index_t>
27{
29 using size_type = typename index_t::size_type;
33 using sdsl_char_type = typename index_t::sdsl_char_type;
34
43
45 bool operator==(fm_index_cursor_node const & rhs) const
46 {
47 // NOTE: last_char is implementation specific for cycle_back().
48 // lb, rb and depth already determine the node in the suffix tree.
49 // Thus there is no need to compare last_char.
50 return std::tie(lb, rb, depth) == std::tie(rhs.lb, rhs.rb, rhs.depth);
51 }
52
54 bool operator!=(fm_index_cursor_node const & rhs) const
55 {
56 return !(*this == rhs);
57 }
58
66 template <cereal_archive archive_t>
67 void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
68 {
69 archive(lb);
70 archive(rb);
71 archive(depth);
72 archive(last_char);
73 }
75};
76
77} // namespace seqan3::detail
Adaptions of concepts from the Cereal library.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
#define CEREAL_SERIALIZE_FUNCTION_NAME
Macro for Cereal's serialize function.
Definition platform.hpp:163
Internal representation of the node of an FM index cursor.
Definition detail/fm_index_cursor.hpp:27
size_type rb
Right suffix array bound.
Definition detail/fm_index_cursor.hpp:38
bool operator==(fm_index_cursor_node const &rhs) const
Comparison of two cursor nodes.
Definition detail/fm_index_cursor.hpp:45
sdsl_char_type last_char
Label of the last edge moved down. Needed for cycle_back().
Definition detail/fm_index_cursor.hpp:42
bool operator!=(fm_index_cursor_node const &rhs) const
Comparison of two cursor nodes.
Definition detail/fm_index_cursor.hpp:54
typename index_t::size_type size_type
Type for representing positions in the indexed text.
Definition detail/fm_index_cursor.hpp:29
typename index_t::sdsl_char_type sdsl_char_type
The type of the reduced alphabet type. (The reduced alphabet might be smaller than the original alpha...
Definition detail/fm_index_cursor.hpp:33
size_type depth
Depth of the node in the suffix tree, i.e. length of the searched query.
Definition detail/fm_index_cursor.hpp:40
size_type lb
Left suffix array bound.
Definition detail/fm_index_cursor.hpp:36
T tie(T... args)
Hide me