BitsetsNET.BitsetContainer.Or C# (CSharp) Method

Or() public method

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
public Or ( ArrayContainer x ) : Container
x ArrayContainer Other container
return Container
        public override Container Or(ArrayContainer x)
        {
            BitsetContainer answer = (BitsetContainer) Clone();

            int c = x.Cardinality;
            for (int k = 0; k < c ; ++k)
            {
                ushort v = x.Content[k];
                int i = v >> 6;
                long w = answer.Bitmap[i];
                long aft = w | (1L << v);

                answer.Bitmap[i] = aft;
                answer.Cardinality += (int)((w - aft) >> 63);
            }
            return answer;
        }

Same methods

BitsetContainer::Or ( BitsetContainer x ) : Container

Usage Example

Example #1
0
 /// <summary>
 /// Computes the bitwise OR of this container with another (union). This
 /// container as well as the provided container are left unaffected.
 /// </summary>
 /// <param name="x">Other container</param>
 /// <returns>Aggregated container</returns>
 public override Container Or(BitsetContainer x)
 {
     return x.Or((ArrayContainer) this);
 }
All Usage Examples Of BitsetsNET.BitsetContainer::Or