sort the variable ids when printing all posterioris

This commit is contained in:
Tiago Gomes 2012-04-23 22:12:04 +01:00
parent d90fcd532b
commit 3397f694fe

View File

@ -29,9 +29,14 @@ Solver::printAnswer (const VarIds& vids)
void void
Solver::printAllPosterioris (void) Solver::printAllPosterioris (void)
{ {
VarIds vids;
const VarNodes& vars = fg.varNodes(); const VarNodes& vars = fg.varNodes();
for (unsigned i = 0; i < vars.size(); i++) { for (unsigned i = 0; i < vars.size(); i++) {
printAnswer ({vars[i]->varId()}); vids.push_back (vars[i]->varId());
}
std::sort (vids.begin(), vids.end());
for (unsigned i = 0; i < vids.size(); i++) {
printAnswer ({vids[i]});
} }
} }