Package java.util

Examples of java.util.BitSet.flip()


    harness.check(!bs.get(2));
    harness.check(bs.get(3));
    harness.check(bs.get(4));
    harness.check(!bs.get(5));
   
    bs.flip(4, 4);
    harness.check(bs.get(4));
   
    boolean pass = false;
    try
    {
View Full Code Here


    harness.check(bs.get(4));
   
    boolean pass = false;
    try
    {
      bs.flip(-1, 1);
    }
    catch (IndexOutOfBoundsException e)
    {
      pass = true;
    }
View Full Code Here

    harness.check(pass);

    pass = false;
    try
    {
      bs.flip(2, 1);
    }
    catch (IndexOutOfBoundsException e)
    {
      pass = true;
    }
View Full Code Here

          b.fastSet(idx);
          idx = rand.nextInt(sz);
          a.clear(idx);
          b.fastClear(idx);
          idx = rand.nextInt(sz);
          a.flip(idx);
          b.fastFlip(idx);

          boolean val = b.flipAndGet(idx);
          boolean val2 = b.flipAndGet(idx);
          assertTrue(val != val2);
View Full Code Here

      // test ranges, including possible extension
      int fromIndex, toIndex;
      fromIndex = rand.nextInt(sz+80);
      toIndex = fromIndex + rand.nextInt((sz>>1)+1);
      BitSet aa = (BitSet)a.clone(); aa.flip(fromIndex,toIndex);
      OpenBitSet bb = (OpenBitSet)b.clone(); bb.flip(fromIndex,toIndex);

      doIterate(aa,bb);   // a problem here is from flip or doIterate

      fromIndex = rand.nextInt(sz+80);
View Full Code Here

            LinkedList<FlowGraphNode> workList = getInitialWorkList();

            // 3. Initialize a bitset with a flag set for all basic blocks
            int numNodes = _cfg.getMaxNodeID();
            BitSet bbSet = new BitSet(1+numNodes);
            bbSet.flip(0, numNodes);

            // 4. Iteratively compute data flow info
            while (!workList.isEmpty()) {
                workList.removeFirst().computeDataFlowInfo(workList, bbSet);
            }
View Full Code Here

          idx = random.nextInt(sz);
          a.clear(idx);
          b.fastClear((long) idx);
         
          idx = random.nextInt(sz);
          a.flip(idx);
          b.fastFlip(idx);

          boolean val = b.flipAndGet(idx);
          boolean val2 = b.flipAndGet(idx);
          assertTrue(val != val2);
View Full Code Here

          boolean val = b.flipAndGet(idx);
          boolean val2 = b.flipAndGet(idx);
          assertTrue(val != val2);

          idx = random.nextInt(sz);
          a.flip(idx);
          b.fastFlip((long) idx);

          val = b.flipAndGet((long) idx);
          val2 = b.flipAndGet((long) idx);
          assertTrue(val != val2);
View Full Code Here

      // test ranges, including possible extension
      int fromIndex, toIndex;
      fromIndex = random.nextInt(sz+80);
      toIndex = fromIndex + random.nextInt((sz>>1)+1);
      BitSet aa = (BitSet)a.clone(); aa.flip(fromIndex,toIndex);
      OpenBitSet bb = (OpenBitSet)b.clone(); bb.flip(fromIndex,toIndex);

      doIterate(aa,bb, mode);   // a problem here is from flip or doIterate

      fromIndex = random.nextInt(sz+80);
View Full Code Here

          idx = random.nextInt(sz);
          a.clear(idx);
          b.clear(idx);
         
          idx = random.nextInt(sz);
          a.flip(idx);
          b.flip(idx, idx+1);

          idx = random.nextInt(sz);
          a.flip(idx);
          b.flip(idx, idx+1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.