use std::collections::HashMap; /// Constructs a hash map from a slice. pub fn hash_map(slice: &[(K, V)]) -> HashMap where K: Clone + Eq + std::hash::Hash + PartialEq, V: Clone, { slice.iter().cloned().collect() } /// Selects upper bounds from decision space. pub fn upper_bounds(bounds: &[(T, T)]) -> Vec where T: Copy, { bounds.iter().map(|&(_, m)| m).collect() }