fn nnz_or_zip<'a, I, N1, N2>(self, other: I)
    -> NnzOrZip<'a, Self, I::IntoIter, N1, N2>
    where Self: Iterator<Item=(usize, &'a N1)> + Sized,
          I: IntoIterator<Item=(usize, &'a N2)> {
        NnzOrZip {
            left: self.peekable(),
            right: other.into_iter().peekable(),
            life: PhantomData,
        }
    }
/// Iterate over non-zero elements of either of two vectors.
/// This is useful for implementing eg addition of vectors.
///
/// # Example
///
/// ```rust
/// use sprs::CsVec;
/// use sprs::vec::NnzEither;
/// use sprs::vec::SparseIterTools;
/// let v0 = CsVec::new(5, vec![0, 2, 4], vec![1., 2., 3.]);
/// let v1 = CsVec::new(5, vec![1, 2, 3], vec![-1., -2., -3.]);
/// let mut nnz_or_iter = v0.iter().nnz_or_zip(v1.iter());
/// assert_eq!(nnz_or_iter.next(), Some(NnzEither::Left((0, &1.))));
/// assert_eq!(nnz_or_iter.next(), Some(NnzEither::Right((1, &-1.))));
/// assert_eq!(nnz_or_iter.next(), Some(NnzEither::Both((2, &2., &-2.))));
/// assert_eq!(nnz_or_iter.next(), Some(NnzEither::Right((3, &-3.))));
/// assert_eq!(nnz_or_iter.next(), Some(NnzEither::Left((4, &3.))));
/// assert_eq!(nnz_or_iter.next(), None);
/// ```
Iterate over non-zero elements of either of two vectors.
This is useful for implementing eg addition of vectors.
Iterate over non - zero elements of either of two vectors . This is useful for implementing eg addition of vectors .
fn nnz_or_zip<'a, I, N1, N2>(self, other: I)
    -> NnzOrZip<'a, Self, I::IntoIter, N1, N2>
    where Self: Iterator<Item=(usize, &'a N1)> + Sized,
          I: IntoIterator<Item=(usize, &'a N2)> {
        NnzOrZip {
            left: self.peekable(),
            right: other.into_iter().peekable(),
            life: PhantomData,
        }
    }
fn nnz_or_zip < ' a , I , N1 , N2 > ( self , other : I ) -> NnzOrZip < ' a , Self , I :: IntoIter , N1 , N2 > where Self : Iterator < Item = ( usize , & ' a N1 ) > + Sized , I : IntoIterator < Item = ( usize , & ' a N2 ) > { NnzOrZip { left : self . peekable ( ) , right : other . into_iter ( ) . peekable ( ) , life : PhantomData , } }
Iterate over non-zero elements of either of two vectors.
Iterate over non - zero elements of either of two vectors .
self
other
I
self
other
I
example
None