Пример #1
0
 /// <summary>
 /// Create a perturbed hash generator using the provided seed generator to
 /// initialise atom invariants and using the provided stereo factory.
 /// </summary>
 /// <param name="seeds"></param>
 /// <param name="simple">generator to encode the initial values of atoms</param>
 /// <param name="pseudorandom">pseudorandom number generator used to randomise hash distribution</param>
 /// <param name="factory">a stereo encoder factory</param>
 /// <param name="finder">equivalent set finder for driving the systematic perturbation</param>
 /// <param name="suppression">suppression of atoms (these atoms are 'ignored' in the hash generation)</param>
 /// <exception cref="ArgumentException">depth was less then 0</exception>
 /// <exception cref="ArgumentNullException">    seed generator or pseudo random was null</exception>
 /// <seealso cref="SeedGenerator"/>
 public PerturbedAtomHashGenerator(SeedGenerator seeds, AbstractAtomHashGenerator simple, Pseudorandom pseudorandom,
                                   IStereoEncoderFactory factory, EquivalentSetFinder finder, AtomSuppression suppression)
     : base(pseudorandom)
 {
     this.finder      = finder;
     this.factory     = factory;
     this.simple      = simple ?? throw new ArgumentNullException(nameof(simple), "no simple generator provided");
     this.seeds       = seeds ?? throw new ArgumentNullException(nameof(seeds), "no seed generator provided");
     this.suppression = suppression ?? throw new ArgumentNullException(nameof(suppression), "no suppression provided, use AtomSuppression.None()");
 }
Пример #2
0
 /// <summary>
 /// Create a basic hash generator using the provided seed generator to
 /// initialise atom invariants and using the provided stereo factory.
 /// </summary>
 /// <param name="seedGenerator">generator to seed the initial values of atoms</param>
 /// <param name="pseudorandom">pseudorandom number generator used to randomise hash distribution</param>
 /// <param name="factory">a stereo encoder factory</param>
 /// <param name="depth">depth of the hashing function, larger values take longer</param>
 /// <exception cref="ArgumentException">depth was less then 0</exception>
 /// <exception cref="ArgumentNullException">    seed generator or pseudo random was null</exception>
 /// <seealso cref="SeedGenerator"/>
 public BasicAtomHashGenerator(IAtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
                               IStereoEncoderFactory factory, int depth)
     : base(pseudorandom)
 {
     if (depth < 0)
     {
         throw new ArgumentOutOfRangeException(nameof(depth), "depth cannot be less then 0");
     }
     this.seedGenerator = seedGenerator ?? throw new ArgumentNullException(nameof(seedGenerator), "seed generator cannot be null");
     this.factory       = factory;
     this.depth         = depth;
 }
Пример #3
0
 /// <summary>
 /// Create a new conjugated encoder factory from the left and right
 /// factories.
 ///
 /// <param name="left">encoder factory</param>
 /// <param name="right">encoder factory</param>
 /// </summary>
 public ConjugatedEncoderFactory(IStereoEncoderFactory left, IStereoEncoderFactory right)
 {
     this.left  = left;
     this.right = right;
 }