Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


🌀

distribution-data-generator

Implementation of distribution based random data generation in C++

Report Bug · Request Feature

Table of Contents

About The Project

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.

Getting Started

Clone the repo

git clone https://github.com/kkuchar2/distribution-data-generator

Make sure you've installed cxxopts library

sudo apt-get install libcxxopts-dev

Build executable

cd distribution-data-generator
mkdir build
cd build
cmake ..
make

Usage

./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 distribution

Examples

Generate 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 1000

License

Distributed under the MIT License. See LICENSE for more information.

About

In progress. Simple random data generator in C++. Implementation of normal, Laplace and uniform distribution.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages