12#include <hibf/build/bin_size_in_bits.hpp>
13#include <hibf/build/build_data.hpp>
14#include <hibf/contrib/robin_hood.hpp>
15#include <hibf/layout/graph.hpp>
16#include <hibf/misc/divide_and_ceil.hpp>
19 robin_hood::unordered_flat_set<uint64_t>
const & kmers)
21 parent_kmers.insert(kmers.begin(), kmers.end());
27 robin_hood::unordered_flat_set<uint64_t> & kmers,
28 size_t const number_of_bins,
29 seqan::hibf::layout::graph::node
const & ibf_node,
30 seqan::hibf::build::build_data & data,
31 size_t const current_hibf_level)
33 bool const max_bin_is_merged = ibf_node.max_bin_is_merged();
34 assert(!max_bin_is_merged || number_of_bins == 1u);
36 size_t const kmers_per_bin = seqan::hibf::divide_and_ceil(kmers.size(), number_of_bins);
37 double const fpr = max_bin_is_merged ? data.config.relaxed_fpr : data.config.maximum_fpr;
39 size_t const bin_bits{seqan::hibf::build::bin_size_in_bits({.fpr = fpr,
40 .hash_count = data.config.number_of_hash_functions,
41 .elements = kmers_per_bin})};
44 size_t const bin_size{number_of_bins == 1u
46 :
static_cast<size_t>(std::ceil(bin_bits * data.fpr_correction[number_of_bins]))};
48 size_t const ibf_size = ibf_node.number_of_technical_bins * bin_size;
50 if (current_hibf_level > 0 )
size_t compute_ibf_size(robin_hood::unordered_flat_set< uint64_t > &parent_kmers, robin_hood::unordered_flat_set< uint64_t > &kmers, size_t const number_of_bins, seqan::hibf::layout::graph::node const &ibf_node, seqan::hibf::build::build_data &data, size_t const current_hibf_level)
Definition: compute_ibf_size.hpp:26
void update_parent_kmers(robin_hood::unordered_flat_set< uint64_t > &parent_kmers, robin_hood::unordered_flat_set< uint64_t > const &kmers)
Definition: compute_ibf_size.hpp:18