Function fera_graph::min_prop
[−]
[src]
pub fn min_prop<P, K, I>(prop: P, iter: I) -> Option<P::Output> where
I: IntoIterator,
I::Item: IntoOwned<K>,
P: PropGet<K>,
P::Output: Ord,
Returns the minimum property value associated with the iterator's items or None
if the
iterator is empty.
Example
use fera_graph::prelude::*; use fera_graph::min_prop; let g = CompleteGraph::new(3); let mut w = g.default_vertex_prop(0u32); w[0] = 5; w[1] = 10; w[2] = 4; assert_eq!(Some(4), min_prop(&w, g.vertices())); assert_eq!(None, min_prop(&w, g.vertices().take(0))); assert_eq!(Some(5), min_prop(&w, &[1, 0]));