SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
shape.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
10
11
#pragma once
12
13
#include <
seqan3/utility/container/dynamic_bitset.hpp
>
14
15
namespace
seqan3
16
{
17
21
struct
ungapped
22
{
24
uint8_t
value
;
25
};
26
30
struct
bin_literal
31
{
33
uint64_t
value
;
34
};
35
55
56
class
shape
:
public
dynamic_bitset
<58>
57
{
58
public
:
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
}
107
108
};
109
110
inline
namespace
literals
111
{
112
121
constexpr
shape
operator
""
_shape(
unsigned
long
long
const
value)
122
{
123
return
shape
{
bin_literal
{value}};
124
}
125
126
127
}
// namespace literals
128
129
}
// namespace seqan3
seqan3::dynamic_bitset< 58 >::dynamic_bitset
friend class dynamic_bitset
Definition
dynamic_bitset.hpp:57
seqan3::dynamic_bitset< 58 >::back
constexpr reference back() noexcept
Definition
dynamic_bitset.hpp:1165
seqan3::dynamic_bitset< 58 >::front
constexpr reference front() noexcept
Definition
dynamic_bitset.hpp:1135
seqan3::shape::shape
constexpr shape(bin_literal const literal) noexcept
Construct from a given seqan3::bin_literal.
Definition
shape.hpp:102
seqan3::shape::shape
constexpr shape() noexcept=default
Defaulted.
dynamic_bitset.hpp
A constexpr bitset implementation with dynamic size at compile time.
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
seqan3::bin_literal
A strong type of underlying type uint64_t that represents the shape in binary representation.
Definition
shape.hpp:31
seqan3::bin_literal::value
uint64_t value
The shape in binary representation.
Definition
shape.hpp:33
seqan3::ungapped
A strong type of underlying type uint8_t that represents the ungapped shape size.
Definition
shape.hpp:22
seqan3::ungapped::value
uint8_t value
The ungapped shape size.
Definition
shape.hpp:24
Hide me
Version:
seqan3
search
kmer_index
shape.hpp
Generated on
for SeqAn3 by
1.17.0