SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
concept.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, 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 <type_traits>
16 
17 #include <sdsl/suffix_arrays.hpp>
18 
20 #include <seqan3/range/concept.hpp>
22 
23 namespace seqan3::detail
24 {
25 
30  // ============================================================================
31  // sdsl_index
32  // ============================================================================
33 
38 template <typename t>
39 SEQAN3_CONCEPT sdsl_index = requires (t sdsl_index)
40 {
41  typename t::size_type;
42 
43  SEQAN3_RETURN_TYPE_CONSTRAINT(sdsl_index.size(), std::same_as, typename t::size_type);
44  { sdsl_index[0] }; // suffix array access
45  SEQAN3_RETURN_TYPE_CONSTRAINT(sdsl_index.comp2char[0], std::same_as, uint8_t);
46  SEQAN3_RETURN_TYPE_CONSTRAINT(sdsl_index.char2comp[0], std::same_as, uint8_t);
47  { sdsl_index.sigma };
48  { sdsl_index.C[0] };
49 
50  requires requires (t sdsl_index, typename t::char_type const c, typename t::size_type const lb,
51  typename t::size_type const rb, sdsl::int_vector<8> const text)
52  {
53  { sdsl_index.bwt.rank(lb, c) };
54  { sdsl_index.wavelet_tree.lex_count(lb, rb, c) };
55  { sdsl::construct_im(sdsl_index, text, 0) };
56  };
57 };
59 
70 
71 } // namespace seqan3::detail
72 
73 namespace seqan3
74 {
75 
81 enum text_layout : bool
82 {
87 };
88 
89 } // namespace seqan3
Provides various transformation traits used by the range module.
text_layout
The possible text layouts (single, collection) the seqan3::fm_index and seqan3::bi_fm_index can suppo...
Definition: concept.hpp:82
@ single
The text is a single range.
Definition: concept.hpp:84
@ collection
The text is a range of ranges.
Definition: concept.hpp:86
Concept for SDSL FM indices (which are called compressed suffix arrays in the SDSL).
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
#define SEQAN3_RETURN_TYPE_CONSTRAINT(expression, concept_name,...)
Same as writing {expression} -> concept_name<type1[, ...]> in a concept definition.
Definition: platform.hpp:57
Additional non-standard concepts for ranges.
Adaptations of concepts from the standard library.