/// Given a list of edges and the number of times they were observed `other`,
/// this returns how many times an edge in `other` appeared less than k times (including 0)
/// in this graph.
///
/// Graphs must be sorted and over the same vertex set.
Given a list of edges and the number of times they were observed `other`,
this returns how many times an edge in `other` appeared less than k times (including 0)
in this graph.

Graphs must be sorted and over the same vertex set.
Given a list of edges and the number of times they were observed ` other ` this returns how many times an edge in ` other ` appeared less than k times ( including 0 ) in this graph . Graphs must be sorted and over the same vertex set .
pub(crate) fn nmissing(&self, k: usize, other: &AdjacencyList, mask: &[bool]) -> usize {
        assert!(
            self.nvertices() == other.nvertices(),
            "vertex counts {} != {}",
            self.nvertices(),
            other.nvertices()
        );
        self.iter_edges()
            .merge_join_by(other.iter_edges(), |(l, _), (r, _)| l.cmp(r))
            // we only care about situations where the edge is present in
            // other but is missing in self or only present in self less than k times
            .flat_map(|either| match either {
                Right((e, cnt)) => Some((e, cnt)),
                Both((e, i), (e2, cnt)) if i < k => {
                    assert!(e == e2);
                    Some((e, cnt))
                }
                _ => None,
            })
            // if an edge contains a masked-out endpoint then ignore it
            .map(|(e, cnt)| {
                let l = e.left() as usize;
                let r = e.right() as usize;
                if mask[l] && mask[r] {
                    cnt
                } else {
                    0
                }
            })
            .sum::<usize>()
    }
pub ( crate ) fn nmissing ( & self , k : usize , other : & AdjacencyList , mask : & [ bool ] ) -> usize { assert ! ( self nvertices ( ) other nvertices ( ) " " self nvertices ( ) other nvertices ( ) ) ; self . iter_edges ( ) . merge_join_by ( other . iter_edges ( ) , | ( l , _ ) , ( r , _ ) | l . cmp ( r ) ) // we only care about situations where the edge is present in // other but is missing in self or only present in self less than k times . flat_map ( | either | match either { Right ( ( e , cnt ) ) => Some ( ( e , cnt ) ) , Both ( ( e , i ) , ( e2 , cnt ) ) if i < k => { assert ! ( e e2 ) ; Some ( ( e , cnt ) ) } _ => None , } ) // if an edge contains a masked-out endpoint then ignore it . map ( | ( e , cnt ) | { let l = e . left ( ) as usize ; let r = e . right ( ) as usize ; if mask [ l ] && mask [ r ] { cnt } else { 0 } } ) . sum :: < usize > ( ) }
Given a list of edges and the number of times they were observed `other`,
this returns how many times an edge in `other` appeared less than k times (including 0)
in this graph.
Given a list of edges and the number of times they were observed ` other ` this returns how many times an edge in ` other ` appeared less than k times ( including 0 ) in this graph .
&self
k
usize
other
&AdjacencyList
mask
&[bool]