From 9a8079028ee343ac4dbe089d6d888b55b4a64744 Mon Sep 17 00:00:00 2001 From: Mate Soos Date: Wed, 10 Jan 2024 22:31:47 +0100 Subject: [PATCH] Revert "What was this code... strange" This reverts commit 87cde31c33f1a7552b2f566104987990abcb4d08. --- src/counter.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/counter.cpp b/src/counter.cpp index a07567f..53e5de6 100644 --- a/src/counter.cpp +++ b/src/counter.cpp @@ -448,9 +448,18 @@ ApproxMC::SolCount Counter::count() ApproxMC::SolCount Counter::calc_est_count() { ApproxMC::SolCount ret_count; - if (numHashList.empty() || numCountList.empty()) return ret_count; + if (numHashList.empty() || numCountList.empty()) { + return ret_count; + } const auto minHash = findMin(numHashList); + auto cnt_it = numCountList.begin(); + for (auto hash_it = numHashList.begin() + ; hash_it != numHashList.end() && cnt_it != numCountList.end() + ; hash_it++, cnt_it++ + ) { + *cnt_it *= pow(2, (*hash_it) - minHash); + } ret_count.valid = true; ret_count.cellSolCount = findMedian(numCountList); ret_count.hashCount = minHash;