*
* @param clique1
* @param clique2
*/
protected void absorb(Clique clique1, Clique clique2) {
Separator separator = getSeparator(clique1, clique2);
super.absorb(clique1, clique2);
// clique1.absorb(clique2, separator.getPotentialTable());
ArrayList<Node> toDie = SetToolkit.clone(clique2.getNodes());
toDie.removeAll(separator.getNodes());
PotentialTable originalSeparatorUtilityTable = (PotentialTable) separator.getUtilityTable().clone();
PotentialTable dummyTable = (PotentialTable) clique2.getUtilityTable().clone();
dummyTable.directOpTab(clique2.getPotentialTable(), PotentialTable.PRODUCT_OPERATOR);
for (int i = 0; i < toDie.size(); i++) {
dummyTable.removeVariable(toDie.get(i));
}
for (int i = separator.getUtilityTable().tableSize()-1; i >= 0; i--) {
separator.getUtilityTable().setValue(i, dummyTable.getValue(i));
}
separator.getUtilityTable().directOpTab(separator.getPotentialTable(), PotentialTable.DIVISION_OPERATOR);
dummyTable = (PotentialTable) separator.getUtilityTable().clone();
dummyTable.directOpTab(originalSeparatorUtilityTable, PotentialTable.MINUS_OPERATOR);
clique1.getUtilityTable().opTab(dummyTable, PotentialTable.PLUS_OPERATOR);
}