public static long xorCount ( OpenBitSet a , OpenBitSet b ) { long tot = BitUtil . pop_xor ( a . bits , b . bits , 0 , Math . min ( a . wlen , b . wlen ) ) ; if ( a . wlen < b . wlen ) { tot += BitUtil . pop_array ( b . bits , a . wlen , b . wlen - a . wlen ) ; } else if ( a . wlen > b . wlen ) { tot += BitUtil . pop_array ( a . bits , b . wlen , a . wlen - b . wlen ) ; } return tot ; }
Returns the popcount or cardinality of the exclusive - or of the two sets . Neither set is modified .