Function fera_graph::max_prop [] [src]

pub fn max_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 maximum property value associated with the iterator's items or None if the iterator is empty.

Example

use fera_graph::prelude::*;
use fera_graph::max_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(10), max_prop(&w, g.vertices()));
assert_eq!(None, max_prop(&w, g.vertices().take(0)));
assert_eq!(Some(5), max_prop(&w, &[2, 0]));