From f4bca3ceea29362cfaf077345603d5bd1cc18985 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Tue, 15 May 2012 19:02:40 +0100 Subject: [PATCH] factor overflow will not happen with bp --- packages/CLPBN/clpbn/bp/BpSolver.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/CLPBN/clpbn/bp/BpSolver.cpp b/packages/CLPBN/clpbn/bp/BpSolver.cpp index c5f812f97..6fe7c4851 100644 --- a/packages/CLPBN/clpbn/bp/BpSolver.cpp +++ b/packages/CLPBN/clpbn/bp/BpSolver.cpp @@ -278,14 +278,10 @@ BpSolver::calculateFactor2VariableMsg (SpLink* link) const SpLinkSet& links = ninf(src)->getLinks(); // calculate the product of messages that were sent // to factor `src', except from var `dst' - Params::size_type msgSize = 1; + unsigned msgSize = 1; for (unsigned i = 0; i < links.size(); i++) { msgSize *= links[i]->getVariable()->range(); } - if (msgSize > Util::maxUnsigned()) { - cout << "error: an overflow occurred when sending bp message" << endl; - abort(); - } unsigned repetitions = 1; Params msgProduct (msgSize, LogAware::multIdenty()); if (Globals::logDomain) {