Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb_jaro_winkler::common::BitvectorHashmap Struct Reference

Classes

struct  MapElem

Public Member Functions

template<typename CharT>
void insert (CharT key, int64_t pos)
template<typename CharT>
void insert_mask (CharT key, uint64_t mask)
template<typename CharT>
uint64_t get (CharT key) const

Private Member Functions

uint64_t lookup (uint64_t key) const

Private Attributes

std::array< MapElem, 128 > m_map

Constructor & Destructor Documentation

◆ BitvectorHashmap()

duckdb_jaro_winkler::common::BitvectorHashmap::BitvectorHashmap ( )
inline
108259 : m_map()
108260 {}

Member Function Documentation

◆ insert()

template<typename CharT>
void duckdb_jaro_winkler::common::BitvectorHashmap::insert ( CharT key,
int64_t pos )
inline
108264 {
108265 insert_mask(key, 1ull << pos);
108266 }

◆ insert_mask()

template<typename CharT>
void duckdb_jaro_winkler::common::BitvectorHashmap::insert_mask ( CharT key,
uint64_t mask )
inline
108270 {
108271 uint64_t i = lookup(static_cast<uint64_t>(key));
108272 m_map[i].key = static_cast<uint64_t>(key);
108273 m_map[i].value |= mask;
108274 }
GMat mask(const GMat &src, const GMat &mask)
::uint64_t uint64_t
uint64_t lookup(uint64_t key) const
Definition duckdb.cpp:108287

◆ get()

template<typename CharT>
uint64_t duckdb_jaro_winkler::common::BitvectorHashmap::get ( CharT key) const
inline
108278 {
108279 return m_map[lookup(static_cast<uint64_t>(key))].value;
108280 }

◆ lookup()

uint64_t duckdb_jaro_winkler::common::BitvectorHashmap::lookup ( uint64_t key) const
inlineprivate

lookup key inside the hashmap using a similar collision resolution strategy to CPython and Ruby

108288 {
108289 uint64_t i = key % 128;
108290
108291 if (!m_map[i].value || m_map[i].key == key) {
108292 return i;
108293 }
108294
108295 uint64_t perturb = key;
108296 while (true) {
108297 i = ((i * 5) + perturb + 1) % 128;
108298 if (!m_map[i].value || m_map[i].key == key) {
108299 return i;
108300 }
108301
108302 perturb >>= 5;
108303 }
108304 }

The documentation for this struct was generated from the following file: