return newMessages;
}
Factor msgProduct (RegionEdge edge)
{
Factor product = new LogTableFactor (edge.from.vars);
for (Iterator it = edge.neighboringParents.iterator (); it.hasNext ();) {
RegionEdge otherEdge = (RegionEdge) it.next ();
Factor otherMsg = oldMessages.getMessage (otherEdge.from, otherEdge.to);
product.multiplyBy (otherMsg);
}
for (Iterator it = edge.loopingMessages.iterator (); it.hasNext ();) {
RegionEdge otherEdge = (RegionEdge) it.next ();
Factor otherMsg = newMessages.getMessage (otherEdge.from, otherEdge.to);
product.divideBy (otherMsg);
}
return product;
}