Replace VertexMap and EdgeMap with now public EntityMap
This commit is contained in:
+7
-7
@@ -1,13 +1,13 @@
|
||||
use typed_generational_arena::{Arena, Index};
|
||||
|
||||
use crate::maps::{EdgeMap, VertexMap};
|
||||
use crate::maps::EntityMap;
|
||||
use crate::traits::{GraphTopology, GraphTopologyDeletion, IncidenceCursor};
|
||||
|
||||
pub type Vertex = Index<VertexIncidenceHeader, usize, usize>;
|
||||
pub type Edge = Index<IncidenceEntry, usize, usize>;
|
||||
|
||||
pub type GraphVertexMap<T> = VertexMap<Vertex, T>;
|
||||
pub type GraphEdgeMap<T> = EdgeMap<Edge, T>;
|
||||
pub type GraphVertexMap<T> = EntityMap<Vertex, T>;
|
||||
pub type GraphEdgeMap<T> = EntityMap<Edge, T>;
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
struct VertexSlot(usize);
|
||||
@@ -163,8 +163,8 @@ impl GraphTopology for Graph {
|
||||
self.vertices.capacity()
|
||||
}
|
||||
|
||||
fn vertex_map<T: Clone>(&self, default: T) -> VertexMap<Self::Vertex, T> {
|
||||
VertexMap::new(default, |v| v.arr_idx(), self.vertex_capacity())
|
||||
fn vertex_map<T: Clone>(&self, default: T) -> EntityMap<Self::Vertex, T> {
|
||||
EntityMap::new(default, |v| v.arr_idx(), self.vertex_capacity())
|
||||
}
|
||||
|
||||
fn edge_count(&self) -> usize {
|
||||
@@ -175,8 +175,8 @@ impl GraphTopology for Graph {
|
||||
self.incidences.capacity() / 2
|
||||
}
|
||||
|
||||
fn edge_map<T: Clone>(&self, default: T) -> EdgeMap<Self::Edge, T> {
|
||||
EdgeMap::new(default, |e| e.arr_idx() / 2, self.edge_capacity())
|
||||
fn edge_map<T: Clone>(&self, default: T) -> EntityMap<Self::Edge, T> {
|
||||
EntityMap::new(default, |e| e.arr_idx() / 2, self.edge_capacity())
|
||||
}
|
||||
|
||||
fn degree(&self, v: Self::Vertex) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user