test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/SuppressedAtomHashGeneratorTest.java
test_class.identifier: SuppressedAtomHashGeneratorTest
test_case.body: @Test
      public void testRotation() throws Exception {
  
          AtomHashGenerator seedMock = mock(AtomHashGenerator.class);
          IAtomContainer container = mock(IAtomContainer.class);
  
          SuppressedAtomHashGenerator generator = new SuppressedAtomHashGenerator(mock(AtomHashGenerator.class),
                  new Xorshift(), AtomSuppression.unsuppressed(), 2);
  
          int[][] graph = new int[][]{{1, 2, 3}, {0}, {0}, {0}};
  
          // simulate 3 identical neighbors
          long[] invs = new long[]{21, 31, 31, 31};
          long[] unique = new long[4];
          long[] rotated = new long[4];
  
          // non-suppressed
          {
              long value = generator.next(graph, 0, invs, unique, rotated, Suppressed.none());
  
              assertThat(unique, is(new long[]{31, 0, 0, 0}));
              assertThat(rotated, is(new long[]{generator.rotate(31, 2), 0, 0, 0}));
              assertThat(value, is(generator.distribute(21) ^ 31 ^ generator.rotate(31) ^ generator.rotate(31, 2)));
          }
  
          // okay now suppress vertices 1
          {
              BitSet suppressed = new BitSet();
              suppressed.set(1);
  
              long value = generator.next(graph, 0, invs, unique, rotated, Suppressed.fromBitSet(suppressed));
  
              assertThat(unique, is(new long[]{31, 0, 0, 0}));
              assertThat(rotated, is(new long[]{generator.rotate(31, 1), 0, 0, 0})); // 31 only encountered twice
              assertThat(value, is(generator.distribute(21) ^ 31 ^ generator.rotate(31)));
          }
  
          // okay now suppress vertices 1 and 3
          {
              BitSet suppressed = new BitSet();
              suppressed.set(1);
              suppressed.set(3);
  
              long value = generator.next(graph, 0, invs, unique, rotated, Suppressed.fromBitSet(suppressed));
  
              assertThat(unique, is(new long[]{31, 0, 0, 0}));
              assertThat(rotated, is(new long[]{31, 0, 0, 0})); // 31 only encountered once and is not rotated
              assertThat(value, is(generator.distribute(21) ^ 31)); // only encountered once
          }
  
      }
test_case.class_method_signature: SuppressedAtomHashGeneratorTest.testRotation()
test_case.full_signature: @Test public void testRotation()
test_case.identifier: testRotation
test_case.invocations: mock mock mock unsuppressed next none assertThat is assertThat is rotate assertThat is distribute rotate rotate set next fromBitSet assertThat is assertThat is rotate assertThat is distribute rotate set set next fromBitSet assertThat is assertThat is assertThat is distribute
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRotation()
focal_class.declarator: seedGenerator
focal_class.modifier: private final
focal_class.original_string: private final AtomHashGenerator    seedGenerator;
focal_class.type: AtomHashGenerator
focal_class.var_name: seedGenerator
focal_class.declarator: factory
focal_class.modifier: private final
focal_class.original_string: private final StereoEncoderFactory factory;
focal_class.type: StereoEncoderFactory
focal_class.var_name: factory
focal_class.declarator: depth
focal_class.modifier: private final
focal_class.original_string: private final int                  depth;
focal_class.type: int
focal_class.var_name: depth
focal_class.declarator: suppression
focal_class.modifier: private final
focal_class.original_string: private final AtomSuppression      suppression;
focal_class.type: AtomSuppression
focal_class.var_name: suppression
focal_class.file: tool/hash/src/main/java/org/openscience/cdk/hash/SuppressedAtomHashGenerator.java
focal_class.identifier: SuppressedAtomHashGenerator
focal_class.interfaces: implements AtomHashGenerator
focal_class.class_method_signature: SuppressedAtomHashGenerator.SuppressedAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, AtomSuppression suppression, int depth)
focal_class.full_signature: public  SuppressedAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, AtomSuppression suppression, int depth)
focal_class.identifier: SuppressedAtomHashGenerator
focal_class.modifiers: public
focal_class.parameters: (AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, AtomSuppression suppression, int depth)
focal_class.signature:  SuppressedAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, AtomSuppression suppression, int depth)
focal_class.class_method_signature: SuppressedAtomHashGenerator.SuppressedAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              AtomSuppression suppression, int depth)
focal_class.full_signature: public  SuppressedAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              AtomSuppression suppression, int depth)
focal_class.identifier: SuppressedAtomHashGenerator
focal_class.modifiers: public
focal_class.parameters: (AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              AtomSuppression suppression, int depth)
focal_class.signature:  SuppressedAtomHashGenerator(AtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
              AtomSuppression suppression, int depth)
focal_class.class_method_signature: SuppressedAtomHashGenerator.generate(IAtomContainer container)
focal_class.full_signature: @Override public long[] generate(IAtomContainer container)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer container)
focal_class.return: long[]
focal_class.signature: long[] generate(IAtomContainer container)
focal_class.class_method_signature: SuppressedAtomHashGenerator.generate(long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.full_signature: @Override long[] generate(long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.identifier: generate
focal_class.modifiers: @Override
focal_class.parameters: (long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.return: long[]
focal_class.signature: long[] generate(long[] current, StereoEncoder encoder, int[][] graph, Suppressed suppressed)
focal_class.class_method_signature: SuppressedAtomHashGenerator.next(int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)
focal_class.full_signature:  long next(int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)
focal_class.identifier: next
focal_class.parameters: (int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)
focal_class.return: long
focal_class.signature: long next(int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)
focal_class.superclass: extends AbstractAtomHashGenerator
focal_method.body: long next(int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed) {
  
          if (suppressed.contains(v)) return current[v];
  
          long invariant = distribute(current[v]);
          int nUnique = 0;
  
          for (int w : graph[v]) {
  
              // skip suppressed atom
              if (suppressed.contains(w)) continue;
  
              long adjInv = current[w];
  
              // find index of already included neighbor
              int i = 0;
              while (i < nUnique && unique[i] != adjInv) {
                  ++i;
              }
  
              // no match, then the value is unique, use adjInv
              // match, then rotate the previously included value
              included[i] = (i == nUnique) ? unique[nUnique++] = adjInv : rotate(included[i]);
  
              invariant ^= included[i];
          }
  
          return invariant;
      }
focal_method.class_method_signature: SuppressedAtomHashGenerator.next(int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)
focal_method.full_signature:  long next(int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)
focal_method.identifier: next
focal_method.invocations: contains distribute contains rotate
focal_method.parameters: (int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)
focal_method.return: long
focal_method.signature: long next(int[][] graph, int v, long[] current, long[] unique, long[] included, Suppressed suppressed)