Add a way to list the base non-transitive edges in TransitiveRelation
This commit is contained in:
parent
479cc7ae9a
commit
4b16ae1609
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user