Module threshold::multiset [−][src]
This module contains an implementation of a multi-set supporting a threshold operation.
The concept of threshold is explained in detail in this blog post.
Examples
use std::iter::FromIterator; use threshold::*; let mut mset = MultiSet::new(); mset.add(vec![(17, 1), (23, 1)]); assert_eq!(mset.threshold(1), vec![&17, &23]); mset.add(vec![(17, 1), (42, 3)]); assert_eq!(mset.threshold(1), vec![&17, &23, &42]); assert_eq!(mset.threshold(2), vec![&17, &42]); assert_eq!(mset.threshold(3), vec![&42]);
Structs
IntoIter | |
MultiSet |