Browse Source

changed hash function of bit vector hash map

tempestpy_adaptions
dehnert 7 years ago
parent
commit
8116b360ba
  1. 8
      src/storm/storage/BitVectorHashMap.cpp
  2. 2
      src/storm/storage/BitVectorHashMap.h

8
src/storm/storage/BitVectorHashMap.cpp

@ -226,7 +226,7 @@ namespace storm {
} }
template<class ValueType, class Hash> template<class ValueType, class Hash>
uint_fast64_t BitVectorHashMap<ValueType, Hash>::getNextBucketInProbingSequence(uint_fast64_t currentValue, uint_fast64_t step) const {
uint_fast64_t BitVectorHashMap<ValueType, Hash>::getNextBucketInProbingSequence(uint_fast64_t, uint_fast64_t currentValue, uint_fast64_t step) const {
return (currentValue + step + step*step) % *currentSizeIterator; return (currentValue + step + step*step) % *currentSizeIterator;
} }
@ -237,7 +237,7 @@ namespace storm {
#endif #endif
uint_fast64_t initialHash = hasher(key) % *currentSizeIterator; uint_fast64_t initialHash = hasher(key) % *currentSizeIterator;
uint_fast64_t bucket = initialHash; uint_fast64_t bucket = initialHash;
uint_fast64_t i = 0; uint_fast64_t i = 0;
while (isBucketOccupied(bucket)) { while (isBucketOccupied(bucket)) {
++i; ++i;
@ -247,7 +247,7 @@ namespace storm {
if (buckets.matches(bucket * bucketSize, key)) { if (buckets.matches(bucket * bucketSize, key)) {
return std::make_pair(true, bucket); return std::make_pair(true, bucket);
} }
bucket = getNextBucketInProbingSequence(bucket, i);
bucket = getNextBucketInProbingSequence(initialHash, bucket, i);
if (bucket == initialHash) { if (bucket == initialHash) {
return std::make_pair(false, bucket); return std::make_pair(false, bucket);
@ -275,7 +275,7 @@ namespace storm {
if (buckets.matches(bucket * bucketSize, key)) { if (buckets.matches(bucket * bucketSize, key)) {
return std::make_tuple(true, bucket, false); return std::make_tuple(true, bucket, false);
} }
bucket = getNextBucketInProbingSequence(bucket, i);
bucket = getNextBucketInProbingSequence(initialHash, bucket, i);
if (bucket == initialHash) { if (bucket == initialHash) {
if (increaseStorage) { if (increaseStorage) {

2
src/storm/storage/BitVectorHashMap.h

@ -207,7 +207,7 @@ namespace storm {
/*! /*!
* Computes the next bucket in the probing sequence. * 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. // The load factor determining when the size of the map is increased.
double loadFactor; double loadFactor;

Loading…
Cancel
Save