SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::hamming_scoring_scheme Class Reference

A scoring scheme that assigns a score of 0 to matching letters and -1 to mismatching letters. More...

#include <seqan3/alignment/scoring/hamming_scoring_scheme.hpp>

Public Types

using score_type = int32_t
 The underlying score type.
 

Public Member Functions

Constructors, destructor and assignment
 hamming_scoring_scheme () noexcept=default
 Defaulted.
 
 hamming_scoring_scheme (hamming_scoring_scheme const &)=default
 Defaulted.
 
 hamming_scoring_scheme (hamming_scoring_scheme &&) noexcept=default
 Defaulted.
 
hamming_scoring_schemeoperator= (hamming_scoring_scheme const &)=default
 Defaulted.
 
hamming_scoring_schemeoperator= (hamming_scoring_scheme &&) noexcept=default
 Defaulted.
 
 ~hamming_scoring_scheme ()=default
 
Accessors
template<typename alph1_t , typename alph2_t >
requires std::equality_comparable_with<alph1_t, alph2_t>
constexpr score_type score (alph1_t const alph1, alph2_t const alph2) const noexcept
 Returns the score of two letters.
 
Comparison operators
constexpr bool operator== (hamming_scoring_scheme const &) const noexcept
 Always true.
 
constexpr bool operator!= (hamming_scoring_scheme const &) const noexcept
 Always false.
 

Detailed Description

A scoring scheme that assigns a score of 0 to matching letters and -1 to mismatching letters.

This stateless scoring scheme is equivalent to the Hamming distance and assigns a score of 0 to matching letters and -1 to mismatching letters. This scheme is independent of the alphabet type and can be used whenever the two compared alphabets model the std::equality_comparable_with concept. Use this scheme if you want to use the use the more efficient bitparallel alignment algorithm often used in the context of computing the edit distance. See the documentation for seqan3::align_cfg::edit_scheme for more details.

Constructor & Destructor Documentation

◆ ~hamming_scoring_scheme()

seqan3::hamming_scoring_scheme::~hamming_scoring_scheme ( )
default

Defaulted.

Member Function Documentation

◆ score()

template<typename alph1_t , typename alph2_t >
requires std::equality_comparable_with<alph1_t, alph2_t>
constexpr score_type seqan3::hamming_scoring_scheme::score ( alph1_t const  alph1,
alph2_t const  alph2 
) const
inlineconstexprnoexcept

Returns the score of two letters.

Template Parameters
alph1_tThe type of the first letter.
alph2_tThe type of the second letter.
Parameters
[in]alph1The first letter to compare.
[in]alph2The second letter to compare.

This function returns 0 if the two letters are equal and -1 otherwise. Note that both alphabet types of the compared letters must model the std::equality_comparable_with concept or no overload of this function is available.

Returns
The score of the two letters. 0 if the letters are equal, -1 otherwise.

The documentation for this class was generated from the following file:
Hide me