Add a way to list the base non-transitive edges in TransitiveRelation

This commit is contained in:
Remy Rakic 2019-11-19 16:53:52 +01:00
parent 479cc7ae9a
commit 4b16ae1609

View File

@ -373,6 +373,14 @@ fn compute_closure(&self) -> BitMatrix<usize, usize> {
}
matrix
}
/// Lists all the base edges in the graph: the initial _non-transitive_ set of element
/// relations, which will be later used as the basis for the transitive closure computation.
pub fn base_edges(&self) -> impl Iterator<Item=(&T, &T)> {
self.edges
.iter()
.map(move |edge| (&self.elements[edge.source.0], &self.elements[edge.target.0]))
}
}
/// Pare down is used as a step in the LUB computation. It edits the