[][src]Trait math::iter::common_refinement_zip::CommonRefinementZip

pub trait CommonRefinementZip<B, X, P, V> where
    B: Copy + Num + Ord,
    Self: Iterator<Item = X> + Sized,
    P: Clone + Interval<B> + for<'b> Intersect<&'b P, Option<P>>, 
{ fn get_interval_value_extractor(&self) -> Box<dyn Fn(Self::Item) -> (P, V)>; fn common_refinement_zip(
        self,
        other: Self
    ) -> CommonRefinementZipped<B, Self, X, P, V>

Important traits for CommonRefinementZipped<B, I, X, P, V>

impl<B, I, X, P, V> Iterator for CommonRefinementZipped<B, I, X, P, V> where
    B: Copy + Num + Ord,
    I: Iterator<Item = X> + Sized,
    P: Clone + Interval<B> + for<'b> Intersect<&'b P, Option<P>>,
    V: Clone
type Item = (P, Vec<Option<V>>);
{ ... } }

Required methods

fn get_interval_value_extractor(&self) -> Box<dyn Fn(Self::Item) -> (P, V)>

Loading content...

Provided methods

fn common_refinement_zip(
    self,
    other: Self
) -> CommonRefinementZipped<B, Self, X, P, V>

Important traits for CommonRefinementZipped<B, I, X, P, V>

impl<B, I, X, P, V> Iterator for CommonRefinementZipped<B, I, X, P, V> where
    B: Copy + Num + Ord,
    I: Iterator<Item = X> + Sized,
    P: Clone + Interval<B> + for<'b> Intersect<&'b P, Option<P>>,
    V: Clone
type Item = (P, Vec<Option<V>>);

Loading content...

Implementations on Foreign Types

impl<'a, V, B: Integer + Copy + ToPrimitive> CommonRefinementZip<B, (&'a ContiguousIntegerSet<B>, &'a V), ContiguousIntegerSet<B>, V> for Iter<'a, IntInterval<B>, V> where
    B: 'a,
    V: 'a + Clone
[src]

Example

use analytic::{
    interval::{traits::Interval, IntInterval},
    iter::CommonRefinementZip,
};
use std::collections::BTreeMap;

let m1: BTreeMap<IntInterval<usize>, i32> =
    vec![(IntInterval::new(0, 5), 5), (IntInterval::new(8, 10), 2)]
        .into_iter()
        .collect();

let m2: BTreeMap<IntInterval<usize>, i32> =
    vec![(IntInterval::new(2, 4), 8), (IntInterval::new(12, 13), 9)]
        .into_iter()
        .collect();

let mut iter = m1.iter().common_refinement_zip(m2.iter());
assert_eq!(
    Some((IntInterval::new(0, 1), vec![Some(5), None])),
    iter.next()
);
assert_eq!(
    Some((IntInterval::new(2, 4), vec![Some(5), Some(8)])),
    iter.next()
);
assert_eq!(
    Some((IntInterval::new(5, 5), vec![Some(5), None])),
    iter.next()
);
assert_eq!(
    Some((IntInterval::new(8, 10), vec![Some(2), None])),
    iter.next()
);
assert_eq!(
    Some((IntInterval::new(12, 13), vec![None, Some(9)])),
    iter.next()
);
assert_eq!(None, iter.next());

impl<'a, V, B: Integer + Copy + ToPrimitive> CommonRefinementZip<B, (ContiguousIntegerSet<B>, V), ContiguousIntegerSet<B>, V> for IntoIter<IntInterval<B>, V> where
    B: 'a, 
[src]

Loading content...

Implementors

impl<I, V> CommonRefinementZip<i64, (ContiguousIntegerSet<i64>, V), ContiguousIntegerSet<i64>, V> for BinnedIntervalIter<I, V> where
    I: Iterator,
    V: Copy + Num + FromPrimitive + PartialOrd
[src]

Loading content...