SeqAn3  3.1.0-rc.1
The Modern C++ library for sequence analysis.
fm_index_cursor.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <tuple>
16 #include <type_traits>
17 
19 
20 namespace seqan3::detail
21 {
22 
28 template <typename index_t>
30 {
32  using size_type = typename index_t::size_type;
36  using sdsl_char_type = typename index_t::sdsl_char_type;
37 
46 
48  bool operator==(fm_index_cursor_node const & rhs) const
49  {
50  // NOTE: last_char is implementation specific for cycle_back().
51  // lb, rb and depth already determine the node in the suffix tree.
52  // Thus there is no need to compare last_char.
53  return std::tie(lb, rb, depth) == std::tie(rhs.lb, rhs.rb, rhs.depth);
54  }
55 
57  bool operator!=(fm_index_cursor_node const & rhs) const
58  {
59  return !(*this == rhs);
60  }
61 
69  template <cereal_archive archive_t>
70  void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
71  {
72  archive(lb);
73  archive(rb);
74  archive(depth);
75  archive(last_char);
76  }
78 };
79 
80 }
Adaptions of concepts from the Cereal library.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
#define CEREAL_SERIALIZE_FUNCTION_NAME
Macro for Cereal's serialize function.
Definition: platform.hpp:134
Internal representation of the node of an FM index cursor.
Definition: fm_index_cursor.hpp:30
size_type rb
Right suffix array bound.
Definition: fm_index_cursor.hpp:41
bool operator==(fm_index_cursor_node const &rhs) const
Comparison of two cursor nodes.
Definition: fm_index_cursor.hpp:48
sdsl_char_type last_char
Label of the last edge moved down. Needed for cycle_back().
Definition: fm_index_cursor.hpp:45
bool operator!=(fm_index_cursor_node const &rhs) const
Comparison of two cursor nodes.
Definition: fm_index_cursor.hpp:57
typename index_t::size_type size_type
Type for representing positions in the indexed text.
Definition: fm_index_cursor.hpp:32
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: fm_index_cursor.hpp:36
size_type depth
Depth of the node in the suffix tree, i.e. length of the searched query.
Definition: fm_index_cursor.hpp:43
size_type lb
Left suffix array bound.
Definition: fm_index_cursor.hpp:39
T tie(T... args)