SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
scoring_scheme_policy.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 
18 
19 namespace seqan3::detail
20 {
21 
32 template <typename alignment_algorithm_t, typename scoring_scheme_t>
33 class scoring_scheme_policy
34 {
35 private:
37  friend alignment_algorithm_t;
38 
43  constexpr scoring_scheme_policy() = default;
45  constexpr scoring_scheme_policy(scoring_scheme_policy const &) = default;
47  constexpr scoring_scheme_policy(scoring_scheme_policy &&) = default;
49  constexpr scoring_scheme_policy & operator=(scoring_scheme_policy const &) = default;
51  constexpr scoring_scheme_policy & operator=(scoring_scheme_policy &&) = default;
53  ~scoring_scheme_policy() = default;
54 
56  template <typename configuration_t>
57  scoring_scheme_policy(configuration_t const & /*config*/)
58  {}
60 
62  scoring_scheme_t scoring_scheme{};
63 
74  template <typename alphabet_t>
76  requires simd_concept<std::remove_cvref_t<alphabet_t>>
78  auto scoring_scheme_profile_column(alphabet_t && alphabet) const noexcept
79  {
80  return scoring_scheme.make_score_profile(std::forward<alphabet_t>(alphabet));
81  }
82 
84  template <semialphabet alphabet_t>
85  alphabet_t scoring_scheme_profile_column(alphabet_t && alphabet) const
86  noexcept
87  {
88  return std::forward<alphabet_t>(alphabet);
89  }
90 };
91 
92 } // namespace seqan3::detail
Core alphabet concept and free function/type trait wrappers.
The generic alphabet concept that covers most data types used in ranges.
Provides seqan3::simd::simd_concept.
Provides various type traits on generic types.