SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
max_error_common.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 
17 #include <seqan3/std/concepts>
18 
19 namespace seqan3::search_cfg
20 {
21 
26 template <typename value_t>
28  requires arithmetic<value_t>
30 struct total : detail::strong_type<value_t, total<value_t>, detail::strong_type_skill::convert>
31 {
32  using detail::strong_type<value_t, total<value_t>, detail::strong_type_skill::convert>::strong_type;
33 
36  static constexpr std::integral_constant<uint8_t, 0> _id{};
37 };
38 
43 template <std::integral value_t>
45 total(value_t) -> total<uint8_t>;
46 
48 template <typename value_t>
52 total(value_t) -> total<double>;
54 
60 template <typename value_t>
62  requires arithmetic<value_t>
64 struct substitution : detail::strong_type<value_t, substitution<value_t>, detail::strong_type_skill::convert>
65 {
66  using detail::strong_type<value_t, substitution<value_t>, detail::strong_type_skill::convert>::strong_type;
67 
70  static constexpr std::integral_constant<uint8_t, 1> _id{};
71 };
72 
77 template <std::integral value_t>
80 
82 template <typename value_t>
88 
93 template <typename value_t>
95  requires arithmetic<value_t>
97 struct insertion : detail::strong_type<value_t, insertion<value_t>, detail::strong_type_skill::convert>
98 {
99  using detail::strong_type<value_t, insertion<value_t>, detail::strong_type_skill::convert>::strong_type;
100 
103  static constexpr std::integral_constant<uint8_t, 2> _id{};
104 };
105 
110 template <std::integral value_t>
112 insertion(value_t) -> insertion<uint8_t>;
113 
115 template <typename value_t>
117  requires floating_point<value_t>
119 insertion(value_t) -> insertion<double>;
121 
126 template <typename value_t>
128  requires arithmetic<value_t>
130 struct deletion : detail::strong_type<value_t, deletion<value_t>, detail::strong_type_skill::convert>
131 {
132  using detail::strong_type<value_t, deletion<value_t>, detail::strong_type_skill::convert>::strong_type;
133 
136  static constexpr std::integral_constant<uint8_t, 3> _id{};
137 };
138 
143 template <std::integral value_t>
145 deletion(value_t) -> deletion<uint8_t>;
146 
148 template <typename value_t>
150  requires floating_point<value_t>
152 deletion(value_t) -> deletion<double>;
154 
155 } // namespace seqan3::search_cfg
std::integral_constant< uint8_t, 0 >
strong_type.hpp
Provides basic data structure for strong types.
seqan3::search_cfg::deletion
A strong type of underlying type uint8_t or double that represents the number or rate of deletions.
Definition: max_error_common.hpp:130
floating_point
An arithmetic type that also satisfies std::is_floating_point_v<t>.
concepts
The Concepts library.
seqan3::search_cfg
A special sub namespace for the search configurations.
core_language.hpp
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
seqan3::search_cfg::substitution
A strong type of underlying type uint8_t or double that represents the number or rate of substitution...
Definition: max_error_common.hpp:64
seqan3::search_cfg::total
A strong type of underlying type uint8_t or double that represents the number or rate of total errors...
Definition: max_error_common.hpp:30
seqan3::search_cfg::insertion
A strong type of underlying type uint8_t or double that represents the number or rate of insertions.
Definition: max_error_common.hpp:97
arithmetic
A type that satisfies std::is_arithmetic_v<t>.