SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
A class that defines which positions of a pattern to hash. More...
#include <seqan3/search/kmer_index/shape.hpp>
Public Member Functions | |
Constructors, destructor and assignment | |
constexpr | shape () noexcept=default |
Defaulted. | |
constexpr | shape (shape const &) noexcept=default |
Defaulted. | |
constexpr | shape (shape &&) noexcept=default |
Defaulted. | |
constexpr shape & | operator= (shape const &) noexcept=default |
Defaulted. | |
constexpr shape & | operator= (shape &&) noexcept=default |
Defaulted. | |
~shape () noexcept=default | |
Defaulted. | |
constexpr | shape (ungapped k) noexcept |
Construct an ungapped shape from a given size. | |
constexpr | shape (bin_literal const literal) noexcept |
Construct from a given seqan3::bin_literal. | |
Public Member Functions inherited from seqan3::dynamic_bitset< 58 > | |
constexpr | dynamic_bitset () noexcept=default |
Defaulted. | |
constexpr | dynamic_bitset (dynamic_bitset const &) noexcept=default |
Defaulted. | |
constexpr | dynamic_bitset (dynamic_bitset &&) noexcept=default |
Defaulted. | |
constexpr | dynamic_bitset (uint64_t const value) |
Construct from an uint64_t . | |
constexpr | dynamic_bitset (begin_it_type begin_it, end_it_type end_it) noexcept |
Construct from two iterators. | |
constexpr | dynamic_bitset (other_range_t &&range) noexcept |
Construct from a different range. | |
constexpr | dynamic_bitset (size_type const n, value_type const value) noexcept |
Construct with n times value . | |
constexpr | dynamic_bitset (char const(&lit)[N]) |
Construction from literal. | |
constexpr dynamic_bitset & | operator= (dynamic_bitset const &) noexcept=default |
Defaulted. | |
constexpr dynamic_bitset & | operator= (dynamic_bitset &&) noexcept=default |
Defaulted. | |
constexpr dynamic_bitset & | operator= (std::initializer_list< value_type > const ilist) noexcept |
Assign from std::initializer_list . | |
constexpr dynamic_bitset & | operator= (char const(&lit)[N]) |
Assign from literal. | |
~dynamic_bitset () noexcept=default | |
Defaulted. | |
constexpr void | assign (char const(&lit)[N]) |
Assign from literal. | |
constexpr void | assign (std::initializer_list< value_type > const ilist) noexcept |
Assign from std::initializer_list . | |
constexpr void | assign (size_type const count, value_type const value) noexcept |
Assign with count times value . | |
constexpr void | assign (other_range_t &&range) noexcept |
Assign from a different range. | |
constexpr void | assign (begin_it_type begin_it, end_it_type end_it) noexcept |
Assign from pair of iterators. | |
constexpr iterator | begin () noexcept |
Returns the begin to the dynamic_bitset . | |
constexpr const_iterator | begin () const noexcept |
Returns the begin to the dynamic_bitset . | |
constexpr const_iterator | cbegin () const noexcept |
Returns the begin to the dynamic_bitset . | |
constexpr iterator | end () noexcept |
Returns iterator past the end of the dynamic_bitset . | |
constexpr const_iterator | end () const noexcept |
Returns iterator past the end of the dynamic_bitset . | |
constexpr const_iterator | cend () const noexcept |
Returns iterator past the end of the dynamic_bitset . | |
constexpr dynamic_bitset & | operator&= (dynamic_bitset const &rhs) noexcept |
Sets the bits to the result of binary AND on corresponding pairs of bits of *this and rhs . | |
constexpr dynamic_bitset & | operator|= (dynamic_bitset const &rhs) noexcept |
Sets the bits to the result of binary OR on corresponding pairs of bits of *this and rhs . | |
constexpr dynamic_bitset & | operator^= (dynamic_bitset const &rhs) noexcept |
Sets the bits to the result of binary XOR on corresponding pairs of bits of *this and rhs . | |
constexpr dynamic_bitset | operator~ () const noexcept |
Returns a temporary copy of *this with all bits flipped (binary NOT). | |
constexpr dynamic_bitset & | operator<<= (size_t const count) noexcept |
Performs binary shift left on the current object. | |
constexpr dynamic_bitset & | operator>>= (size_t const count) noexcept |
Performs binary shift right on the current object. | |
constexpr dynamic_bitset | operator>> (size_t const count) const noexcept |
Performs binary shift right. | |
constexpr dynamic_bitset | operator<< (size_t const count) const noexcept |
Performs binary shift left. | |
constexpr dynamic_bitset & | set () noexcept |
Sets all bits to 1 . | |
constexpr dynamic_bitset & | set (size_t const i, bool const value=true) |
Sets the i'th bit to value . | |
constexpr dynamic_bitset & | reset () noexcept |
Sets all bits to 0 . | |
constexpr dynamic_bitset & | reset (size_t const i) |
Sets the i'th bit to false. | |
constexpr dynamic_bitset & | flip () noexcept |
Flips all bits (binary NOT). | |
constexpr dynamic_bitset & | flip (size_t const i) |
Flips the i'th bit (binary NOT). | |
constexpr bool | all () const noexcept |
Checks if all bit are set. | |
constexpr bool | any () const noexcept |
Checks if any bit is set. | |
constexpr bool | none () const noexcept |
Checks if no bit is set. | |
constexpr size_type | count () const noexcept |
Returns the number of set bits. | |
constexpr reference | at (size_t const i) |
Returns the i-th element. | |
constexpr const_reference | at (size_t const i) const |
Returns the i-th element. | |
constexpr const_reference | test (size_t const i) const |
Returns the i-th element. | |
constexpr reference | operator[] (size_t const i) noexcept |
Returns the i-th element. | |
constexpr const_reference | operator[] (size_t const i) const noexcept |
Returns the i-th element. | |
constexpr reference | front () noexcept |
Returns the first element. | |
constexpr const_reference | front () const noexcept |
Returns the first element. | |
constexpr reference | back () noexcept |
Returns the last element. | |
constexpr const_reference | back () const noexcept |
Returns the last element. | |
constexpr bitfield * | raw_data () noexcept |
Direct access to the underlying bit field. | |
constexpr bitfield const * | raw_data () const noexcept |
Direct access to the underlying bit field. | |
constexpr bool | empty () const noexcept |
Checks whether the container is empty. | |
constexpr size_type | size () const noexcept |
Returns the number of elements in the container, i.e. std::distance(begin(), end()) . | |
constexpr size_type | max_size () const noexcept |
Returns the maximum number of elements the container is able to hold and resolves to bit_capacity . | |
constexpr size_type | capacity () const noexcept |
Returns the number of elements that the container is able to hold and resolves to bit_capacity . | |
constexpr void | reserve (size_t) const noexcept |
Since the capacity is fixed on compile time, this is a no-op. | |
constexpr void | shrink_to_fit () const noexcept |
Since the capacity is fixed on compile time, this is a no-op. | |
constexpr void | clear () noexcept |
Removes all elements from the container. | |
constexpr iterator | insert (const_iterator pos, value_type const value) noexcept |
Inserts value before pos in the container. | |
constexpr iterator | insert (const_iterator pos, size_type const count, value_type const value) noexcept |
Inserts count copies of value before position in the container. | |
constexpr iterator | insert (const_iterator pos, begin_it_type begin_it, end_it_type end_it) noexcept |
Inserts elements from range [begin_it, end_it) before pos in the container. | |
constexpr iterator | insert (const_iterator pos, std::initializer_list< value_type > const &ilist) noexcept |
Inserts elements from initializer list before pos in the container. | |
constexpr iterator | erase (const_iterator begin_it, const_iterator end_it) noexcept |
Removes specified elements from the container. | |
constexpr iterator | erase (const_iterator pos) noexcept |
Removes specified elements from the container. | |
constexpr void | push_back (value_type const value) noexcept |
Appends the given element value to the end of the container. | |
constexpr void | pop_back () noexcept |
Removes the last element of the container. | |
constexpr void | resize (size_type const count, value_type const value=false) noexcept |
Resizes the container to contain count elements. | |
constexpr void | swap (dynamic_bitset &rhs) noexcept |
Swap contents with another instance. | |
constexpr void | swap (dynamic_bitset &&rhs) noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
std::string | to_string (char_t zero=char_t{ '0'}, char_t one=char_t{ '1'}) const |
Converts the dynamic_bitset to a std::string . | |
constexpr unsigned long | to_ulong () const |
Converts the dynamic_bitset to an unsigned long integer. | |
constexpr unsigned long long | to_ullong () const |
Converts the dynamic_bitset to an unsigned long long integer. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Other literals | |
constexpr shape | operator""_shape (unsigned long long const value) |
The seqan3::shape literal. | |
Additional Inherited Members | |
Public Types inherited from seqan3::dynamic_bitset< 58 > | |
using | value_type = bool |
Equals bool . | |
using | reference = reference_proxy_type |
A proxy type that enables assignment. | |
using | const_reference = bool |
Equals the value_type. | |
using | iterator = detail::random_access_iterator< dynamic_bitset > |
The iterator type of this container (a random access iterator). | |
using | const_iterator = detail::random_access_iterator< dynamic_bitset const > |
The const_iterator type of this container (a random access iterator). | |
using | difference_type = ptrdiff_t |
A std::ptrdiff_t . | |
using | size_type = detail::min_viable_uint_t< bit_capacity > |
An unsigned integer type (usually std::size_t ). | |
A class that defines which positions of a pattern to hash.
When hashing a sequence, there may be positions that do not count towards the final hash value. A shape offers an easy way to define such patterns. Given a k-mer length k
(0 < k
<= 58), a shape represents a binary sequence where a 0
encodes a "don't care position", i.e. a position that is not taken into account when computing the hash value. A 1
therefore translates to a position that is used to compute the hash value.
Construct an ungapped shape from a given size.
Linear in k
.
No-throw guarantee.
|
inlineconstexprnoexcept |
Construct from a given seqan3::bin_literal.
Linear in the size of the bin_literal
.
No-throw guarantee.
bin_literal
must be in the interval [1, 58].