HIBF
1.0.0-rc.1
Toggle main menu visibility
Main Page
Cookbook
About
Changelog
Copyright
Code of Conduct
Contributing
API Reference
API Reference (details)
Concept List
Class List
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
~
Variables
a
b
d
e
f
h
i
k
m
n
o
p
r
s
t
u
v
Typedefs
Related Symbols
File List
File List
File Members
All
Macros
▼
HIBF
Cookbook
►
About
►
API Reference
▼
API Reference (details)
►
Concept List
►
Class List
▼
File List
▼
File List
▼
hibf
►
build
►
cereal
►
layout
▼
misc
bit_vector.hpp
counting_vector.hpp
divide_and_ceil.hpp
insert_iterator.hpp
►
iota_vector.hpp
next_multiple_of_64.hpp
print.hpp
subtract_empty_bins.hpp
timer.hpp
►
unreachable.hpp
►
sketch
all.hpp
config.hpp
hierarchical_interleaved_bloom_filter.hpp
►
interleaved_bloom_filter.hpp
►
platform.hpp
►
version.hpp
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
divide_and_ceil.hpp
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
5
#pragma once
6
7
#include <
cassert
>
// for assert
8
#include <
concepts
>
// for unsigned_integral
9
#include <
cstddef
>
// for size_t
10
#include <
limits
>
// for numeric_limits
11
12
#include <
hibf/platform.hpp
>
13
14
namespace
seqan::hibf
15
{
16
20
template
<std::
unsigned
_
int
egral t1, std::
unsigned
_
int
egral t2>
21
[[nodiscard]]
inline
constexpr
size_t
divide_and_ceil
(t1
const
dividend, t2
const
divisor)
noexcept
22
{
23
assert(divisor > 0u);
24
assert(
std::numeric_limits<size_t>::max
() - divisor + 1u >= dividend);
// Overflow detection
25
return
(
static_cast<
size_t
>
(dividend) + (divisor - 1u)) / divisor;
26
}
21
[[nodiscard]]
inline
constexpr
size_t
divide_and_ceil
(t1
const
dividend, t2
const
divisor)
noexcept
{
…
}
27
28
}
// namespace seqan::hibf
cassert
concepts
cstddef
seqan::hibf::divide_and_ceil
constexpr size_t divide_and_ceil(t1 const dividend, t2 const divisor) noexcept
Returns, for unsigned integral operands, dividend / divisor ceiled to the next integer value.
Definition
divide_and_ceil.hpp:21
limits
std::numeric_limits
platform.hpp
Provides platform and dependency checks.
hibf
misc
divide_and_ceil.hpp
Generated on Mon Mar 17 2025 14:41:03 for HIBF by
1.10.0