SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
Core

Provides core functionality used by multiple modules. More...

+ Collaboration diagram for Core:

Modules

 Algorithm
 Provides core functionality used to configure algorithms.
 
 Configuration
 Provides core functionality used to configure configurations.
 

Classes

interface  cereal_archive
 All archives of the Cereal library satisfy this. More...
 
interface  cereal_input_archive
 All input archives of the Cereal library satisfy this. More...
 
interface  cereal_output_archive
 All output archives of the Cereal library satisfy this. More...
 
interface  cereal_text_archive
 All text archives of the Cereal library satisfy this. More...
 
interface  cerealisable
 Specifies the requirements for types that are serialisable via Cereal. More...
 
class  seqan3::debug_stream_type< char_t >
 A "pretty printer" for most SeqAn data structures and related types. More...
 
struct  seqan3::pod_tuple< type0 >
 Recursion anchor for pod_tuple. More...
 
interface  range_compatible
 Two types are "compatible" if their seqan3::range_dimension_v and their seqan3::range_innermost_value_t are the same. More...
 
struct  seqan3::range_innermost_value< t >
 Recursively determines the value_type on containers and/or iterators. More...
 

Macros

#define SEQAN3_WITH_CEREAL   0
 Whether CEREAL support is available or not.
 
#define SEQAN3_WITH_LEMON   0
 Whether Lemon support is available or not.
 

Typedefs

template<typename t >
using seqan3::range_innermost_value_t = typename range_innermost_value< t >::type
 Shortcut for seqan3::range_innermost_value (transformation_trait shortcut). More...
 
using seqan3::semiregular_box = ::ranges::semiregular_box
 Utility wrapper that behaves like std::optional but makes the type conform with the std::semiregular concept. Imported from ranges::semiregular_box. More...
 
using seqan3::semiregular_box_t = ::ranges::semiregular_box_t
 Utility transformation trait to get a wrapper type that models std::semiregular. Imported from ranges::semiregular_box_t. More...
 

Functions

template<typename base_t , std::unsigned_integral exp_t>
base_t seqan3::pow (base_t base, exp_t exp)
 Computes the value of base raised to the power exp. More...
 

Variables

template<typename t >
constexpr size_t seqan3::range_dimension_v = 1
 Returns the number of times you can call seqan3::value_type_t recursively on t (type trait). More...
 

Detailed Description

Provides core functionality used by multiple modules.

The core module contains concepts, functions and some classes that are used by multiple other modules, but that usually are not relevant to most users of the library.

Typedef Documentation

◆ range_innermost_value_t

template<typename t >
using seqan3::range_innermost_value_t = typedef typename range_innermost_value<t>::type

◆ semiregular_box

using seqan3::semiregular_box = typedef ::ranges::semiregular_box

Utility wrapper that behaves like std::optional but makes the type conform with the std::semiregular concept. Imported from ranges::semiregular_box.

See also
https://en.cppreference.com/w/cpp/ranges/semiregular_wrapper

◆ semiregular_box_t

using seqan3::semiregular_box_t = typedef ::ranges::semiregular_box_t

Utility transformation trait to get a wrapper type that models std::semiregular. Imported from ranges::semiregular_box_t.

See also
https://en.cppreference.com/w/cpp/ranges/semiregular_wrapper

Function Documentation

◆ pow()

template<typename base_t , std::unsigned_integral exp_t>
base_t seqan3::pow ( base_t  base,
exp_t  exp 
)

Computes the value of base raised to the power exp.

Parameters
[in]baseThe base to compute the power for.
[in]expThe power to raise base to.
Returns
$ base^{exp} $.
Exceptions
std::overflow_errorif an overflow occurs (Only in Debug build).
std::underflow_errorif an underflow occurs (Only in Debug build).
See also
https://en.cppreference.com/w/cpp/numeric/math/pow

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.

Example

int main()
{
// Uses specialisation for signed integers.
seqan3::debug_stream << seqan3::pow(2, 3u) << '\n'; // Prints 8
seqan3::debug_stream << seqan3::pow(-2, 3u) << '\n'; // Prints -8
// Uses specialisation for unsigned integers.
seqan3::debug_stream << seqan3::pow(2u, 3u) << '\n'; // Prints 8
// Uses `std::pow`.
seqan3::debug_stream << seqan3::pow(2, 3) << '\n'; // Prints 8
seqan3::debug_stream << seqan3::pow(2u, 3) << '\n'; // Prints 8
seqan3::debug_stream << seqan3::pow(2.0, 3) << '\n'; // Prints 8
// 5^25 should be 298023223876953125.
seqan3::debug_stream << seqan3::pow(5u, 25u) << '\n'; // Prints 298023223876953125
seqan3::debug_stream << static_cast<uint64_t>(std::pow(5u, 25u)) << '\n'; // Prints 298023223876953152 (wrong!)
}
Provides seqan3::debug_stream and related types.
base_t pow(base_t base, exp_t exp)
Computes the value of base raised to the power exp.
Definition: math.hpp:124
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition: debug_stream.hpp:42
T pow(T... args)
Provides math related functionality.

Variable Documentation

◆ range_dimension_v

template<typename t >
constexpr size_t seqan3::range_dimension_v = 1
constexpr

Returns the number of times you can call seqan3::value_type_t recursively on t (type trait).

Template Parameters
tThe type to be queried; must resolve seqan3::value_type_t at least once.

Attention, this type trait implicitly removes cv-qualifiers and reference from the types it recurses on and returns.