#include #include #include #include #include #include #include #ifndef DISTRIBUTIONS_HPP class DistributionPair { public: DistributionPair(std::uint32_t minValue, std::uint32_t maxValue) : minValue(minValue), maxValue(maxValue), count(0) { } std::uint32_t minValue; std::uint32_t maxValue; std::uint32_t count; }; /* @param title: std::string, the title to display of the plot @param distribution: const std::vector&, reference to bins @param maxPlotLineSize: const std::uint8_t, max length of a line of the plot @return void: plot to stdout */ void plotDistribution(std::string title, const std::vector& distribution, const std::uint8_t maxPlotLineSize); /* @param howMany: uint32_t, the length of the random sequence @param min: uint32_t, the minimum element possible @param max: uint32_t, the maximum element possible @param numberBins: uint8_t, the number of bins to categorize ranges of elements @return std::vector: a vector of bins */ std::vector generateUniformDistribution(std::uint32_t howMany, std::uint32_t min, std::uint32_t max, std::uint8_t numberBins); /* @param howMany: uint32_t, the length of the random sequence @param mean: float, the center of the normal distribution @param stdev: float, the standard deviation of the normal distribution @param numberBins: uint8_t, the number of bins to categorize ranges of elements @return std::vector, a vector of bins */ std::vector generateNormalDistribution(std::uint32_t howMany, float mean, float stdev, std::uint8_t numberBins); /* @param howMany: uint32_t, the length of the random sequence @param howOften: uint8_t, the mean of the Poisson distribution @param numberBins: uint8_t, the number of bins to categorize ranges of elements @return std::vector, a vector of bins */ std::vector generatePoissonDistribution(std::uint32_t howMany, std::uint8_t howOften, std::uint8_t numberBins); #endif // DISTRIBUTIONS_HPP