Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
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()");
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new molecule hash using the provided atom hash generator and
 /// pseudorandom number generator.
 /// </summary>
 /// <param name="generator">a generator for atom hash codes</param>
 /// <param name="pseudorandom">pseudorandom number generator</param>
 /// <exception cref="ArgumentNullException">no atom hash generator or pseudorandom number generator provided</exception>
 internal BasicMoleculeHashGenerator(IAtomHashGenerator generator, Pseudorandom pseudorandom)
 {
     this.generator    = generator ?? throw new ArgumentNullException(nameof(generator), "no AtomHashGenerator provided");
     this.pseudorandom = pseudorandom ?? throw new ArgumentNullException(nameof(pseudorandom), "no Pseudorandom number generator provided");
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a basic hash generator using the provided seed generator to
 /// initialise atom invariants and no stereo configuration.
 /// </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="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, int depth)
     : this(seedGenerator, pseudorandom, StereoEncoderFactory.Empty, depth)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a new seed generator using the provided <see cref="IAtomEncoder"/> and
 /// pseudorandom number generator.
 /// </summary>
 /// <param name="encoder">a method for encoding atom invariant properties</param>
 /// <param name="pseudorandom">number generator to randomise initial invariants</param>
 /// <param name="suppression">indicates which vertices should be suppressed</param>
 /// <exception cref="ArgumentNullException">encoder or pseudorandom number generator was null</exception>
 public SeedGenerator(IAtomEncoder encoder, Pseudorandom pseudorandom, AtomSuppression suppression)
     : base(pseudorandom)
 {
     this.encoder     = encoder ?? throw new ArgumentNullException(nameof(encoder), "encoder cannot be null");
     this.suppression = suppression ?? throw new ArgumentNullException(nameof(suppression), "suppression cannot be null, use AtomSuppression.Unsuppressed()");
 }
Ejemplo n.º 6
0
 public AbstractAtomHashGenerator(Pseudorandom pseudorandom)
     : base(pseudorandom)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Construct an abstract hash function providing the pseudorandom number
 /// generator.
 /// </summary>
 /// <param name="pseudorandom">a pseudorandom number generator</param>
 /// <exception cref="ArgumentNullException">the pseudorandom number generator was null</exception>
 public AbstractHashGenerator(Pseudorandom pseudorandom)
 {
     this.pseudorandom = pseudorandom ?? throw new ArgumentNullException(nameof(pseudorandom), "null pseduorandom number generator provided");
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Create a basic hash generator using the provided seed generator to
 /// initialise atom invariants and no stereo configuration.
 /// </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="suppression">defines which atoms are suppressed (i.e. masked) from the hash code</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 SuppressedAtomHashGenerator(IAtomHashGenerator seedGenerator, Pseudorandom pseudorandom,
                                    AtomSuppression suppression, int depth)
     : this(seedGenerator, pseudorandom, StereoEncoderFactory.Empty, suppression, depth)
 {
 }