Rename EntityMap to ElementMap (tests not yet updated)

This commit is contained in:
2026-08-06 23:01:10 +02:00
parent 7d8c9aaa10
commit a7346bd782
9 changed files with 58 additions and 58 deletions
+9 -9
View File
@@ -2,7 +2,7 @@
use typed_generational_arena::{Arena, Index};
use crate::maps::EntityMap;
use crate::maps::ElementMap;
use crate::traits::{
GraphTopology, GraphTopologyAddition, GraphTopologyDeletion, Incidence, IncidenceCursor,
};
@@ -19,11 +19,11 @@ pub type Vertex = Index<VertexIncidenceHeader, usize, usize>;
/// deleted. Obtain via graph methods like [`Graph::add_edge`] and [`Graph::edges`].
pub type Edge = Index<IncidenceEntry, usize, usize>;
/// An [`EntityMap`] for [`Graph`] vertices.
pub type GraphVertexMap<T> = EntityMap<Vertex, T>;
/// An [`ElementMap`] for [`Graph`] vertices.
pub type GraphVertexMap<T> = ElementMap<Vertex, T>;
/// An [`EntityMap`] for [`Graph`] edges.
pub type GraphEdgeMap<T> = EntityMap<Edge, T>;
/// An [`ElementMap`] for [`Graph`] edges.
pub type GraphEdgeMap<T> = ElementMap<Edge, T>;
/// An [`Incidence`] for [`Graph`].
pub type GraphIncidence = Incidence<Vertex, Edge>;
@@ -241,16 +241,16 @@ impl GraphTopology for Graph {
self.vertices.len()
}
fn vertex_map<T: Clone>(&self, default: T) -> EntityMap<Self::Vertex, T> {
EntityMap::new(default, |v| v.arr_idx(), self.vertex_capacity())
fn vertex_map<T: Clone>(&self, default: T) -> ElementMap<Self::Vertex, T> {
ElementMap::new(default, |v| v.arr_idx(), self.vertex_capacity())
}
fn edge_count(&self) -> usize {
self.incidences.len() / 2
}
fn edge_map<T: Clone>(&self, default: T) -> EntityMap<Self::Edge, T> {
EntityMap::new(default, |e| e.arr_idx() / 2, self.edge_capacity())
fn edge_map<T: Clone>(&self, default: T) -> ElementMap<Self::Edge, T> {
ElementMap::new(default, |e| e.arr_idx() / 2, self.edge_capacity())
}
fn degree(&self, v: Self::Vertex) -> usize {