|
SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
Provides additional utility functionality used by multiple modules. More...
Collaboration diagram for Utility:Modules | |
| Bloom Filter | |
| Provides seqan3:bloom_filter. | |
| Builtin Character Operations | |
| Provides various operations on character types. | |
| Concept | |
| Provides various general purpose concepts. | |
| Container | |
| Provides various general purpose container and concepts. | |
| Parallel | |
| This module contains types and utilities for concurrent execution of algorithms in SeqAn. | |
| Range | |
| The range module provides general purpose range concepts. | |
| SIMD | |
| The simd module contains a unified interface to provide simd types and functions used in seqan3. | |
| Tuple | |
| Additional helper utilities for "tuple" types like std::tuple, std::pair, seqan3::pod_tuple that are not specific to a SeqAn module. | |
| Type List | |
| Provides seqan3::type_list and metaprogramming utilities for working on type lists. | |
| Type Pack | |
| Provides metaprogramming utilities for working on template parameter packs. | |
| Type Traits | |
| Provides various type traits and their shortcuts. | |
| Views | |
| Views are "lazy range combinators" that offer modified views onto other ranges. | |
Classes | |
| struct | seqan3::detail::multi_invocable< invocable_ts > |
| A type that can conveniently inherit multiple invocables and acts as a union over them. More... | |
Typedefs | |
| template<uint64_t value> | |
| using | seqan3::detail::min_viable_uint_t = std::conditional_t< value<=1ull, bool, std::conditional_t< value<=255ull, uint8_t, std::conditional_t< value<=65535ull, uint16_t, std::conditional_t< value<=4 '294 '967 '295ull, uint32_t, uint64_t > > > > |
| Given a value, return the smallest unsigned integer that can hold it. | |
Functions | |
| template<std::unsigned_integral unsigned_t> | |
| constexpr unsigned_t | seqan3::detail::ceil_log2 (unsigned_t const n) noexcept |
| Computes the ceil of the logarithm to the base of two for unsigned integers. | |
| template<std::unsigned_integral unsigned_t> | |
| constexpr unsigned_t | seqan3::detail::floor_log2 (unsigned_t const n) noexcept |
| Computes the floor of the logarithm to the base of two for unsigned integers. | |
| template<typename base_t , std::unsigned_integral exp_t> requires (std::same_as<base_t, uint64_t> || std::same_as<base_t, int64_t>) | |
| base_t | seqan3::pow (base_t base, exp_t exp) |
Computes the value of base raised to the power exp. | |
| template<std::integral type> | |
| constexpr type | seqan3::detail::to_little_endian (type const in) noexcept |
| Convert the byte encoding of integer values to little-endian byte order. | |
Variables | |
| template<typename type_t > | |
| constexpr auto | seqan3::detail::bits_of = min_viable_uint_v<CHAR_BIT * sizeof(type_t)> |
| How many bits has a type? | |
| template<uint64_t value> | |
| constexpr auto | seqan3::detail::min_viable_uint_v = static_cast<min_viable_uint_t<value>>(value) |
| Given a value, cast the value as the smallest unsigned integer that can hold it. | |
| template<typename int_t > | |
| constexpr size_t | seqan3::detail::size_in_values_v |
| Return the number of values an integral type can have, i.e. the difference between min and max. | |
| template<typename type > | |
| std::string const | seqan3::detail::type_name_as_string |
| Defines the human-readable name of the given type using the typeid operator. | |
Provides additional utility functionality used by multiple modules.
The utility module contains concepts, functions, traits and classes that are independent of the remaining modules in SeqAn. These implementations are considered external functionality, i.e. they could have been outsourced into their own libraries.
The utility module has no dependency to any other module except the Core module.
|
constexprnoexcept |
Computes the ceil of the logarithm to the base of two for unsigned integers.
| [in] | n | An unsigned integer. |
The difference to std::ceil(std::log2(n)) is that everything is computed exactly (without precision loss due to promoting to double)
No-throw guarantee.
Thread safe.
Constant.
|
constexprnoexcept |
Computes the floor of the logarithm to the base of two for unsigned integers.
| [in] | n | An unsigned integer. |
The difference to std::floor(std::log2(n)) is that everything is computed exactly (without precision loss due to promoting to double)
No-throw guarantee.
Thread safe.
Constant.
| base_t seqan3::pow | ( | base_t | base, |
| exp_t | exp | ||
| ) |
Computes the value of base raised to the power exp.
| [in] | base | The base to compute the power for. |
| [in] | exp | The power to raise base to. |
| std::overflow_error | if an overflow occurs (Only in Debug build). |
| std::underflow_error | if an underflow occurs (Only in Debug build). |
The difference to std::pow is that the powers of an integer base are computed exact (without precision loss due to promoting to double) iff exp_t models std::unsigned_integral and
base_t models std::unsigned_integral (returns uint64_t)base_t models std::integral, but not std::unsigned_integral (returns int64_t)In all other cases the return value and type is equivalent to that of std::pow.
|
constexprnoexcept |
Convert the byte encoding of integer values to little-endian byte order.
| type | The type of the value to convert; must model std::integral. |
| in | The input value to convert. |
This function swaps the bytes if the host system uses big endian. In this case only 1, 2, 4, or 8 byte big integral types are allowed as input. On host systems with little endian this function is a no-op and returns the unchanged input value. Other systems with mixed endianness are not supported.
How many bits has a type?
| type_t | The type to determine the number of bits. |
|
constexpr |
Given a value, cast the value as the smallest unsigned integer that can hold it.
Return the number of values an integral type can have, i.e. the difference between min and max.
|
inline |
Defines the human-readable name of the given type using the typeid operator.
| type | The type to get the human-readable name for. |
On gcc and clang std::type_info only returns a mangled name. The mangled name can be converted to human-readable form using implementation-specific API such as abi::__cxa_demangle. In other implementations the name returned is already human-readable.