Skip to content

Commit 44c7989

Browse files
koleoptileseiler
andauthored
[FIX] Todos (#213)
* fixed TODOs * Apply suggestions from code review * Update src/ibf.cpp --------- Co-authored-by: Enrico Seiler <eseiler@users.noreply.github.com>
1 parent 095c7df commit 44c7989

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/ibf.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -418,19 +418,10 @@ void ibf_helper(std::vector<std::filesystem::path> const & minimiser_files,
418418
for (size_t i = 0; i < num_files; i++)
419419
{
420420
// Calculate actual FPR based on IBF parameters
421-
// TODO: Why this case?
422-
if (counts_per_level[i][j] > 0 && sizes_ibf[j] > 0)
423-
{
424-
double const exp_arg = (num_hash * counts_per_level[i][j]) / static_cast<double>(sizes_ibf[j]);
425-
double const log_arg = 1.0 - std::exp(-exp_arg);
426-
// TODO: Why this ternary?
427-
double const fpr = (log_arg > 0) ? std::exp(num_hash * std::log(log_arg)) : 1.0;
428-
outfile << fpr << " ";
429-
}
430-
else
431-
{
432-
outfile << "0.0 ";
433-
}
421+
double const exp_arg = (num_hash * counts_per_level[i][j]) / static_cast<double>(sizes_ibf[j]);
422+
double const log_arg = 1.0 - std::exp(-exp_arg);
423+
double const fpr = std::exp(num_hash * std::log(log_arg));
424+
outfile << fpr << " ";
434425
}
435426
outfile << "\n";
436427
}

0 commit comments

Comments
 (0)