41template <
typename CHAR_T,
bool MEMORY_EFFICIENT,
typename RANK_T = GeometricRank,
unsigned CHAR_SIZE_BITS = sizeof(CHAR_T) * 8>
194template<
typename CHAR_T,
bool MEMORY_EFFICIENT,
typename RANK_T,
unsigned CHAR_SIZE_BITS>
208template<
typename CHAR_T,
bool MEMORY_EFFICIENT,
typename RANK_T,
unsigned CHAR_SIZE_BITS>
216template<
typename CHAR_T,
bool MEMORY_EFFICIENT,
typename RANK_T,
unsigned CHAR_SIZE_BITS>
217typename ParallelZipTrie<CHAR_T, MEMORY_EFFICIENT, RANK_T, CHAR_SIZE_BITS>::ComparisonResult ParallelZipTrie<CHAR_T, MEMORY_EFFICIENT, RANK_T, CHAR_SIZE_BITS>::k_compare(
const KEY_T* x,
const Bucket&
v,
const AncestorLCPs& ancestor_lcps,
size_t&
comparison_size,
size_t&
max_copied)
const noexcept
272template<
typename CHAR_T,
bool MEMORY_EFFICIENT,
typename RANK_T,
unsigned CHAR_SIZE_BITS>
291template <
typename CHAR_T,
bool MEMORY_EFFICIENT,
typename RANK_T,
unsigned CHAR_SIZE_BITS>
299 _buckets.push_back({ key, RANK_T::get_random() });
Defines the BitString class for compact character string storage and comparison.
Defines the ZipTrie class, a dynamic, ranked trie structure for efficient string storage and prefix o...
Extends the ZipTrie class to incorporate parallel key comparisons leveraging GPU acceleration (CUDA).
uintmax_t * d_largeblock
Pointer to auxiliary device memory buffer ('largeblock'), used as temporary storage or workspace duri...
void insert(const KEY_T *key) noexcept
Inserts a key into the parallel zip trie using parallel comparison logic.
typename ZT::Bucket Bucket
Alias for the Bucket (node) struct from the base class ZipTrie.
ParallelZipTrie(unsigned max_size, unsigned max_lcp_length)
Constructs a ParallelZipTrie.
typename ZT::SearchResults SearchResults
Removes a node with a given key from the zip tree. (Not implemented)
typename ZT::LCP_T LCP_T
Alias for the LCP type used, inherited from the base class (ZipTrie::LCP_T).
typename ZT::KEY_T KEY_T
Alias for the Key type used, inherited from the base class (ZipTrie::KEY_T).
typename ZT::ComparisonResult ComparisonResult
Alias for the ComparisonResult struct from the base class ZipTrie.
uintmax_t * d_a
Pointer to device memory buffer 'a', used as primary input/output for parallel key comparisons (e....
typename ZT::AncestorLCPs AncestorLCPs
Alias for the AncestorLCPs struct from the base class ZipTrie.
~ParallelZipTrie()
Destructor for ParallelZipTrie.
SearchResults search(const KEY_T *key) const noexcept override
Performs a search for a key within the ParallelZipTrie using parallel comparison logic.
ComparisonResult k_compare(const KEY_T *x, const Bucket &v, const AncestorLCPs &ancestor_lcps, size_t &comparison_size, size_t &max_copied) const noexcept
Performs key comparison using parallel logic, overriding the base class k_compare.
Implements a zip trie, a data structure combining properties of tries and zip trees for storing strin...
std::optional< ComparisonResult > k_compare_prefix_check(const Bucket &v, const AncestorLCPs &ancestor_lcps, size_t &out_start_lcp_val) const noexcept
Performs an initial check based on ancestor LCPs before full key comparison (k-compare optimization).
unsigned insert_recursive(Bucket *x, unsigned x_index, unsigned v_index, AncestorLCPs ancestor_lcps, CompareFunction compare_func) noexcept
Recursive helper function for inserting a new node x.
BitString< CHAR_T, CHAR_SIZE_BITS > KEY_T
The type used for keys, an instantiation of the BitString template.
static constexpr unsigned NULLPTR
Represents a null child pointer index using the maximum value of unsigned.
LCP_T convert_lcp(size_t val) const noexcept
Converts an exact LCP length (e.g., number of matching characters/bits) to the LCP_T type.
std::vector< Bucket > _buckets
A contiguous vector storing all the nodes (Buckets) of the trie.
MemoryEfficientLCP get_memory_efficient_lcp(size_t num) const noexcept
Converts a standard LCP length (size_t) into the MemoryEfficientLCP format.
uint8_t _log_max_size
Stores the approximate log base 2 of the max_size provided during construction.
unsigned _root_index
Index of the root node within the _buckets vector. Initialized to NULLPTR for an empty trie.
std::conditional_t< MEMORY_EFFICIENT, MemoryEfficientLCP, unsigned > LCP_T
The type used to store Longest Common Prefix values.
unsigned _max_lcp_length
Stores the maximum possible LCP length provided during construction.
SearchResults search_recursive(const KEY_T *key, CompareFunction compare_func) const noexcept
Recursive helper function for the public search method.
unsigned size() const noexcept
Returns the number of nodes (keys) currently stored in the trie.
Provides utility functions and classes for CUDA operations.
void device_free(T *d_arr)
Frees memory on the CUDA device.
T * alloc_to_device(size_t size)
Allocates memory on the CUDA device.
uintmax_t * alloc_large_block_to_device(size_t n)
Allocates a large block of device memory for parallel mismatch operations.
Stores the Longest Common Prefix (LCP) values associated with the path from the root down to a node's...
Represents a single node (bucket) within the ZipTrie's internal storage.
Holds the result of comparing a search/insert key x with a node v's key, considering the context of a...
Holds the results returned by a search operation (search method).