[][src]Type Definition rs_graph::vec::EdgeVec

type EdgeVec<'a, G, T> = ItemVec<EdgeIndexer<'a, G>, T>;

A vector containing a value for each edge.

Example

Create a vector with all elements set to some value.

let g = peterson::<LinkedListGraph>();
let weights = rs_graph::EdgeVec::new(&g, 0);
assert!(g.edges().all(|e| weights[e] == 0));

Create a vector with all values initialized by an initializing function.

let g = peterson::<LinkedListGraph>();
let weights = rs_graph::vec::EdgeVec::new_with(&g, |e| g.edge_id(e));
assert!(g.edges().all(|e| weights[e] == g.edge_id(e)));