Browse Source

changed hash function of bit vector hash map

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

6
src/storm/storage/BitVectorHashMap.cpp

@ -226,7 +226,7 @@ namespace storm {
}
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;
}
@ -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) {

2
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;

Loading…
Cancel
Save