Type Definition rs_graph::vec::NodeVec [−][src]
type NodeVec<'g, G, T> = ItemVec<NodeIndexer<'g, G>, T>;
A vector containing a value for each node.
Example
Create a vector with all elements set to some value.
let g = peterson::<LinkedListGraph>(); let weights = rs_graph::vec::NodeVec::new(&g, 0); assert!(g.nodes().all(|u| weights[u] == 0));
Create a vector with an initialization function.
let g = peterson::<LinkedListGraph>(); let weights = rs_graph::vec::NodeVec::new_with(&g, |u| g.node_id(u)); assert!(g.nodes().all(|u| weights[u] == g.node_id(u)));