watch out for division by 0 in message calculation for BP

This commit is contained in:
Tiago Gomes
2012-09-30 22:04:44 +01:00
parent fec0bd44b4
commit 559b3e3b54
2 changed files with 7 additions and 5 deletions

View File

@@ -275,7 +275,7 @@ void
WeightedBp::printLinkInformation (void) const
{
for (size_t i = 0; i < links_.size(); i++) {
WeightedLink* l = static_cast<WeightedLink*> (links_[i]);
WeightedLink* l = static_cast<WeightedLink*> (links_[i]);
cout << l->toString() << ":" << endl;
cout << " curr msg = " << l->message() << endl;
cout << " next msg = " << l->nextMessage() << endl;