|
Zip and Skip Tries
|
Implementation of synthetic data generation utilities for benchmark testing. More...

Go to the source code of this file.
Functions | |
| std::string | get_random_word (size_t length) noexcept |
| Implementation of get_random_word function. | |
| std::vector< std::string > | get_random_words (size_t length, size_t num_words, double mean_lcp_length) noexcept |
| Implementation of get_random_words function. | |
Variables | |
| static const std::string | ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" |
| The alphabet used for generating random strings. | |
Implementation of synthetic data generation utilities for benchmark testing.
This file implements the functions declared in synthetic.hpp for generating random strings with controlled properties. The implementation provides two key functions:
The implementation uses C++ standard library random number generators (std::mt19937) and distributions (std::uniform_int_distribution, std::poisson_distribution) to create randomized but statistically controlled datasets. Each generated string includes a unique signature to ensure distinctness while maintaining the desired LCP distribution properties.
These synthetic datasets are essential for benchmarking trie data structures under controlled conditions, allowing for systematic performance analysis with varying input characteristics.
Definition in file synthetic.cpp.
|
noexcept |
Implementation of get_random_word function.
Generates a random string of specified length.
Generates a random string of specified length using characters from the ALPHABET. The implementation uses a static random number generator (std::mt19937) initialized with either a random seed from std::random_device or an optional fixed seed for reproducible results.
Each character in the string is selected independently using a uniform distribution over the entire alphabet, ensuring equal probability for all characters.
| length | The desired length of the random string. |
Definition at line 59 of file synthetic.cpp.
|
noexcept |
Implementation of get_random_words function.
Generates a collection of random strings with controlled commonality.
Generates a collection of random strings with controlled Longest Common Prefix (LCP) properties. The implementation follows these steps:
The Poisson distribution ensures that the LCP lengths follow a realistic distribution with the specified mean, while the unique signatures guarantee that all strings remain distinct regardless of the LCP modifications.
| length | The length of each string to generate. |
| num_words | The number of strings to generate. |
| mean_lcp_length | The mean length of the Longest Common Prefix between strings. |
Definition at line 100 of file synthetic.cpp.
|
static |
The alphabet used for generating random strings.
Contains 94 characters including lowercase letters (a-z), uppercase letters (A-Z), digits (0-9), and special characters. This diverse alphabet provides a large character space for generating random strings, which helps create realistic test data with high entropy. The size of this alphabet also affects the calculation of unique signature length in get_random_words().
Definition at line 44 of file synthetic.cpp.