예제 #1
0
 public DoubleHashTable(int size)
 {
     this.Size      = PrimeList.GetNextPrime(size);
     this.HashPrime = PrimeList.GetNextPrime(this.Size);
     this.Storage   = new HashTableItem <int> [this.Size];
     this.Count     = 0;
 }
예제 #2
0
 public void PrimeListTest()
 {
     Assert.AreEqual(2, PrimeList.GetNextPrime(0), "Next prime after 0 is 2");
     Assert.AreEqual(2, PrimeList.GetNextPrime(1), "Next prime after 1 is 2");
     Assert.AreEqual(3, PrimeList.GetNextPrime(2), "Next prime after 2 is 3");
     Assert.AreEqual(5, PrimeList.GetNextPrime(3), "Next prime after 3 is 5");
 }
예제 #3
0
파일: SampleMain.cs 프로젝트: Moosan/ABC
    public void Start()
    {
        var primeList          = new PrimeList();
        var primeDecomposition = new PrimeDecomposition(primeList);
        var radical            = new Radical(primeDecomposition);

        _abc = new Abc(radical);
        Calc();
    }
예제 #4
0
        private void Rebuild()
        {
            this.Size = PrimeList.GetNextPrime(this.Size);
            var newStorageItems = new List <int>();

            foreach (var item in this)
            {
                newStorageItems.Add(item);
            }

            this.Count   = 0;
            this.Storage = new HashTableItem <int> [this.Size];
            foreach (var item in newStorageItems)
            {
                this.Add(item);
            }
        }
예제 #5
0
 public PrimeDecomposition(PrimeList primeList)
 {
     _primeList = primeList;
 }
예제 #6
0
 public QuadraticHashTable(int size)
 {
     this.Size    = PrimeList.GetNextPrime(size);
     this.Storage = new HashTableItem <int> [this.Size];
     this.Count   = 0;
 }