SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
Generates all pairwise combinations of the elements in the underlying range. More...
#include <seqan3/utility/views/pairwise_combine.hpp>
Classes | |
class | basic_iterator |
The forward declared iterator type for pairwise_combine_view. More... | |
Public Member Functions | |
Constructors, destructor and assignment | |
pairwise_combine_view ()=default | |
Defaulted. | |
pairwise_combine_view (pairwise_combine_view const &)=default | |
Defaulted. | |
pairwise_combine_view (pairwise_combine_view &&)=default | |
Defaulted. | |
pairwise_combine_view & | operator= (pairwise_combine_view const &)=default |
Defaulted. | |
pairwise_combine_view & | operator= (pairwise_combine_view &&)=default |
Defaulted. | |
~pairwise_combine_view ()=default | |
Defaulted. | |
constexpr | pairwise_combine_view (underlying_range_type range) |
Constructs from a view. | |
template<typename other_range_t > requires (!std::same_as<std::remove_cvref_t<other_range_t>, pairwise_combine_view>) && std::ranges::viewable_range<other_range_t> && std::constructible_from<underlying_range_type, std::ranges::ref_view<std::remove_reference_t<other_range_t>>> | |
constexpr | pairwise_combine_view (other_range_t &&range) |
Constructs from a view. | |
Iterators | |
constexpr iterator | begin () noexcept |
Returns an iterator to the first element of the range. | |
constexpr const_iterator | begin () const noexcept |
Returns an iterator to the first element of the range. | |
constexpr iterator | end () noexcept |
Returns an iterator to the element following the last element of the range. | |
constexpr const_iterator | end () const noexcept |
Returns an iterator to the element following the last element of the range. | |
Capacity | |
constexpr auto | size () const noexcept |
Computes the size based on the size of the underlying range. | |
Private Types | |
Associated types | |
using | iterator = basic_iterator< underlying_range_type > |
The iterator type. | |
using | const_iterator = transformation_trait_or_t< std::type_identity< basic_iterator< underlying_range_type const > >, void > |
The const iterator type. Evaluates to void if the underlying range is not const iterable. | |
Generates all pairwise combinations of the elements in the underlying range.
underlying_range_type | The type of the underlying range; must model std::ranges::view, std::ranges::forward_range and std::ranges::common_range. |
This view will provide a convenient way to iterate over all pairwise combinations of the elements of the underlying range (in no defined order). A underlying range with n
elements will therefore have n choose 2
possible combinations.
|
inlineexplicitconstexpr |
Constructs from a view.
[in] | range | The underlying range to be wrapped. Of type underlying_range_type . |
During construction the iterator pointing to the last element of the view is cached (not the end of the range). This optimises the call to end if the underlying range models only forward_range. Otherwise the call to end will be linear in the number of elements of the underlying range.
Constant if underlying_range_type
models std::ranges::bidirectional_range, otherwise linear.
|
inlineexplicitconstexpr |
Constructs from a view.
other_range_t | The type of the range to be wrapped with seqan3::detail::pairwise_combine_view; must model std::ranges::viewable_range and underlying_range_type must be constructible with other_range wrapped in std::views::all. |
[in] | range | The underlying range to be wrapped. |
During construction the iterator pointing to the last element of the view is cached (not the end of the range). This optimises the call to end if the underlying range models only forward_range. Otherwise the call to end will be linear in the number of elements of the underlying range.
Constant if other_range_t
models std::ranges::bidirectional_range, otherwise linear.
|
inlineconstexprnoexcept |
Returns an iterator to the first element of the range.
If the range is empty, the returned iterator will be equal to end().
Constant.
No-throw guarantee.
|
inlineconstexprnoexcept |
Returns an iterator to the first element of the range.
If the range is empty, the returned iterator will be equal to end().
Constant.
No-throw guarantee.
|
inlineconstexprnoexcept |
Returns an iterator to the element following the last element of the range.
This element acts as a placeholder; attempting to dereference it results in undefined behaviour.
Constant.
No-throw guarantee.
|
inlineconstexprnoexcept |
Returns an iterator to the element following the last element of the range.
This element acts as a placeholder; attempting to dereference it results in undefined behaviour.
Constant.
No-throw guarantee.