SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
hamming_scoring_scheme.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <concepts>
13
14namespace seqan3
15{
16
31{
32public:
35 using alphabet_type = char;
37
39 using score_type = int32_t;
40
44 hamming_scoring_scheme() noexcept = default;
46
65 template <typename alph1_t, typename alph2_t>
66 requires std::equality_comparable_with<std::remove_reference_t<alph1_t>, std::remove_reference_t<alph2_t>>
67 constexpr score_type score(alph1_t const alph1, alph2_t const alph2) const noexcept
68 {
69 return alph1 == alph2 ? 0 : -1;
70 }
72
75
77 constexpr bool operator==(hamming_scoring_scheme const &) const noexcept
78 {
79 return true;
80 }
81
83 constexpr bool operator!=(hamming_scoring_scheme const &) const noexcept
84 {
85 return false;
86 }
88};
89
90} // namespace seqan3
A scoring scheme that assigns a score of 0 to matching letters and -1 to mismatching letters.
Definition hamming_scoring_scheme.hpp:31
int32_t score_type
The underlying score type.
Definition hamming_scoring_scheme.hpp:39
constexpr score_type score(alph1_t const alph1, alph2_t const alph2) const noexcept
Returns the score of two letters.
Definition hamming_scoring_scheme.hpp:67
constexpr bool operator==(hamming_scoring_scheme const &) const noexcept
Always true.
Definition hamming_scoring_scheme.hpp:77
char alphabet_type
The alphabet type of the scoring scheme. This type is only used for the alignment configuration machi...
Definition hamming_scoring_scheme.hpp:35
constexpr bool operator!=(hamming_scoring_scheme const &) const noexcept
Always false.
Definition hamming_scoring_scheme.hpp:83
hamming_scoring_scheme() noexcept=default
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
Hide me