60 template <arithmetic_concept score_type>
61 struct gap_score : detail::strong_type<score_type, gap_score<score_type>, detail::strong_type_skill::convert>
63 using detail::strong_type<score_type, gap_score<score_type>, detail::strong_type_skill::convert>::strong_type;
70 template <arithmetic_concept score_type>
84 template <arithmetic_concept score_type>
85 struct gap_open_score : detail::strong_type<score_type, gap_open_score<score_type>, detail::strong_type_skill::convert>
87 using detail::strong_type<score_type, gap_open_score<score_type>, detail::strong_type_skill::convert>::strong_type;
94 template <arithmetic_concept score_type>
106 template <arithmetic_concept score_t =
int8_t>
131 template <arithmetic_concept score_arg_t>
140 template <arithmetic_concept score_arg_t>
164 template <arithmetic_concept score_arg_t>
167 std::conditional_t<std::Integral<score_t>, int64_t,
double> i_g =
static_cast<score_arg_t
>(g);
168 std::conditional_t<std::Integral<score_t>, int64_t,
double> i_go =
static_cast<score_arg_t
>(go);
169 if ((i_g < std::numeric_limits<score_t>::lowest() || i_g > std::numeric_limits<score_t>::max()) ||
170 (i_go < std::numeric_limits<score_t>::lowest() || i_go > std::numeric_limits<score_t>::max()))
172 throw std::invalid_argument{
"You passed a score value to set_affine/set_linear that is out of range of the " 173 "scoring scheme's underlying type. Define your scoring scheme with a larger " 174 "template parameter or down-cast your score value beforehand to prevent " 178 gap =
static_cast<score_arg_t
>(g);
179 gap_open =
static_cast<score_arg_t
>(go);
192 template <arithmetic_concept score_arg_t>
232 constexpr ptrdiff_t
score(
size_t const number_of_consecutive_gaps) noexcept
234 return (gap_open * (number_of_consecutive_gaps ? 1 : 0)) + number_of_consecutive_gaps *
gap;
240 constexpr
bool operator==(
gap_scheme const & rhs)
const noexcept
242 return std::tie(
gap, gap_open) == std::tie(rhs.gap, rhs.gap_open);
245 constexpr
bool operator!=(
gap_scheme const & rhs)
const noexcept
247 return !(*
this == rhs);
258 template <cereal_archive_concept archive_t>
259 void CEREAL_SERIALIZE_FUNCTION_NAME(archive_t & archive)
270 score_t gap_open = 0;
283 template <
floating_po
int_concept score_arg_type>
290 template <
floating_po
int_concept score_arg_type>
297 template <arithmetic_concept score_arg_type>
304 template <arithmetic_concept score_arg_type>
Contains basic data structure for strong types.
Provides concepts for core language types and relations that don't have concepts in C++20 (yet)...
A strong type of underlying type score_type that represents an additional score (usually negative) th...
Definition: gap_scheme.hpp:85
A strong type of underlying type score_type that represents the score of any character against a gap ...
Definition: gap_scheme.hpp:61
The alphabet of a gap character '-'.
Definition: gap.hpp:62
A scheme for representing and computing scores against gap characters.
Definition: gap_scheme.hpp:107
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
constexpr void set_affine(gap_score< score_arg_t > const g, gap_open_score< score_arg_t > const go)
Set the Affine gap costs model.
Definition: gap_scheme.hpp:165
score_t score_type
The template parameter exposed as member type.
Definition: gap_scheme.hpp:115
constexpr void set_linear(gap_score< score_arg_t > const g)
Set the Linear gap costs model.
Definition: gap_scheme.hpp:193
Adaptions of concepts from the Cereal library.
constexpr gap_scheme(gap_score< score_arg_t > const g, gap_open_score< score_arg_t > const go)
Constructor for the Affine gap costs model (delegates to set_affine()).
Definition: gap_scheme.hpp:132
constexpr ptrdiff_t score(size_t const number_of_consecutive_gaps) noexcept
Compute the score of a stretch of gap characters.
Definition: gap_scheme.hpp:232
constexpr score_t & get_gap_open_score() noexcept
Return the gap open score.
Definition: gap_scheme.hpp:217
constexpr score_t & get_gap_score() noexcept
Return the gap score.
Definition: gap_scheme.hpp:204
constexpr score_t get_gap_score() const noexcept
A strong type of underlying type score_type that represents the score of any character against a gap ...
Definition: gap_scheme.hpp:210
constexpr gap_scheme(gap_score< score_arg_t > const g)
Constructor for the Linear gap costs model (delegates to set_linear()).
Definition: gap_scheme.hpp:141
constexpr score_t get_gap_open_score() const noexcept
A strong type of underlying type score_type that represents an additional score (usually negative) th...
Definition: gap_scheme.hpp:223