public void Constructs_ok()
 {
     var result = new HashStoreResult(123, 456d, 789d);
     Assert.AreEqual(123, result.StatisticalPopulation);
     Assert.AreEqual(456d, result.CollisionProbability);
     Assert.AreEqual(789d, result.UniformDistributionDeviationProbability);
 }
示例#2
0
        /// <summary>
        /// Constructs a map from the specified hash codes.
        /// </summary>
        /// <param name="hashes">An enumeration of hash codes.</param>
        public HashStore(IEnumerable<int> hashes)
        {
            int count = 0;

            foreach (int hash in hashes)
            {
                Add(hash);
                count++;
            }

            if (count < minimumHashCount)
                throw new NotEnoughHashesException(minimumHashCount, count);

            result = CalculateResults(count);
        }
示例#3
0
        /// <summary>
        /// Constructs a map from the specified hash codes.
        /// </summary>
        /// <param name="hashes">An enumeration of hash codes.</param>
        public HashStore(IEnumerable <int> hashes)
        {
            int count = 0;

            foreach (int hash in hashes)
            {
                Add(hash);
                count++;
            }

            if (count < minimumHashCount)
            {
                throw new NotEnoughHashesException(minimumHashCount, count);
            }

            result = CalculateResults(count);
        }