SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::kmer_hash_view< urng_t > Class Template Reference

The type returned by seqan3::views::kmer_hash. More...

#include <seqan3/search/views/kmer_hash.hpp>

+ Inheritance diagram for seqan3::detail::kmer_hash_view< urng_t >:

Classes

class  basic_iterator
 Iterator for calculating hash values via a given seqan3::shape. More...
 

Public Member Functions

auto size ()
 Returns the size of the range, if the underlying range is a std::ranges::sized_range.
 
auto size () const
 Returns the size of the range, if the underlying range is a std::ranges::sized_range.
 
Constructors, destructor and assignment
 kmer_hash_view ()=default
 Defaulted.
 
 kmer_hash_view (kmer_hash_view const &rhs)=default
 Defaulted.
 
 kmer_hash_view (kmer_hash_view &&rhs)=default
 Defaulted.
 
kmer_hash_viewoperator= (kmer_hash_view const &rhs)=default
 Defaulted.
 
kmer_hash_viewoperator= (kmer_hash_view &&rhs)=default
 Defaulted.
 
 ~kmer_hash_view ()=default
 Defaulted.
 
 kmer_hash_view (urng_t urange_, shape const &s_)
 Construct from a view and a given shape.
 
template<typename rng_t >
requires (!std::same_as<std::remove_cvref_t<rng_t>, kmer_hash_view>) && std::ranges::viewable_range<rng_t> && std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
 kmer_hash_view (rng_t &&urange_, shape const &s_)
 Construct from a non-view that can be view-wrapped and a given shape.
 
Iterators
auto begin () noexcept
 Returns an iterator to the first element of the range.
 
auto begin () const noexcept
 Returns an iterator to the first element of the range.
 
auto end () noexcept
 Returns an iterator to the element following the last element of the range.
 
auto end () const noexcept
 Returns an iterator to the element following the last element of the range.
 

Private Member Functions

void shape_too_long_error () const
 Throws the exception for validate_shape().
 
void validate_shape () const
 Checks that the shape is not too long for the given alphabet.
 

Private Attributes

shape shape_
 The shape to use.
 
urng_t urange
 The underlying range.
 

Static Private Attributes

static int max_shape_count = 64 / std::log2(alphabet_size<std::ranges::range_reference_t<urng_t>>)
 The maximum shape count for the given alphabet.
 

Detailed Description

template<std::ranges::view urng_t>
class seqan3::detail::kmer_hash_view< urng_t >

The type returned by seqan3::views::kmer_hash.

Template Parameters
urng_tThe type of the underlying ranges, must model std::forward_range, the reference type must model seqan3::semialphabet.

Note that most members of this class are generated by std::ranges::view_interface which is not yet documented here.

Constructor & Destructor Documentation

◆ kmer_hash_view() [1/2]

template<std::ranges::view urng_t>
seqan3::detail::kmer_hash_view< urng_t >::kmer_hash_view ( urng_t  urange_,
shape const &  s_ 
)
inlineexplicit

Construct from a view and a given shape.

Exceptions
std::invalid_argumentif hashes resulting from the shape/alphabet combination cannot be represented in uint64_t, i.e. \(s>\frac{64}{\log_2\sigma}\) with shape size \(s\) and alphabet size \(\sigma\).

◆ kmer_hash_view() [2/2]

template<std::ranges::view urng_t>
template<typename rng_t >
requires (!std::same_as<std::remove_cvref_t<rng_t>, kmer_hash_view>) && std::ranges::viewable_range<rng_t> && std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
seqan3::detail::kmer_hash_view< urng_t >::kmer_hash_view ( rng_t &&  urange_,
shape const &  s_ 
)
inlineexplicit

Construct from a non-view that can be view-wrapped and a given shape.

Exceptions
std::invalid_argumentif hashes resulting from the shape/alphabet combination cannot be represented in uint64_t, i.e. \(s>\frac{64}{\log_2\sigma}\) with shape size \(s\) and alphabet size \(\sigma\).

Member Function Documentation

◆ begin() [1/2]

template<std::ranges::view urng_t>
auto seqan3::detail::kmer_hash_view< urng_t >::begin ( ) const
inlinenoexcept

Returns an iterator to the first element of the range.

Returns
Iterator to the first element.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ begin() [2/2]

template<std::ranges::view urng_t>
auto seqan3::detail::kmer_hash_view< urng_t >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the range.

Returns
Iterator to the first element.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [1/2]

template<std::ranges::view urng_t>
auto seqan3::detail::kmer_hash_view< urng_t >::end ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the range.

Returns
Iterator to the end.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [2/2]

template<std::ranges::view urng_t>
auto seqan3::detail::kmer_hash_view< urng_t >::end ( )
inlinenoexcept

Returns an iterator to the element following the last element of the range.

Returns
Iterator to the end.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ size() [1/2]

template<std::ranges::view urng_t>
auto seqan3::detail::kmer_hash_view< urng_t >::size ( )
inline

Returns the size of the range, if the underlying range is a std::ranges::sized_range.

Returns
Size of range.

◆ size() [2/2]

template<std::ranges::view urng_t>
auto seqan3::detail::kmer_hash_view< urng_t >::size ( ) const
inline

Returns the size of the range, if the underlying range is a std::ranges::sized_range.

Returns
Size of range.

The documentation for this class was generated from the following file:
Hide me