# HG changeset patch # User blanchet # Date 1355152804 -3600 # Node ID b00823a7445056191b9a65e9030158a0f5bd3e08 # Parent 52ec07a7f30489499920e545f94a8c8c6fd11340# Parent 75e00ff42870551870c9727a663ebad19d9dacb7 merge diff -r 52ec07a7f304 -r b00823a74450 src/Pure/General/graph.scala --- a/src/Pure/General/graph.scala Mon Dec 10 13:33:06 2012 +0100 +++ b/src/Pure/General/graph.scala Mon Dec 10 16:20:04 2012 +0100 @@ -224,17 +224,16 @@ /* transitive closure and reduction */ - def transitive_closure: Graph[Key, A] = + private def transitive_step(z: Key): Graph[Key, A] = { + val (preds, succs) = get_entry(z)._2 var graph = this - for { - (_, (_, (preds, succs))) <- this.entries - x <- preds - y <- succs - } graph = graph.add_edge(x, y) + for (x <- preds; y <- succs) graph = graph.add_edge(x, y) graph } + def transitive_closure: Graph[Key, A] = (this /: keys)(_.transitive_step(_)) + def transitive_reduction_acyclic: Graph[Key, A] = { val trans = this.transitive_closure