Skip to content

Commit

Permalink
Revert "What was this code... strange"
Browse files Browse the repository at this point in the history
This reverts commit 87cde31.
  • Loading branch information
msoos committed Jan 10, 2024
1 parent 87cde31 commit 9a80790
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9a80790

Please sign in to comment.