SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
edit_distance_algorithm.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2019, 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 
16 
17 namespace seqan3::detail
18 {
19 
34 template <typename config_t, typename traits_t>
35 class edit_distance_algorithm
36 {
37 public:
41  constexpr edit_distance_algorithm() = default;
42  constexpr edit_distance_algorithm(edit_distance_algorithm const &) = default;
43  constexpr edit_distance_algorithm(edit_distance_algorithm &&) = default;
44  constexpr edit_distance_algorithm & operator=(edit_distance_algorithm const &) = default;
45  constexpr edit_distance_algorithm & operator=(edit_distance_algorithm &&) = default;
46  ~edit_distance_algorithm() = default;
47 
59  constexpr edit_distance_algorithm(config_t const & cfg) : cfg_ptr{new config_t(cfg)}
60  {}
62 
70  template <std::ranges::ForwardRange first_range_t, std::ranges::ForwardRange second_range_t>
71  constexpr auto operator()(size_t const idx, first_range_t && first_range, second_range_t && second_range)
72  {
73  using edit_traits = default_edit_distance_trait_type<first_range_t,
74  second_range_t,
75  config_t,
76  typename traits_t::is_semi_global_type>;
77  edit_distance_unbanded algo{first_range, second_range, *cfg_ptr, edit_traits{}};
78  return algo(idx);
79  }
80 
81 private:
84 };
85 
86 } // namespace seqan3::detail
Definition: aligned_sequence_concept.hpp:35
Provides a pairwise alignment algorithm for edit distance but without band.