From 20fc2c8dd1fc5b86792a101208fa881895cede43 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Fri, 27 Apr 2012 14:48:48 +0100 Subject: [PATCH] add debug information to variable elimination --- packages/CLPBN/clpbn/bp/VarElimSolver.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/CLPBN/clpbn/bp/VarElimSolver.cpp b/packages/CLPBN/clpbn/bp/VarElimSolver.cpp index 1c00ff0df..55399609b 100644 --- a/packages/CLPBN/clpbn/bp/VarElimSolver.cpp +++ b/packages/CLPBN/clpbn/bp/VarElimSolver.cpp @@ -109,6 +109,12 @@ void VarElimSolver::processFactorList (const VarIds& vids) { for (unsigned i = 0; i < elimOrder_.size(); i++) { + if (Constants::DEBUG >= 3) { + printActiveFactors(); + cout << "-> summing out " ; + VarNode* vn = fg.getVarNode (elimOrder_[i]); + cout << vn->label() << endl; + } eliminate (elimOrder_[i]); } @@ -169,10 +175,14 @@ VarElimSolver::eliminate (VarId elimVar) void VarElimSolver::printActiveFactors (void) { + cout << endl; + Util::printDashedLine(); for (unsigned i = 0; i < factorList_.size(); i++) { if (factorList_[i] != 0) { - factorList_[i]->print(); + cout << factorList_[i]->getLabel() << " " ; + cout << factorList_[i]->params() << endl; } } + cout << endl; }