Home
last modified time | relevance | path

Searched refs:loadFactor (Results 1 – 3 of 3) sorted by relevance

/system/core/libutils/
DBasicHashtable.cpp28 size_t minimumInitialCapacity, float loadFactor) : in BasicHashtableImpl() argument
30 mLoadFactor(loadFactor), mSize(0), in BasicHashtableImpl()
202 void BasicHashtableImpl::rehash(size_t minimumCapacity, float loadFactor) { in rehash() argument
207 determineCapacity(minimumCapacity, loadFactor, &newBucketCount, &newCapacity); in rehash()
242 mLoadFactor = loadFactor; in rehash()
324 void BasicHashtableImpl::determineCapacity(size_t minimumCapacity, float loadFactor, in determineCapacity() argument
326 LOG_ALWAYS_FATAL_IF(loadFactor <= 0.0f || loadFactor > 1.0f, in determineCapacity()
327 "Invalid load factor %0.3f. Must be in the range (0, 1].", loadFactor); in determineCapacity()
329 size_t count = ceilf(minimumCapacity / loadFactor) + 1; in determineCapacity()
337 uint32_t(minimumCapacity), loadFactor); in determineCapacity()
[all …]
/system/core/include/utils/
DBasicHashtable.h53 size_t minimumInitialCapacity, float loadFactor);
72 void rehash(size_t minimumCapacity, float loadFactor);
116 static void determineCapacity(size_t minimumCapacity, float loadFactor,
181 BasicHashtable(size_t minimumInitialCapacity = 0, float loadFactor = 0.75f);
223 inline float loadFactor() const { in loadFactor() function
328 inline void rehash(size_t minimumCapacity, float loadFactor) { in rehash() argument
329 BasicHashtableImpl::rehash(minimumCapacity, loadFactor); in rehash()
362 BasicHashtable<TKey, TEntry>::BasicHashtable(size_t minimumInitialCapacity, float loadFactor) : in BasicHashtable() argument
364 minimumInitialCapacity, loadFactor) { in BasicHashtable()
/system/core/libutils/tests/
DBasicHashtable_test.cpp189 EXPECT_EQ(0.75f, h.loadFactor()); in TEST_F()
198 EXPECT_EQ(0.8f, h.loadFactor()); in TEST_F()
207 EXPECT_EQ(1.0f, h.loadFactor()); in TEST_F()
216 EXPECT_EQ(1.0f, h.loadFactor()); in TEST_F()
322 EXPECT_EQ(0.75f, h.loadFactor()); in TEST_F()
334 EXPECT_EQ(0.75f, h.loadFactor()); in TEST_F()
349 EXPECT_EQ(0.75f, h.loadFactor()); in TEST_F()
367 EXPECT_EQ(0.75f, h.loadFactor()); in TEST_F()
442 h.rehash(h.capacity(), h.loadFactor()); in TEST_F()
458 EXPECT_EQ(1.0f, h.loadFactor()); in TEST_F()
[all …]