24 namespace seqan3::detail
26 template <
typename word_t,
typename score_t,
bool is_semi_global,
bool use_max_errors>
27 class edit_distance_score_matrix_full;
29 template <
typename word_t,
bool is_semi_global,
bool use_max_errors>
30 class edit_distance_trace_matrix_full;
33 template <
typename state_t,
typename ...>
38 template <
bool enabled,
typename state_t>
45 template <
bool B,
template <
typename ...>
typename T,
template <
typename ...>
typename F>
49 template <
typename ...args_t>
57 template <std::ranges::viewable_range database_t,
58 std::ranges::viewable_range query_t,
59 typename align_config_t,
60 typename is_semi_global_t,
61 typename word_t = uint_fast64_t>
62 struct default_edit_distance_trait_type
67 using word_type = word_t;
68 static_assert(std::is_unsigned_v<word_type>,
"the word type of edit_distance_unbanded must be unsigned.");
70 static_assert(align_config_type::template exists<align_cfg::result>(),
"We assume the result type was configured.");
72 decltype(get<align_cfg::result>(align_config_type{}))>::score_type;
79 static constexpr uint8_t word_size = sizeof_bits<word_type>;
80 static_assert(sizeof_bits<word_type> <= 64u,
"we assume at most uint64_t as word_type");
83 using database_iterator = std::ranges::iterator_t<database_type>;
87 using result_value_type =
typename align_result_selector<database_type, query_type, align_config_type>::type;
91 static constexpr
bool use_max_errors = align_config_type::template exists<align_cfg::max_error>();
93 static constexpr
bool is_semi_global = is_semi_global_t::value;
95 static constexpr
bool is_global = !is_semi_global;
97 static constexpr
bool compute_score =
true;
99 static constexpr
bool compute_back_coordinate = !
std::same_as<decltype(result_value_type{}.back_coordinate),
102 static constexpr
bool compute_front_coordinate = !
std::same_as<decltype(result_value_type{}.front_coordinate),
105 static constexpr
bool compute_sequence_alignment = !
std::same_as<decltype(result_value_type{}.alignment),
108 static constexpr
bool compute_score_matrix =
false;
110 static constexpr
bool compute_trace_matrix = compute_front_coordinate || compute_sequence_alignment;
112 static constexpr
bool compute_matrix = compute_score_matrix || compute_trace_matrix;
115 using trace_matrix_type = edit_distance_trace_matrix_full<word_type, is_semi_global, use_max_errors>;
117 using score_matrix_type = edit_distance_score_matrix_full<word_type, score_type, is_semi_global, use_max_errors>;
121 template <
bool enable_policy,
122 template <
typename ...>
typename policy_t,
123 typename edit_traits,
125 using edit_distance_base =
126 invoke_deferred_crtp_base<deferred_crtp_base<selector<enable_policy, policy_t, empty_state>::template select,
131 template <std::ranges::viewable_range database_t,
132 std::ranges::viewable_range query_t,
133 typename align_config_t,
134 typename traits_t = default_edit_distance_trait_type<database_t, query_t, align_config_t, std::false_type>>
135 class edit_distance_unbanded;