test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/PerturbedAtomHashGeneratorTest.java
test_class.identifier: PerturbedAtomHashGeneratorTest
test_case.body: @Test
      public void testCombine() throws Exception {
          Xorshift prng = new Xorshift();
          PerturbedAtomHashGenerator generator = new PerturbedAtomHashGenerator(new SeedGenerator(
                  BasicAtomEncoder.ATOMIC_NUMBER), new BasicAtomHashGenerator(new SeedGenerator(
                  BasicAtomEncoder.ATOMIC_NUMBER), prng, 8), prng, StereoEncoderFactory.EMPTY,
                  new MinimumEquivalentCyclicSet(), AtomSuppression.unsuppressed());
          long[][] perturbed = new long[][]{{1, 2, 3, 4}, {1, 1, 1, 1}, {1, 2, 2, 4}, {2, 2, 2, 2},};
  
          long _0 = 1 ^ 2 ^ 3 ^ 4;
          long _1 = 1 ^ prng.next(1) ^ prng.next(prng.next(1)) ^ prng.next(prng.next(prng.next(1)));
          long _2 = 1 ^ 2 ^ prng.next(2) ^ 4;
          long _3 = 2 ^ prng.next(2) ^ prng.next(prng.next(2)) ^ prng.next(prng.next(prng.next(2)));
  
          long[] values = generator.combine(perturbed);
          Assert.assertArrayEquals(values, new long[]{_0, _1, _2, _3});
      }
test_case.class_method_signature: PerturbedAtomHashGeneratorTest.testCombine()
test_case.full_signature: @Test public void testCombine()
test_case.identifier: testCombine
test_case.invocations: unsuppressed next next next next next next next next next next next next next combine assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCombine()
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: simple
focal_class.modifier: private final
focal_class.original_string: private final AbstractAtomHashGenerator simple;
focal_class.type: AbstractAtomHashGenerator
focal_class.var_name: simple
focal_class.declarator: seeds
focal_class.modifier: private final
focal_class.original_string: private final AtomHashGenerator         seeds;
focal_class.type: AtomHashGenerator
focal_class.var_name: seeds
focal_class.declarator: finder
focal_class.modifier: private final
focal_class.original_string: private final EquivalentSetFinder       finder;
focal_class.type: EquivalentSetFinder
focal_class.var_name: finder
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/PerturbedAtomHashGenerator.java
focal_class.identifier: PerturbedAtomHashGenerator
focal_class.interfaces: implements AtomHashGenerator
focal_class.class_method_signature: PerturbedAtomHashGenerator.PerturbedAtomHashGenerator(SeedGenerator seeds, AbstractAtomHashGenerator simple, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, EquivalentSetFinder finder, AtomSuppression suppression)
focal_class.full_signature: public  PerturbedAtomHashGenerator(SeedGenerator seeds, AbstractAtomHashGenerator simple, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, EquivalentSetFinder finder, AtomSuppression suppression)
focal_class.identifier: PerturbedAtomHashGenerator
focal_class.modifiers: public
focal_class.parameters: (SeedGenerator seeds, AbstractAtomHashGenerator simple, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, EquivalentSetFinder finder, AtomSuppression suppression)
focal_class.signature:  PerturbedAtomHashGenerator(SeedGenerator seeds, AbstractAtomHashGenerator simple, Pseudorandom pseudorandom,
              StereoEncoderFactory factory, EquivalentSetFinder finder, AtomSuppression suppression)
focal_class.class_method_signature: PerturbedAtomHashGenerator.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: PerturbedAtomHashGenerator.generate(IAtomContainer container, long[] seeds, StereoEncoder encoder, int[][] graph)
focal_class.full_signature: private long[] generate(IAtomContainer container, long[] seeds, StereoEncoder encoder, int[][] graph)
focal_class.identifier: generate
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer container, long[] seeds, StereoEncoder encoder, int[][] graph)
focal_class.return: long[]
focal_class.signature: long[] generate(IAtomContainer container, long[] seeds, StereoEncoder encoder, int[][] graph)
focal_class.class_method_signature: PerturbedAtomHashGenerator.combine(long[][] perturbed)
focal_class.full_signature:  long[] combine(long[][] perturbed)
focal_class.identifier: combine
focal_class.parameters: (long[][] perturbed)
focal_class.return: long[]
focal_class.signature: long[] combine(long[][] perturbed)
focal_class.superclass: extends AbstractHashGenerator
focal_method.body: long[] combine(long[][] perturbed) {
  
          int n = perturbed.length;
          int m = perturbed[0].length;
  
          long[] combined = new long[n];
          long[] rotated = new long[m];
  
          for (int i = 0; i < n; i++) {
  
              Arrays.sort(perturbed[i]);
  
              for (int j = 0; j < m; j++) {
                  // if non-unique, then get the next random number
                  if (j > 0 && perturbed[i][j] == perturbed[i][j - 1]) {
                      combined[i] ^= rotated[j] = rotate(rotated[j - 1]);
                  } else {
                      combined[i] ^= rotated[j] = perturbed[i][j];
                  }
              }
  
          }
  
          return combined;
      }
focal_method.class_method_signature: PerturbedAtomHashGenerator.combine(long[][] perturbed)
focal_method.full_signature:  long[] combine(long[][] perturbed)
focal_method.identifier: combine
focal_method.invocations: sort rotate
focal_method.parameters: (long[][] perturbed)
focal_method.return: long[]
focal_method.signature: long[] combine(long[][] perturbed)