40 template <std::ranges::view underlying_range_type>
42 requires std::ranges::forward_range<underlying_range_type> && std::ranges::common_range<underlying_range_type>
49 template <
typename range_type>
93 if (std::ranges::empty(
u_range))
99 if constexpr (std::ranges::bidirectional_range<underlying_range_type>)
106 if constexpr (std::ranges::sized_range<underlying_range_type>)
116 }
while (++tmp_it != std::ranges::end(
u_range));
141 template <
typename other_range_t>
144 std::ranges::viewable_range<other_range_t> &&
145 std::constructible_from<underlying_range_type,
146 std::ranges::ref_view<std::remove_reference_t<other_range_t>>>
217 constexpr
auto size() const noexcept
219 requires
std::ranges::sized_range<underlying_range_type>
240 template <std::ranges::viewable_range other_range_t>
258 template <std::ranges::view underlying_range_type>
260 requires std::ranges::forward_range<underlying_range_type> && std::ranges::common_range<underlying_range_type>
262 template <
typename range_type>
268 template <
typename other_range_type>
324 second_it{std::ranges::next(iter, 1, end_it)},
337 template <
typename other_range_type>
339 requires std::convertible_to<other_range_type, range_type &> &&
361 noexcept(noexcept(std::declval<basic_iterator &>().from_index(1)))
366 return *(*
this + index);
377 if (++second_it == end_it)
380 second_it = first_it;
388 noexcept(noexcept(std::declval<underlying_iterator_type &>()++))
402 if (--second_it == first_it)
413 noexcept(noexcept(std::declval<underlying_iterator_type &>()--))
426 noexcept(noexcept(std::declval<basic_iterator &>().from_index(1)))
431 from_index(to_index() +
offset);
438 noexcept(noexcept(std::declval<basic_iterator &>() += 1))
455 iter.from_index(iter.to_index() +
offset);
462 noexcept(noexcept(std::declval<basic_iterator &>().from_index(1)))
467 from_index(to_index() -
offset);
474 noexcept(noexcept(std::declval<basic_iterator &>() -= 1))
485 template <
typename other_range_type>
487 requires std::random_access_iterator<underlying_iterator_type> &&
491 noexcept(noexcept(std::declval<basic_iterator &>().to_index()))
507 template <
typename other_range_type>
509 requires std::equality_comparable_with<underlying_iterator_type, std::ranges::iterator_t<other_range_type>> &&
513 noexcept(noexcept(std::declval<underlying_iterator_type &>() == std::declval<underlying_iterator_type &>()))
515 return std::tie(first_it, second_it) ==
std::tie(rhs.first_it, rhs.second_it);
519 template <
typename other_range_type>
521 requires std::equality_comparable_with<underlying_iterator_type, std::ranges::iterator_t<other_range_type>> &&
525 noexcept(noexcept(std::declval<underlying_iterator_type &>() != std::declval<underlying_iterator_type &>()))
527 return !(*
this == rhs);
531 template <
typename other_range_type>
533 requires std::totally_ordered_with<underlying_iterator_type,
534 std::ranges::iterator_t<other_range_type>> &&
538 noexcept(noexcept(std::declval<underlying_iterator_type &>() < std::declval<underlying_iterator_type &>()))
540 return std::tie(first_it, second_it) <
std::tie(rhs.first_it, rhs.second_it);
544 template <
typename other_range_type>
546 requires std::totally_ordered_with<underlying_iterator_type,
547 std::ranges::iterator_t<other_range_type>> &&
551 noexcept(noexcept(std::declval<underlying_iterator_type &>() > std::declval<underlying_iterator_type &>()))
554 return std::tie(first_it, second_it) >
std::tie(rhs.first_it, rhs.second_it);
558 template <
typename other_range_type>
560 requires std::totally_ordered_with<underlying_iterator_type,
561 std::ranges::iterator_t<other_range_type>> &&
565 noexcept(noexcept(std::declval<underlying_iterator_type &>() <= std::declval<underlying_iterator_type &>()))
567 return std::tie(first_it, second_it) <=
std::tie(rhs.first_it, rhs.second_it);
571 template <
typename other_range_type>
573 requires std::totally_ordered_with<underlying_iterator_type,
574 std::ranges::iterator_t<other_range_type>> &&
578 noexcept(noexcept(std::declval<underlying_iterator_type &>() >= std::declval<underlying_iterator_type &>()))
580 return std::tie(first_it, second_it) >=
std::tie(rhs.first_it, rhs.second_it);
604 size_t src_size = end_it - begin_it;
605 size_t index_i = first_it - begin_it;
606 size_t index_j = second_it - begin_it;
607 return (src_size * (src_size - 1)/2) - (src_size - index_i) * ((src_size - index_i) - 1)/2 +
608 index_j - index_i - 1;
616 noexcept(noexcept(std::declval<underlying_iterator_type &>() - std::declval<underlying_iterator_type &>()) &&
617 noexcept(std::declval<underlying_iterator_type &>() + 1))
622 size_t src_size = end_it - begin_it;
623 size_t index_i = src_size - 2 -
625 size_t index_j = index + index_i + 1 - src_size * (src_size - 1)/2 + (src_size - index_i) *
626 ((src_size - index_i) - 1)/2;
627 first_it = begin_it + index_i;
628 second_it = begin_it + index_j;
Template for range adaptor closure objects that store no arguments and always delegate to the view co...
Definition: detail.hpp:292
The forward declared iterator type for pairwise_combine_view.
Definition: pairwise_combine.hpp:264
constexpr basic_iterator operator++(int) noexcept(noexcept(std::declval< underlying_iterator_type & >()++))
Post-increment operator.
Definition: pairwise_combine.hpp:387
constexpr basic_iterator & operator-=(difference_type const offset) noexcept(noexcept(std::declval< basic_iterator & >().from_index(1)))
Decrements the iterator by the given offset; underlying_iterator_type must model \ std::random_access...
Definition: pairwise_combine.hpp:461
detail::iterator_category_tag_t< underlying_iterator_type > iterator_category
The iterator category tag.
Definition: pairwise_combine.hpp:293
constexpr reference operator*() const noexcept(noexcept(*std::declval< underlying_iterator_type >()))
Accesses the pointed-to element.
Definition: pairwise_combine.hpp:351
constexpr friend basic_iterator operator+(difference_type const offset, basic_iterator iter) noexcept(noexcept(std::declval< basic_iterator< range_type > & >().from_index(1)))
Advances the iterator by the given offset; underlying_iterator_type must model \ std::random_access_i...
Definition: pairwise_combine.hpp:449
basic_iterator(basic_iterator const &)=default
Defaulted.
constexpr basic_iterator(basic_iterator< other_range_type > other) noexcept
Constructs const iterator from non-const iterator.
Definition: pairwise_combine.hpp:342
basic_iterator & operator=(basic_iterator const &)=default
Defaulted.
basic_iterator & operator=(basic_iterator &&)=default
Defaulted.
constexpr basic_iterator operator--(int) noexcept(noexcept(std::declval< underlying_iterator_type & >() --))
Post-decrement operator; underlying_iterator_type must model std::bidirectional_iterator.
Definition: pairwise_combine.hpp:412
constexpr basic_iterator & operator++() noexcept(noexcept(++std::declval< underlying_iterator_type & >()))
Pre-increment operator.
Definition: pairwise_combine.hpp:374
basic_iterator()=default
Defaulted.
constexpr bool operator>(basic_iterator< other_range_type > const &rhs) const noexcept(noexcept(std::declval< underlying_iterator_type & >() > std::declval< underlying_iterator_type & >()))
Checks whether *this is greater than rhs.
Definition: pairwise_combine.hpp:550
constexpr bool operator>=(basic_iterator< other_range_type > const &rhs) const noexcept(noexcept(std::declval< underlying_iterator_type & >() >=std::declval< underlying_iterator_type & >()))
Checks whether *this is greater than or equal to rhs.
Definition: pairwise_combine.hpp:577
constexpr void from_index(size_t const index) noexcept(noexcept(std::declval< underlying_iterator_type & >() - std::declval< underlying_iterator_type & >()) &&noexcept(std::declval< underlying_iterator_type & >()+1))
Sets the iterator to the given index.
Definition: pairwise_combine.hpp:615
constexpr difference_type operator-(basic_iterator< other_range_type > const &rhs) const noexcept(noexcept(std::declval< basic_iterator & >().to_index()))
Computes the distance between two iterators; underlying_iterator_type must model \ std::random_access...
Definition: pairwise_combine.hpp:490
constexpr bool operator!=(basic_iterator< other_range_type > const &rhs) const noexcept(noexcept(std::declval< underlying_iterator_type & >() !=std::declval< underlying_iterator_type & >()))
Checks whether *this is not equal to rhs.
Definition: pairwise_combine.hpp:524
constexpr bool operator==(basic_iterator< other_range_type > const &rhs) const noexcept(noexcept(std::declval< underlying_iterator_type & >()==std::declval< underlying_iterator_type & >()))
Checks whether *this is equal to rhs.
Definition: pairwise_combine.hpp:512
constexpr size_t to_index() const noexcept(noexcept(std::declval< underlying_iterator_type & >() - std::declval< underlying_iterator_type & >()))
Returns the index for the current iterator position.
Definition: pairwise_combine.hpp:598
common_tuple< underlying_ref_t, underlying_ref_t > reference
The reference type.
Definition: pairwise_combine.hpp:289
void pointer
The pointer type.
Definition: pairwise_combine.hpp:291
constexpr bool operator<=(basic_iterator< other_range_type > const &rhs) const noexcept(noexcept(std::declval< underlying_iterator_type & >()<=std::declval< underlying_iterator_type & >()))
Checks whether *this is less than or equal to rhs.
Definition: pairwise_combine.hpp:564
constexpr basic_iterator(underlying_iterator_type iter, underlying_iterator_type begin_it, underlying_iterator_type end_it) noexcept
Constructs the iterator from the current underlying iterator and the end iterator of the underlying r...
Definition: pairwise_combine.hpp:320
constexpr basic_iterator operator-(difference_type const offset) const noexcept(noexcept(std::declval< basic_iterator & >() -=1))
Decrements the iterator by the given offset; underlying_iterator_type must model \ std::random_access...
Definition: pairwise_combine.hpp:473
constexpr basic_iterator & operator--() noexcept(noexcept(--std::declval< underlying_iterator_type & >()))
Pre-decrement operator; underlying_iterator_type must model std::bidirectional_iterator.
Definition: pairwise_combine.hpp:396
std::ranges::iterator_t< range_type > underlying_iterator_type
Alias type for the iterator over the passed range type.
Definition: pairwise_combine.hpp:273
~basic_iterator()=default
Defaulted.
basic_iterator(basic_iterator &&)=default
Defaulted.
constexpr basic_iterator & operator+=(difference_type const offset) noexcept(noexcept(std::declval< basic_iterator & >().from_index(1)))
Advances the iterator by the given offset; underlying_iterator_type must model \ std::random_access_i...
Definition: pairwise_combine.hpp:425
constexpr reference operator[](size_t const index) const noexcept(noexcept(std::declval< basic_iterator & >().from_index(1)))
Access the element at the given index.
Definition: pairwise_combine.hpp:360
constexpr bool operator<(basic_iterator< other_range_type > const &rhs) const noexcept(noexcept(std::declval< underlying_iterator_type & >()< std::declval< underlying_iterator_type & >()))
Checks whether *this is less than rhs.
Definition: pairwise_combine.hpp:537
constexpr basic_iterator operator+(difference_type const offset) const noexcept(noexcept(std::declval< basic_iterator & >()+=1))
Advances the iterator by the given offset; underlying_iterator_type must model \ std::random_access_i...
Definition: pairwise_combine.hpp:437
Generates all pairwise combinations of the elements in the underlying range.
Definition: pairwise_combine.hpp:45
underlying_range_type u_range
The underling range.
Definition: pairwise_combine.hpp:230
pairwise_combine_view(pairwise_combine_view const &)=default
Defaulted.
constexpr const_iterator begin() const noexcept
Returns an iterator to the first element of the range.
Definition: pairwise_combine.hpp:177
pairwise_combine_view(pairwise_combine_view &&)=default
Defaulted.
constexpr pairwise_combine_view(underlying_range_type range)
Constructs from a view.
Definition: pairwise_combine.hpp:90
constexpr iterator begin() noexcept
Returns an iterator to the first element of the range.
Definition: pairwise_combine.hpp:171
constexpr pairwise_combine_view(other_range_t &&range)
Constructs from a view.
Definition: pairwise_combine.hpp:151
pairwise_combine_view()=default
Defaulted.
pairwise_combine_view & operator=(pairwise_combine_view &&)=default
Defaulted.
constexpr const_iterator end() const noexcept
Returns an iterator to the element following the last element of the range.
Definition: pairwise_combine.hpp:204
transformation_trait_or_t< std::type_identity< basic_iterator< underlying_range_type const > >, void > const_iterator
The const iterator type. Evaluates to void if the underlying range is not const iterable.
Definition: pairwise_combine.hpp:60
std::ranges::iterator_t< underlying_range_type > back_iterator
The cached iterator pointing to the last element of the underlying range.
Definition: pairwise_combine.hpp:232
~pairwise_combine_view()=default
Defaulted.
constexpr auto size() const noexcept
Computes the size based on the size of the underlying range.
Definition: pairwise_combine.hpp:217
constexpr iterator end() noexcept
Returns an iterator to the element following the last element of the range.
Definition: pairwise_combine.hpp:198
pairwise_combine_view & operator=(pairwise_combine_view const &)=default
Defaulted.
A generic random access iterator that delegates most operations to the range.
Definition: random_access_iterator.hpp:310
@ offset
Sequence (seqan3::field::seq) relative start position (0-based), unsigned value.
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:150
typename transformation_trait_or< type_t, default_t >::type transformation_trait_or_t
Helper type of seqan3::detail::transformation_trait_or (transformation_trait shortcut).
Definition: transformation_trait_or.hpp:51
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:70
constexpr auto pairwise_combine
A view adaptor that generates all pairwise combinations of the elements of the underlying range.
Definition: pairwise_combine.hpp:709
Specifies requirements of an input range type for which the const version of that type satisfies the ...
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
typename std::iterator_traits< it_t >::iterator_category iterator_category_tag_t
Exposes the iterator_category from the modelled concept.
Definition: iterator_traits.hpp:200
pairwise_combine_view(other_range_t &&range) -> pairwise_combine_view< std::views::all_t< other_range_t >>
Deduces the correct template type from a non-view lvalue range by wrapping the range in std::views::a...
The SeqAn namespace for views.
Definition: async_input_buffer.hpp:343
::ranges::common_tuple common_tuple
A common tuple type that behaves like a regular std::tuple, but can be used as a reference type proxy...
Definition: common_tuple.hpp:29
SeqAn specific customisations in the standard namespace.
Additional non-standard concepts for ranges.
Auxiliary header for the views submodule .
Adaptations of concepts from the Ranges TS.
Provides seqan3::common_tuple and seqan3::common_pair.