Implementation of distribution based random data generation in C++
Report Bug
·
Request Feature
This project provides a simple command-line tool for generating distribution files and data files based on those distributions. With this tool, you can easily generate files containing distribution data for Laplace, normal, or uniform distributions, and generate data samples from existing distribution files.
To generate a distribution file, simply specify the distribution type (uniform, normal, or Laplace), mean (for normal and Laplace distributions), and any other necessary parameters (such as standard deviation for the normal distribution or scale parameter for the Laplace distribution). The tool will then generate a file containing 256 numbers representing the specified distribution.
To generate data samples from a distribution file, specify the input distribution file and the number of samples to generate. The tool will generate a file containing the specified number of samples, drawn from the distribution specified in the input file.
Clone the repo
git clone https://github.com/kkuchar2/distribution-data-generatorMake sure you've installed cxxopts library
sudo apt-get install libcxxopts-devBuild executable
cd distribution-data-generator
mkdir build
cd build
cmake ..
make./distribution-generator [OPTIONS]
-h, --help Show help
-g, --generator Generate a file with distribution data
-d, --data Generate data samples using distribution file
-i, --input_file=INPUT Input distribution file
-c, --sample_count=COUNT Number of samples to generate
-o, --output_file=OUTPUT Output file
-t, --distribution=TYPE Distribution type [uniform|normal|laplace]
-m, --mean=MEAN Mean for normal or laplace distribution [double]
-s, --standard_deviation=SD Standard deviation for normal distribution
-l, --lambda=SCALE Scale parameter for Laplace distributionGenerate distribution file:
./distribution-generator -g -o distribution.txt -t normal -m 0 -s 1
./distribution-generator -g -o distribution.txt -t laplace -m 0 -l 1
./distribution-generator -g -o distribution.txt -t uniform
Generate data samples:
./distribution-generator -d -i distribution.txt -o data.txt -c 1000Distributed under the MIT License. See LICENSE for more information.