Diff of /src/lib/graph/Graph.cc [0513cd] .. [1991be] Maximize Restore

  Switch to side-by-side view

--- a/src/lib/graph/Graph.cc
+++ b/src/lib/graph/Graph.cc
@@ -63,7 +63,7 @@
    if node has any children in set S */
 
 
-static bool childInSet(Node *node, set<Node*, ltNode> const &S)
+static bool childInSet(Node *node, set<Node*> const &S)
 {
     for (set<StochasticNode *>::const_iterator j = node->stochasticChildren()->begin(); 
 	 j != node->stochasticChildren()->end(); ++j) 
@@ -83,7 +83,7 @@
 }
 
 
-void Graph::getSortedNodes(set<Node*, ltNode> &S, vector<Node*> &sortednodes) 
+void Graph::getSortedNodes(set<Node*> &S, vector<Node*> &sortednodes) 
 {
     //Return a vector of nodes whose ordering follows the partial
     //ordering of the set.  If a is after b then there is never a
@@ -99,7 +99,7 @@
 
 	bool loopcheck = false;
 
-	set<Node*, ltNode>::iterator i = S.begin();
+	set<Node*>::iterator i = S.begin();
 	while (i != S.end()) {
 	    if (childInSet(*i, S)) {
 		++i;
@@ -107,7 +107,7 @@
 	    else {
 		loopcheck = true;
 		sortednodes.push_back(*i);
-		set<Node*, ltNode>::iterator j = i;
+		set<Node*>::iterator j = i;
 		++i;
 		S.erase(j);
 	    }
@@ -153,29 +153,8 @@
 //FIXME: This should be redundant now
 void Graph::getSortedNodes(vector<Node*> &sortednodes) const
 {
-    set<Node*, ltNode> S = *this;
+    set<Node*> S = *this;
     getSortedNodes(S, sortednodes);
-    /*
-    //Yes this is slow but its for debugging purposes
-    for(unsigned int i = 0; i < sortednodes.size(); ++i) {
-	for (unsigned int j = i+1; j < sortednodes.size(); ++j) {
-	    if (sortednodes[j]->index() == sortednodes[i]->index()) {
-		// This should never happen
-		throw logic_error("Non-unique index in Graph::getSortedNodes");
-	    }
-	    if (sortednodes[j]->index() < sortednodes[i]->index()) {
-		// We can have two nodes out of order, but only if there is no path between them 
-		if (pathTo(sortednodes[i], sortednodes[j], *this)) {
-		    throw logic_error("Graph::getSortedNodes out of order");
-		}
-		if (pathTo(sortednodes[j], sortednodes[i], *this)) {
-		    throw logic_error("Graph::getSortedNodes out of order");
-		}
-	    }
-	}
-    }
-    */
-
 }