src/Pure/General/graph.scala
changeset 70699 3eb30d80cee6
parent 70692 41b5e515c238
child 70764 6d36b30fdd67
equal deleted inserted replaced
70698:93aa546ffbac 70699:3eb30d80cee6
   188       (((rep - x) /: preds)(del_adjacent(false, x)) /: succs)(del_adjacent(true, x)))
   188       (((rep - x) /: preds)(del_adjacent(false, x)) /: succs)(del_adjacent(true, x)))
   189   }
   189   }
   190 
   190 
   191   def restrict(pred: Key => Boolean): Graph[Key, A] =
   191   def restrict(pred: Key => Boolean): Graph[Key, A] =
   192     (this /: iterator){ case (graph, (x, _)) => if (!pred(x)) graph.del_node(x) else graph }
   192     (this /: iterator){ case (graph, (x, _)) => if (!pred(x)) graph.del_node(x) else graph }
       
   193 
       
   194   def exclude(pred: Key => Boolean): Graph[Key, A] = restrict(name => !pred(name))
   193 
   195 
   194 
   196 
   195   /* edge operations */
   197   /* edge operations */
   196 
   198 
   197   def edges_iterator: Iterator[(Key, Key)] =
   199   def edges_iterator: Iterator[(Key, Key)] =