factor overflow will not happen with bp
This commit is contained in:
parent
7ec4887e77
commit
f4bca3ceea
@ -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) {
|
||||
|
Reference in New Issue
Block a user