prefix is better than postfix
This commit is contained in:
parent
a9c369aac1
commit
250d122fc8
@ -64,7 +64,7 @@ BayesBall::scheduleParents (const DAGraphNode* n, Scheduling& sch) const
|
||||
{
|
||||
const vector<DAGraphNode*>& ps = n->parents();
|
||||
for (vector<DAGraphNode*>::const_iterator it = ps.begin();
|
||||
it != ps.end(); it++) {
|
||||
it != ps.end(); ++it) {
|
||||
sch.push (ScheduleInfo (*it, false, true));
|
||||
}
|
||||
}
|
||||
@ -76,7 +76,7 @@ BayesBall::scheduleChilds (const DAGraphNode* n, Scheduling& sch) const
|
||||
{
|
||||
const vector<DAGraphNode*>& cs = n->childs();
|
||||
for (vector<DAGraphNode*>::const_iterator it = cs.begin();
|
||||
it != cs.end(); it++) {
|
||||
it != cs.end(); ++it) {
|
||||
sch.push (ScheduleInfo (*it, true, false));
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ BpSolver::maxResidualSchedule (void)
|
||||
if (Globals::verbosity > 1) {
|
||||
cout << "current residuals:" << endl;
|
||||
for (SortedOrder::iterator it = sortedOrder_.begin();
|
||||
it != sortedOrder_.end(); it ++) {
|
||||
it != sortedOrder_.end(); ++it) {
|
||||
cout << " " << setw (30) << left << (*it)->toString();
|
||||
cout << "residual = " << (*it)->getResidual() << endl;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ CFactorGraph::createGroups (void)
|
||||
it->second.push_back (varNodes[i]);
|
||||
}
|
||||
for (VarSignMap::iterator it = varGroups.begin();
|
||||
it != varGroups.end(); it++) {
|
||||
it != varGroups.end(); ++it) {
|
||||
Color newColor = getFreeColor();
|
||||
VarNodes& groupMembers = it->second;
|
||||
for (size_t i = 0; i < groupMembers.size(); i++) {
|
||||
@ -146,7 +146,7 @@ CFactorGraph::createGroups (void)
|
||||
it->second.push_back (facNodes[i]);
|
||||
}
|
||||
for (FacSignMap::iterator it = facGroups.begin();
|
||||
it != facGroups.end(); it++) {
|
||||
it != facGroups.end(); ++it) {
|
||||
Color newColor = getFreeColor();
|
||||
FacNodes& groupMembers = it->second;
|
||||
for (size_t i = 0; i < groupMembers.size(); i++) {
|
||||
@ -170,7 +170,7 @@ CFactorGraph::createClusters (
|
||||
{
|
||||
varClusters_.reserve (varGroups.size());
|
||||
for (VarSignMap::const_iterator it = varGroups.begin();
|
||||
it != varGroups.end(); it++) {
|
||||
it != varGroups.end(); ++it) {
|
||||
const VarNodes& groupVars = it->second;
|
||||
VarCluster* vc = new VarCluster (groupVars);
|
||||
for (size_t i = 0; i < groupVars.size(); i++) {
|
||||
@ -181,7 +181,7 @@ CFactorGraph::createClusters (
|
||||
|
||||
facClusters_.reserve (facGroups.size());
|
||||
for (FacSignMap::const_iterator it = facGroups.begin();
|
||||
it != facGroups.end(); it++) {
|
||||
it != facGroups.end(); ++it) {
|
||||
FacNode* groupFactor = it->second[0];
|
||||
const VarNodes& neighs = groupFactor->neighbors();
|
||||
VarClusters varClusters;
|
||||
@ -289,7 +289,7 @@ CFactorGraph::printGroups (
|
||||
unsigned count = 1;
|
||||
cout << "variable groups:" << endl;
|
||||
for (VarSignMap::const_iterator it = varGroups.begin();
|
||||
it != varGroups.end(); it++) {
|
||||
it != varGroups.end(); ++it) {
|
||||
const VarNodes& groupMembers = it->second;
|
||||
if (groupMembers.size() > 0) {
|
||||
cout << count << ": " ;
|
||||
@ -303,7 +303,7 @@ CFactorGraph::printGroups (
|
||||
count = 1;
|
||||
cout << endl << "factor groups:" << endl;
|
||||
for (FacSignMap::const_iterator it = facGroups.begin();
|
||||
it != facGroups.end(); it++) {
|
||||
it != facGroups.end(); ++it) {
|
||||
const FacNodes& groupMembers = it->second;
|
||||
if (groupMembers.size() > 0) {
|
||||
cout << ++count << ": " ;
|
||||
|
@ -144,7 +144,7 @@ CbpSolver::maxResidualSchedule (void)
|
||||
if (Globals::verbosity > 1) {
|
||||
cout << endl << "current residuals:" << endl;
|
||||
for (SortedOrder::iterator it = sortedOrder_.begin();
|
||||
it != sortedOrder_.end(); it ++) {
|
||||
it != sortedOrder_.end(); ++it) {
|
||||
cout << " " << setw (30) << left << (*it)->toString();
|
||||
cout << "residual = " << (*it)->getResidual() << endl;
|
||||
}
|
||||
|
@ -103,12 +103,12 @@ class TFactor
|
||||
Params::iterator it = params_.begin();
|
||||
MapIndexer indexer (args_, ranges_, g_args, g_ranges);
|
||||
if (Globals::logDomain) {
|
||||
for (; indexer.valid(); ++indexer) {
|
||||
*it++ += g_params[indexer];
|
||||
for (; indexer.valid(); ++it, ++indexer) {
|
||||
*it += g_params[indexer];
|
||||
}
|
||||
} else {
|
||||
for (; indexer.valid(); ++indexer) {
|
||||
*it++ *= g_params[indexer];
|
||||
for (; indexer.valid(); ++it, ++indexer) {
|
||||
*it *= g_params[indexer];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -784,7 +784,7 @@ FoveSolver::runSolver (const Grounds& query)
|
||||
assert (pfList_.size() > 0);
|
||||
if (pfList_.size() > 1) {
|
||||
ParfactorList::iterator pfIter = pfList_.begin();
|
||||
pfIter ++;
|
||||
++ pfIter;
|
||||
while (pfIter != pfList_.end()) {
|
||||
(*pfList_.begin())->multiply (**pfIter);
|
||||
++ pfIter;
|
||||
|
@ -36,7 +36,7 @@ printSymbolDictionary (void)
|
||||
= symbolDict.begin();
|
||||
while (it != symbolDict.end()) {
|
||||
cout << it->first << " -> " << it->second << endl;
|
||||
it ++;
|
||||
++ it;
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ ostream& operator<< (ostream &os, const Symbol& s)
|
||||
unordered_map<string, unsigned>::const_iterator it
|
||||
= LiftedUtils::symbolDict.begin();
|
||||
while (it != LiftedUtils::symbolDict.end() && it->second != s) {
|
||||
it ++;
|
||||
++ it;
|
||||
}
|
||||
assert (it != LiftedUtils::symbolDict.end());
|
||||
os << it->first;
|
||||
@ -108,7 +108,7 @@ Substitution::getDiscardedLogVars (void) const
|
||||
} else {
|
||||
doneLvs.insert (it->second);
|
||||
}
|
||||
it ++;
|
||||
++ it;
|
||||
}
|
||||
return discardedLvs;
|
||||
}
|
||||
|
@ -559,7 +559,7 @@ void
|
||||
ParfactorList::updateGroups (PrvGroup oldGroup, PrvGroup newGroup)
|
||||
{
|
||||
for (ParfactorList::iterator it = pfList_.begin();
|
||||
it != pfList_.end(); it++) {
|
||||
it != pfList_.end(); ++it) {
|
||||
ProbFormulas& formulas = (*it)->arguments();
|
||||
for (size_t i = 0; i < formulas.size(); i++) {
|
||||
if (formulas[i].group() == oldGroup) {
|
||||
|
Reference in New Issue
Block a user