48 std::uniform_real_distribution<dataType> uniformDistribution(-1, 1);
49 u = uniformDistribution(gen);
50 v = (dimension >= 2 ? uniformDistribution(gen) : 0);
51 w = (dimension == 3 ? uniformDistribution(gen) : 0);
53 dataType norm = std::sqrt(u * u + v * v + w * w);
55 std::normal_distribution<dataType> normalDistribution{0, 1};
57 dataType gaussianScale = normalDistribution(gen);
59 x = (u / norm) * gaussianScale;
60 y = (v / norm) * gaussianScale;
61 z = (w / norm) * gaussianScale;
68 const int &numberOfSamples,
70 dataType *
const outputData)
const {
77 for(
int i = 0; i < numberOfSamples; i++) {
78 this->castSample(dimension, gen, outputData[3 * i], outputData[3 * i + 1],
79 outputData[3 * i + 2]);
82 this->
printMsg(std::vector<std::vector<std::string>>{
83 {
"#Samples", std::to_string(numberOfSamples)}});
84 this->
printMsg(
"Samples generated in " + std::to_string(dimension) +
"D", 1.0,
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)