Pop_andnot() public static méthode

Returns the popcount or cardinality of A & ~B Neither array is modified.
public static Pop_andnot ( long A, long B, int wordOffset, int numWords ) : long
A long
B long
wordOffset int
numWords int
Résultat long
        /// <summary>Returns the popcount or cardinality of "a and not b"
        /// or "intersection(a, not(b))".
        /// Neither set is modified.
        /// </summary>
        public static long AndNotCount(OpenBitSet a, OpenBitSet b)
        {
            long tot = BitUtil.Pop_andnot(a.internalbits, b.internalbits, 0, System.Math.Min(a.wlen, b.wlen));

            if (a.wlen > b.wlen)
            {
                tot += BitUtil.Pop_array(a.internalbits, b.wlen, a.wlen - b.wlen);
            }
            return(tot);
        }
Exemple #2
0
        /// <summary>
        /// Returns the popcount or cardinality of "a and not b"
        /// or "intersection(a, not(b))".
        /// Neither set is modified.
        /// </summary>
        public static long AndNotCount(OpenBitSet a, OpenBitSet b)
        {
            long tot = BitUtil.Pop_andnot(a.bits, b.bits, 0, Math.Min(a.Wlen, b.Wlen));

            if (a.Wlen > b.Wlen)
            {
                tot += BitUtil.Pop_array(a.bits, b.Wlen, a.Wlen - b.Wlen);
            }
            return(tot);
        }
Exemple #3
0
        /// <summary>
        /// Returns the popcount or cardinality of "a and not b" or
        /// "intersection(a, not(b))". Neither set is modified.
        /// </summary>
        public static long AndNotCount(FixedBitSet a, FixedBitSet b)
        {
            long tot = BitUtil.Pop_andnot(a.bits, b.bits, 0, Math.Min(a.NumWords, b.NumWords));

            if (a.NumWords > b.NumWords)
            {
                tot += BitUtil.Pop_array(a.bits, b.NumWords, a.NumWords - b.NumWords);
            }
            return(tot);
        }