SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
shape.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
11#pragma once
12
14
15namespace seqan3
16{
17
22{
24 uint8_t value;
25};
26
31{
33 uint64_t value;
34};
35
56class shape : public dynamic_bitset<58>
57{
58public:
62 constexpr shape() noexcept = default;
63 constexpr shape(shape const &) noexcept = default;
64 constexpr shape(shape &&) noexcept = default;
65 constexpr shape & operator=(shape const &) noexcept = default;
66 constexpr shape & operator=(shape &&) noexcept = default;
67 ~shape() noexcept = default;
68
83 constexpr shape(ungapped k) noexcept : dynamic_bitset<58>((1ULL << k.value) - 1)
84 {
85 assert(k.value > 0);
86 }
87
102 constexpr shape(bin_literal const literal) noexcept : dynamic_bitset<58>(literal.value)
103 {
104 assert(front() == 1); // First position must be 1, e.g. no 0111 shape
105 assert(back() == 1); // Last position must be 1, e.g. no 1110 shape
106 }
108};
109
110inline namespace literals
111{
112
121constexpr shape operator""_shape(unsigned long long const value)
122{
123 return shape{bin_literal{value}};
124}
126
127} // namespace literals
128
129} // namespace seqan3
A constexpr bitset implementation with dynamic size at compile time.
Definition dynamic_bitset.hpp:51
constexpr reference back() noexcept
Returns the last element.
Definition dynamic_bitset.hpp:1163
constexpr reference front() noexcept
Returns the first element.
Definition dynamic_bitset.hpp:1133
A class that defines which positions of a pattern to hash.
Definition shape.hpp:57
constexpr shape(bin_literal const literal) noexcept
Construct from a given seqan3::bin_literal.
Definition shape.hpp:102
constexpr shape() noexcept=default
Defaulted.
A constexpr bitset implementation with dynamic size at compile time.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
A strong type of underlying type uint64_t that represents the shape in binary representation.
Definition shape.hpp:31
uint64_t value
The shape in binary representation.
Definition shape.hpp:33
A strong type of underlying type uint8_t that represents the ungapped shape size.
Definition shape.hpp:22
uint8_t value
The ungapped shape size.
Definition shape.hpp:24
Hide me