Пример #1
0
 public static BitSet Of(int a, int b)
 {
     BitSet s = new BitSet(Math.Max(a, b) + 1);
     s.Add(a);
     s.Add(b);
     return s;
 }
Пример #2
0
 public static BitSet Of(int a, int b, int c, int d)
 {
     BitSet s = new BitSet();
     s.Add(a);
     s.Add(b);
     s.Add(c);
     s.Add(d);
     return s;
 }
Пример #3
0
 public void OrInPlace(BitSet a)
 {
     if (a == null) {
         return;
     }
     // If this is smaller than a, grow this first
     if (a._bits.Length > _bits.Length) {
         SetSize(a._bits.Length);
     }
     int min = Math.Min(_bits.Length, a._bits.Length);
     for (int i = min - 1; i >= 0; i--) {
         _bits[i] |= a._bits[i];
     }
 }
Пример #4
0
 public static BitSet Of(int el)
 {
     BitSet s = new BitSet(el + 1);
     s.Add(el);
     return s;
 }
Пример #5
0
 /** <summary>return this | a in a new set</summary> */
 public BitSet Or(BitSet a)
 {
     if (a == null) {
         return this;
     }
     BitSet s = (BitSet)this.Clone();
     s.OrInPlace(a);
     return s;
 }