HIBF 1.0.0-rc.1
Loading...
Searching...
No Matches
add_empty_bins.hpp
1// SPDX-FileCopyrightText: 2006-2026, Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2026, Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
5#pragma once
6
7#include <cmath> // for floor
8#include <cstddef> // for size_t
9
10#include <hibf/platform.hpp>
11
12namespace seqan::hibf
13{
14
20[[nodiscard]] constexpr size_t add_empty_bins(size_t const tmax, double const fraction) noexcept
21{
22 return std::floor(tmax / (1.0 - fraction));
23}
24
25} // namespace seqan::hibf
T floor(T... args)
constexpr size_t add_empty_bins(size_t const tmax, double const fraction) noexcept
Returns the total number of bins such that a fraction of bins is empty, and tmax many bins are non-em...
Definition add_empty_bins.hpp:20
Provides platform and dependency checks.