54 struct search_config_max_error
57 std::tuple<uint8_t, uint8_t, uint8_t, uint8_t> value;
63 struct search_config_max_error_adaptor :
public configuration_fn_base<search_config_max_error_adaptor>
71 template <
typename error_type_t,
typename out_t,
typename ... error_types_t>
72 constexpr
void get_type_out(out_t & out, std::tuple<error_types_t...>
const & in)
const 74 constexpr
auto count = meta::count<meta::list<error_types_t...>, error_type_t>::value;
75 static_assert(count <= 1,
"The same error type has been passed multiple times to max_error.");
76 if constexpr (count > 0)
77 std::
get<error_type_t>(out) =
std::
get<error_type_t>(in);
87 template <typename configuration_t, typename ... error_types_t>
89 requires is_algorithm_configuration_v<
remove_cvref_t<configuration_t>>
91 constexpr auto invoke(configuration_t && cfg, error_types_t && ...error_types)
const 96 std::tuple in{error_types...};
97 std::tuple<search_cfg::total<uint8_t>, search_cfg::substitution<uint8_t>,
98 search_cfg::insertion<uint8_t>, search_cfg::deletion<uint8_t>> out{0, 0, 0, 0};
100 get_type_out<search_cfg::total<uint8_t>>(out, in);
101 get_type_out<search_cfg::substitution<uint8_t>>(out, in);
102 get_type_out<search_cfg::insertion<uint8_t>>(out, in);
103 get_type_out<search_cfg::deletion<uint8_t>>(out, in);
105 using error_types_list_t = meta::list<remove_cvref_t<error_types_t>...>;
106 constexpr
bool total_set = meta::in<error_types_list_t, search_cfg::total<uint8_t>>::value;
107 constexpr
bool other_error_types_set = meta::count<error_types_list_t, search_cfg::total<uint8_t>>::value !=
108 meta::size<error_types_list_t>::value;
111 if constexpr (!other_error_types_set)
114 if constexpr (total_set)
116 uint8_t
const total_v{std::get<0>(out)};
117 std::get<1>(out) = search_cfg::substitution<uint8_t>{total_v};
118 std::get<2>(out) = search_cfg::insertion<uint8_t>{total_v};
119 std::get<3>(out) = search_cfg::deletion<uint8_t>{total_v};
123 else if constexpr (!total_set)
125 uint8_t
const substitution_error =
static_cast<uint8_t
>(std::get<1>(out));
126 uint8_t
const insertion_error =
static_cast<uint8_t
>(std::get<2>(out));
127 uint8_t
const deletion_error =
static_cast<uint8_t
>(std::get<3>(out));
129 std::get<0>(out) = search_cfg::total<uint8_t>{std::min<uint8_t>(255, substitution_error
134 search_config_max_error tmp{
static_cast<std::tuple<uint8_t, uint8_t, uint8_t, uint8_t>
>(out)};
135 return std::forward<configuration_t>(cfg).push_front(std::move(tmp));
145 template <config_element_concept t>
146 using invoke =
typename std::is_same<t, search_config_max_error>::type;
152 struct search_config_type_to_id<search_config_max_error>
168 inline constexpr detail::search_config_max_error_adaptor max_error;
Provides the error types for maximum number of errors.
Provides functionality to access get function by enum values.
Provides seqan3::type_list and auxiliary metafunctions.
SeqAn specific customisations in the standard namespace.
Definition: align_result.hpp:221
A special sub namespace for the search configurations.
constexpr auto const & get(detail::configuration< cfg_elements_t... > const &cfg) noexcept
Definition: utility.hpp:364
id
Specifies an id for every configuration element.
Definition: utility.hpp:68
Definition: aligned_sequence_concept.hpp:288
Provides various metafunctions on generic types.
Meta-Header for components of the algorithm submodule.
constexpr detail::search_config_max_error_adaptor max_error
A configuration element for the maximum number of errors across all error types (mismatches, insertions, deletions). This is an upper bound of errors independent from error numbers of specific error types.
Definition: max_error.hpp:168
Identifier for max_errors configuration.