-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNormalTest.h
More file actions
28 lines (23 loc) · 758 Bytes
/
NormalTest.h
File metadata and controls
28 lines (23 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include "TestDistribution.h"
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/normal_distribution.hpp>
template<typename T>
class NormalTest : public TestDistribution<T> {
private:
boost::random::mt19937 generator;
public:
NormalTest(int samples) : TestDistribution<T>(samples) {
time_t now;
time(&now);
generator.seed(now);
}
// Generate normal distribution data with mean and standard deviation
void generateData(T mean, T stdDev) override {
this->data.clear();
boost::random::normal_distribution<T> distribution(mean, stdDev);
for (int i = 0; i < this->numSamples; i++) {
this->data.push_back(distribution(generator));
}
}
};