Add GraphTopology::edges() and tests
This commit is contained in:
@@ -102,6 +102,10 @@ impl GraphTopology for AppendGraph {
|
||||
}
|
||||
}
|
||||
|
||||
fn edges(&self) -> impl Iterator<Item = Self::Edge> {
|
||||
(0..self.incidences.len()).step_by(2).map(Incidence)
|
||||
}
|
||||
|
||||
fn add_vertex(&mut self) -> Self::Vertex {
|
||||
self.vertices.push(VertexIncidenceHeader {
|
||||
incidence_count: 0,
|
||||
|
||||
Reference in New Issue
Block a user