Fix a compilation error with older versions of GCC

This commit is contained in:
Tiago Gomes 2013-01-25 13:47:20 +00:00
parent 9dfedafe98
commit bef65dac57
1 changed files with 17 additions and 15 deletions

View File

@ -950,26 +950,28 @@ LiftedCircuit::createSmoothNode (
vector<LogVarTypes> vector<LogVarTypes>
LiftedCircuit::getAllPossibleTypes (unsigned nrLogVars) const LiftedCircuit::getAllPossibleTypes (unsigned nrLogVars) const
{ {
vector<LogVarTypes> res;
if (nrLogVars == 0) { if (nrLogVars == 0) {
return {}; // do nothing
} }
if (nrLogVars == 1) { if (nrLogVars == 1) {
return {{LogVarType::POS_LV},{LogVarType::NEG_LV}}; res.push_back ({ LogVarType::POS_LV });
} res.push_back ({ LogVarType::NEG_LV });
vector<LogVarTypes> res; } else {
Ranges ranges (nrLogVars, 2); Ranges ranges (nrLogVars, 2);
Indexer indexer (ranges); Indexer indexer (ranges);
while (indexer.valid()) { while (indexer.valid()) {
LogVarTypes types; LogVarTypes types;
for (size_t i = 0; i < nrLogVars; i++) { for (size_t i = 0; i < nrLogVars; i++) {
if (indexer[i] == 0) { if (indexer[i] == 0) {
types.push_back (LogVarType::POS_LV); types.push_back (LogVarType::POS_LV);
} else { } else {
types.push_back (LogVarType::NEG_LV); types.push_back (LogVarType::NEG_LV);
}
} }
res.push_back (types);
++ indexer;
} }
res.push_back (types);
++ indexer;
} }
return res; return res;
} }