From bef65dac57db6478f45bdd1f96c94128ab9b12ef Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Fri, 25 Jan 2013 13:47:20 +0000 Subject: [PATCH] Fix a compilation error with older versions of GCC --- packages/CLPBN/horus/LiftedKc.cpp | 32 ++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/CLPBN/horus/LiftedKc.cpp b/packages/CLPBN/horus/LiftedKc.cpp index c366c282d..baf8b5fed 100644 --- a/packages/CLPBN/horus/LiftedKc.cpp +++ b/packages/CLPBN/horus/LiftedKc.cpp @@ -950,26 +950,28 @@ LiftedCircuit::createSmoothNode ( vector LiftedCircuit::getAllPossibleTypes (unsigned nrLogVars) const { + vector res; if (nrLogVars == 0) { - return {}; + // do nothing } if (nrLogVars == 1) { - return {{LogVarType::POS_LV},{LogVarType::NEG_LV}}; - } - vector res; - Ranges ranges (nrLogVars, 2); - Indexer indexer (ranges); - while (indexer.valid()) { - LogVarTypes types; - for (size_t i = 0; i < nrLogVars; i++) { - if (indexer[i] == 0) { - types.push_back (LogVarType::POS_LV); - } else { - types.push_back (LogVarType::NEG_LV); + res.push_back ({ LogVarType::POS_LV }); + res.push_back ({ LogVarType::NEG_LV }); + } else { + Ranges ranges (nrLogVars, 2); + Indexer indexer (ranges); + while (indexer.valid()) { + LogVarTypes types; + for (size_t i = 0; i < nrLogVars; i++) { + if (indexer[i] == 0) { + types.push_back (LogVarType::POS_LV); + } else { + types.push_back (LogVarType::NEG_LV); + } } + res.push_back (types); + ++ indexer; } - res.push_back (types); - ++ indexer; } return res; }