 |
SeqAn3
3.0.2
The Modern C++ library for sequence analysis.
|
|
Go to the documentation of this file.
52 template <
typename derived_type,
size_t size,
typename char_t =
char>
56 static_assert(
size != 0,
"alphabet size must be >= 1");
98 requires (!
std::same_as<char_t,
void>)
101 return derived_type::rank_to_char[rank];
144 requires (!std::same_as<char_t, void>)
148 rank = derived_type::char_to_rank[
static_cast<index_t
>(c)];
149 return static_cast<derived_type &
>(*this);
169 assert(
static_cast<size_t>(c) <
static_cast<size_t>(
alphabet_size));
171 return static_cast<derived_type &
>(*this);
182 friend constexpr
bool operator==(derived_type
const lhs, derived_type
const rhs) noexcept
188 friend constexpr
bool operator!=(derived_type
const lhs, derived_type
const rhs) noexcept
194 friend constexpr
bool operator<(derived_type
const lhs, derived_type
const rhs) noexcept
200 friend constexpr
bool operator>(derived_type
const lhs, derived_type
const rhs) noexcept
206 friend constexpr
bool operator<=(derived_type
const lhs, derived_type
const rhs) noexcept
212 friend constexpr
bool operator>=(derived_type
const lhs, derived_type
const rhs) noexcept
234 template <
typename derived_type,
typename char_t>
265 requires (!
std::same_as<char_t,
void>)
268 return derived_type::char_value;
284 requires (!std::same_as<char_t, void>)
287 return static_cast<derived_type &
>(*this);
293 return static_cast<derived_type &
>(*this);
304 friend constexpr
bool operator==(derived_type
const, derived_type
const) noexcept
310 friend constexpr
bool operator!=(derived_type
const, derived_type
const) noexcept
316 friend constexpr
bool operator<(derived_type
const, derived_type
const) noexcept
322 friend constexpr
bool operator>(derived_type
const, derived_type
const) noexcept
328 friend constexpr
bool operator<=(derived_type
const, derived_type
const) noexcept
334 friend constexpr
bool operator>=(derived_type
const, derived_type
const) noexcept
341 #if SEQAN3_WORKAROUND_GCC_87113
342 bool _bug_workaround{};
constexpr friend bool operator<(derived_type const lhs, derived_type const rhs) noexcept
Checks whether the letter lhs is smaller than rhs.
Definition: alphabet_base.hpp:194
Provides C++20 additions to the type_traits header.
constexpr friend bool operator<=(derived_type const lhs, derived_type const rhs) noexcept
Checks whether the letter lhs is smaller than or equal to rhs.
Definition: alphabet_base.hpp:206
constexpr derived_type & assign_rank(rank_type const) noexcept
Assign from a numeric value.
Definition: alphabet_base.hpp:291
static constexpr detail::min_viable_uint_t< size > alphabet_size
The size of the alphabet, i.e. the number of different values it can take.
Definition: alphabet_base.hpp:176
constexpr friend bool operator>(derived_type const lhs, derived_type const rhs) noexcept
Checks whether the letter lhs is greater than rhs.
Definition: alphabet_base.hpp:200
constexpr char_type to_char() const noexcept
Return the letter as a character of char_type.
Definition: alphabet_base.hpp:96
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:54
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:143
constexpr friend bool operator<=(derived_type const, derived_type const) noexcept
Letters are always equal.
Definition: alphabet_base.hpp:328
constexpr friend bool operator!=(derived_type const, derived_type const) noexcept
Letters are never unequal.
Definition: alphabet_base.hpp:310
constexpr friend bool operator<(derived_type const, derived_type const) noexcept
One letter cannot be smaller than another.
Definition: alphabet_base.hpp:316
constexpr derived_type & assign_char(char_type const c) noexcept
Assign from a character, implicitly converts invalid characters.
Definition: alphabet_base.hpp:142
constexpr friend bool operator==(derived_type const lhs, derived_type const rhs) noexcept
Checks whether the letters lhs and rhs are equal.
Definition: alphabet_base.hpp:182
constexpr friend bool operator>(derived_type const, derived_type const) noexcept
One letter cannot be bigger than another.
Definition: alphabet_base.hpp:322
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:272
constexpr friend bool operator!=(derived_type const lhs, derived_type const rhs) noexcept
Checks whether the letters lhs and rhs are unequal.
Definition: alphabet_base.hpp:188
detail::min_viable_uint_t< size - 1 > rank_type
The type of the alphabet when represented as a number (e.g. via to_rank()).
Definition: alphabet_base.hpp:64
constexpr alphabet_base() noexcept=default
Defaulted.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
constexpr friend bool operator>=(derived_type const, derived_type const) noexcept
Letters are always equal.
Definition: alphabet_base.hpp:334
constexpr friend bool operator==(derived_type const, derived_type const) noexcept
Letters are always equal.
Definition: alphabet_base.hpp:304
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:116
std::conditional_t< std::same_as< char_t, void >, char, char_t > char_type
The char representation; conditional needed to make semi alphabet definitions legal.
Definition: alphabet_base.hpp:62
Provides metaprogramming utilities for integer types.
SeqAn specific customisations in the standard namespace.
bool rank_type
The type of the alphabet when represented as a number (e.g. via to_rank()).
Definition: alphabet_base.hpp:244
constexpr friend bool operator>=(derived_type const lhs, derived_type const rhs) noexcept
Checks whether the letter lhs is bigger than or equal to rhs.
Definition: alphabet_base.hpp:212
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition: alphabet_base.hpp:167
constexpr alphabet_base() noexcept=default
Defaulted.
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:118
Core alphabet concept and free function/type trait wrappers.