Add concrete type aliases of VertexMap and EdgeMap for Graph and AppendGraph
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
pub mod append_graph;
|
pub mod append_graph;
|
||||||
pub mod graph;
|
pub mod graph;
|
||||||
|
|
||||||
pub use append_graph::AppendGraph;
|
pub use append_graph::{AppendGraph, AppendGraphEdgeMap, AppendGraphVertexMap};
|
||||||
pub use graph::Graph;
|
pub use graph::{Graph, GraphEdgeMap, GraphVertexMap};
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ pub struct Vertex(usize);
|
|||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
pub struct Edge(usize);
|
pub struct Edge(usize);
|
||||||
|
|
||||||
|
pub type AppendGraphVertexMap<T> = VertexMap<Vertex, T>;
|
||||||
|
pub type AppendGraphEdgeMap<T> = EdgeMap<Edge, T>;
|
||||||
|
|
||||||
impl Edge {
|
impl Edge {
|
||||||
fn normalize(&self) -> Self {
|
fn normalize(&self) -> Self {
|
||||||
Self(self.0 & !1)
|
Self(self.0 & !1)
|
||||||
|
|||||||
+3
-1
@@ -4,9 +4,11 @@ use crate::maps::{EdgeMap, VertexMap};
|
|||||||
use crate::traits::{GraphTopology, GraphTopologyDeletion, IncidenceCursor};
|
use crate::traits::{GraphTopology, GraphTopologyDeletion, IncidenceCursor};
|
||||||
|
|
||||||
pub type Vertex = Index<VertexIncidenceHeader, usize, usize>;
|
pub type Vertex = Index<VertexIncidenceHeader, usize, usize>;
|
||||||
|
|
||||||
pub type Edge = Index<IncidenceEntry, usize, usize>;
|
pub type Edge = Index<IncidenceEntry, usize, usize>;
|
||||||
|
|
||||||
|
pub type GraphVertexMap<T> = VertexMap<Vertex, T>;
|
||||||
|
pub type GraphEdgeMap<T> = EdgeMap<Edge, T>;
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
struct VertexSlot(usize);
|
struct VertexSlot(usize);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user