pub fn intersection(&self, a: usize, b: usize) -> Vec<usize> {
        let (a_start, a_end) = self.range(a);
        let (b_start, b_end) = self.range(b);
        let mut result = Vec::with_capacity(self.elements);
        for (base, (i, j)) in (a_start..a_end).zip(b_start..b_end).enumerate() {
            let mut v = self.vector[i] & self.vector[j];
            for bit in 0..64 {
                if v == 0 { break; }
                if v & 0x1 != 0 { result.push(base*64 + bit); }
                v >>= 1;
            }
        }
        result
    }
/// Returns those indices that are reachable from both `a` and
/// `b`. This is an O(n) operation where `n` is the number of
/// elements (somewhat independent from the actual size of the
/// intersection, in particular).
Returns those indices that are reachable from both `a` and
`b`. This is an O(n) operation where `n` is the number of
elements (somewhat independent from the actual size of the
intersection, in particular).
Returns those indices that are reachable from both ` a ` and ` b ` . This is an O ( n ) operation where ` n ` is the number of elements ( somewhat independent from the actual size of the intersection in particular ) .
pub fn intersection(&self, a: usize, b: usize) -> Vec<usize> {
        let (a_start, a_end) = self.range(a);
        let (b_start, b_end) = self.range(b);
        let mut result = Vec::with_capacity(self.elements);
        for (base, (i, j)) in (a_start..a_end).zip(b_start..b_end).enumerate() {
            let mut v = self.vector[i] & self.vector[j];
            for bit in 0..64 {
                if v == 0 { break; }
                if v & 0x1 != 0 { result.push(base*64 + bit); }
                v >>= 1;
            }
        }
        result
    }
pub fn intersection ( & self , a : usize , b : usize ) -> Vec < usize > { let ( a_start , a_end ) = self . range ( a ) ; let ( b_start , b_end ) = self . range ( b ) ; let mut result = Vec :: with_capacity ( self . elements ) ; for ( base , ( i , j ) ) in ( a_start .. a_end ) . zip ( b_start .. b_end ) . enumerate ( ) { let mut v = self . vector [ i ] & self . vector [ j ] ; for bit in 0 .. 64 { if v == 0 { break ; } if v & 0x1 != 0 { result . push ( base * 64 + bit ) ; } v >>= 1 ; } } result }
Returns those indices that are reachable from both `a` and
`b`.
Returns those indices that are reachable from both ` a ` and ` b ` .
&self
a
usize
b
usize