use more Util::sizeExpected

This commit is contained in:
Tiago Gomes
2012-05-28 21:27:52 +01:00
parent 54ae29ae02
commit 3ac854b2ff
4 changed files with 14 additions and 15 deletions

View File

@@ -207,9 +207,8 @@ CbpSolver::calcFactorToVarMsg (SpLink* _link)
const SpLinkSet& links = ninf(src)->getLinks();
// calculate the product of messages that were sent
// to factor `src', except from var `dst'
unsigned msgSize = std::accumulate (src->factor().ranges().begin(),
src->factor().ranges().end(), 1, std::multiplies<double>());
unsigned reps = 1;
unsigned msgSize = Util::sizeExpected (src->factor().ranges());
Params msgProduct (msgSize, LogAware::multIdenty());
if (Globals::logDomain) {
for (size_t i = links.size(); i-- > 0; ) {