30 index_upgrader() =
default;
31 index_upgrader(index_upgrader
const &) =
default;
32 index_upgrader(index_upgrader &&) =
default;
33 index_upgrader & operator=(index_upgrader
const &) =
default;
34 index_upgrader & operator=(index_upgrader &&) =
default;
35 ~index_upgrader() =
default;
37 explicit index_upgrader(
upgrade_arguments const & arguments,
size_t const max_count) :
38 index_file{arguments.index_file},
39 output_file{arguments.output_file},
49 cereal::BinaryInputArchive iarchive{is};
53 fpr = compute_fpr(index.ibf().hash_function_count(), max_count, index.ibf().bin_size());
55 std::cout <<
"FPR for " << index_file <<
": " << fpr <<
'\n';
56 index.is_hibf_ =
false;
58 cereal::BinaryOutputArchive oarchive{os};
62 static double compute_fpr(
size_t const hash_fun,
size_t const count,
size_t const bin_size)
64 double const exp_arg = (hash_fun * count) /
static_cast<double>(bin_size);
65 double const log_arg = 1.0 -
std::exp(-exp_arg);