From 8116b360ba3813135e740e44ea960db899553da3 Mon Sep 17 00:00:00 2001 From: dehnert Date: Thu, 2 Nov 2017 18:30:22 +0100 Subject: [PATCH] changed hash function of bit vector hash map --- src/storm/storage/BitVectorHashMap.cpp | 8 ++++---- src/storm/storage/BitVectorHashMap.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/storm/storage/BitVectorHashMap.cpp b/src/storm/storage/BitVectorHashMap.cpp index c1d9d46d1..9cec1aa20 100644 --- a/src/storm/storage/BitVectorHashMap.cpp +++ b/src/storm/storage/BitVectorHashMap.cpp @@ -226,7 +226,7 @@ namespace storm { } template - uint_fast64_t BitVectorHashMap::getNextBucketInProbingSequence(uint_fast64_t currentValue, uint_fast64_t step) const { + uint_fast64_t BitVectorHashMap::getNextBucketInProbingSequence(uint_fast64_t, uint_fast64_t currentValue, uint_fast64_t step) const { return (currentValue + step + step*step) % *currentSizeIterator; } @@ -237,7 +237,7 @@ namespace storm { #endif uint_fast64_t initialHash = hasher(key) % *currentSizeIterator; uint_fast64_t bucket = initialHash; - + uint_fast64_t i = 0; while (isBucketOccupied(bucket)) { ++i; @@ -247,7 +247,7 @@ namespace storm { if (buckets.matches(bucket * bucketSize, key)) { return std::make_pair(true, bucket); } - bucket = getNextBucketInProbingSequence(bucket, i); + bucket = getNextBucketInProbingSequence(initialHash, bucket, i); if (bucket == initialHash) { return std::make_pair(false, bucket); @@ -275,7 +275,7 @@ namespace storm { if (buckets.matches(bucket * bucketSize, key)) { return std::make_tuple(true, bucket, false); } - bucket = getNextBucketInProbingSequence(bucket, i); + bucket = getNextBucketInProbingSequence(initialHash, bucket, i); if (bucket == initialHash) { if (increaseStorage) { diff --git a/src/storm/storage/BitVectorHashMap.h b/src/storm/storage/BitVectorHashMap.h index ab9e6c4be..e2ca51a5e 100644 --- a/src/storm/storage/BitVectorHashMap.h +++ b/src/storm/storage/BitVectorHashMap.h @@ -207,7 +207,7 @@ namespace storm { /*! * Computes the next bucket in the probing sequence. */ - uint_fast64_t getNextBucketInProbingSequence(uint_fast64_t currentValue, uint_fast64_t step) const; + uint_fast64_t getNextBucketInProbingSequence(uint_fast64_t initialValue, uint_fast64_t currentValue, uint_fast64_t step) const; // The load factor determining when the size of the map is increased. double loadFactor;