Add comments for AppendGraph and Graph add_incidence()
This commit is contained in:
@@ -52,6 +52,8 @@ impl AppendGraph {
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a single incidence of an edge, which is composed by two such incidences, to the
|
||||
// incidences vector.
|
||||
fn add_incidence(&mut self, v1: Vertex, v2: Vertex) {
|
||||
self.incidences.push(IncidenceEntry {
|
||||
next: self.vertices[v1.0].first_incidence.take(),
|
||||
|
||||
@@ -54,6 +54,8 @@ impl Graph {
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a single incidence of an edge, which is composed by two such incidences, to the
|
||||
// incidences arena, and returns its index.
|
||||
fn add_incidence(&mut self, v1: Vertex, v2: Vertex) -> Edge {
|
||||
let edge = self.incidences.insert(IncidenceEntry {
|
||||
next: self.vertices[v1].first_incidence.take(),
|
||||
|
||||
Reference in New Issue
Block a user