SpiecsEngine
 
Loading...
Searching...
No Matches

◆ get()

template<size_t BITS>
void * scl::radix_trie< BITS, 2 >::get ( size_t k) const
inline

Get item by key.

Parameters
[in]kkey.
Returns
Returns value;

Definition at line 179 of file RadixTrie.h.

180 {
181 const size_t i1 = k >> LEAF_BITS;
182 const size_t i2 = k & (LEAF_LENGTH - 1 );
183
184 if ((k >> BITS) > 0 || m_Root->ptrs[i1] == nullptr)
185 {
186 return nullptr;
187 }
188
189 return reinterpret_cast<Leaf*>(m_Root->ptrs[i1])->values[i2];
190 }
void * get(size_t k) const
Get item by key.
Definition RadixTrie.h:179
Node * m_Root
Root Node.
Definition RadixTrie.h:145
static constexpr size_t LEAF_BITS
leaf bits.
Definition RadixTrie.h:119
static constexpr size_t LEAF_LENGTH
leaf array length.
Definition RadixTrie.h:124
std::array< Node *, ROOT_LENGTH > ptrs
Definition RadixTrie.h:131