heuristic to improve results with fove

This commit is contained in:
Tiago Gomes 2012-04-19 18:37:15 +01:00
parent 2b7da4bc23
commit 09697b8461

View File

@ -84,7 +84,7 @@ SumOutOperator::getLogCost (void)
++ pfIter;
}
if (nrProdFactors == 1) {
return 1.0; // best possible case
return std::log (1.0); // best possible case
}
double cost = 1.0;
for (unsigned i = 0; i < groupSet.size(); i++) {
@ -252,6 +252,9 @@ CountingOperator::getLogCost (void)
for (unsigned i = 0; i < counts.size(); i++) {
cost += size * HistogramSet::nrHistograms (counts[i], range);
}
if ((*pfIter_)->nrArguments() == 1) {
cost *= 3; // avoid counting conversion in the beginning
}
return std::log (cost);
}