public static Pop_union ( long A, long B, int wordOffset, int numWords ) : long | ||
A | long | |
B | long | |
wordOffset | int | |
numWords | int | |
return | long |
/// <summary> /// Returns the popcount or cardinality of the union of the two sets. /// Neither set is modified. /// </summary> public static long UnionCount(OpenBitSet a, OpenBitSet b) { long tot = BitUtil.Pop_union(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); }
/// <summary> /// Returns the popcount or cardinality of the union of the two sets. Neither /// set is modified. /// </summary> public static long UnionCount(FixedBitSet a, FixedBitSet b) { long tot = BitUtil.Pop_union(a.bits, b.bits, 0, Math.Min(a.NumWords, b.NumWords)); if (a.NumWords < b.NumWords) { tot += BitUtil.Pop_array(b.bits, a.NumWords, b.NumWords - a.NumWords); } else if (a.NumWords > b.NumWords) { tot += BitUtil.Pop_array(a.bits, b.NumWords, a.NumWords - b.NumWords); } return(tot); }