SeqAn3 3.1.0
The Modern C++ library for sequence analysis.
concept.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 <seqan3/std/concepts>
16#include <type_traits>
17
18#include <sdsl/suffix_arrays.hpp>
19
21
22namespace seqan3::detail
23{
24
25// ============================================================================
26// sdsl_index
27// ============================================================================
28
34template <typename t>
35SEQAN3_CONCEPT sdsl_index = requires (t sdsl_index)
36{
37 typename t::size_type;
38
39 SEQAN3_RETURN_TYPE_CONSTRAINT(sdsl_index.size(), std::same_as, typename t::size_type);
40 { sdsl_index[0] }; // suffix array access
41 SEQAN3_RETURN_TYPE_CONSTRAINT(sdsl_index.comp2char[0], std::same_as, uint8_t);
42 SEQAN3_RETURN_TYPE_CONSTRAINT(sdsl_index.char2comp[0], std::same_as, uint8_t);
43 { sdsl_index.sigma };
44 { sdsl_index.C[0] };
45
46 requires requires (t sdsl_index, typename t::char_type const c, typename t::size_type const lb,
47 typename t::size_type const rb, sdsl::int_vector<8> const text)
48 {
49 { sdsl_index.bwt.rank(lb, c) };
50 { sdsl_index.wavelet_tree.lex_count(lb, rb, c) };
51 { sdsl::construct_im(sdsl_index, text, 0) };
52 };
53};
55
65} // namespace seqan3::detail
66
67namespace seqan3
68{
71enum text_layout : bool
72{
77};
78
79} // namespace seqan3
The <concepts> header from C++20's standard library.
text_layout
The possible text layouts (single, collection) the seqan3::fm_index and seqan3::bi_fm_index can suppo...
Definition: concept.hpp:72
@ single
The text is a single range.
Definition: concept.hpp:74
@ collection
The text is a range of ranges.
Definition: concept.hpp:76
The main SeqAn3 namespace.
Definition: cigar_operation_table.hpp:2
Provides platform and dependency checks.
#define SEQAN3_RETURN_TYPE_CONSTRAINT(expression, concept_name,...)
Same as writing {expression} -> concept_name<type1[, ...]> in a concept definition.
Definition: platform.hpp:57