summaryrefslogtreecommitdiff
path: root/normal_distribution.cpp
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2022-06-21 07:55:51 +0800
committerKunoiSayami <[email protected]>2022-06-21 07:55:51 +0800
commit985dfaf9f1b541b51e020561ccc9b91d9c982510 (patch)
tree2a70518d24b9754d7e6fb086ee81dd00baaacbe7 /normal_distribution.cpp
parent85296957a8d755cda80c5dc00dcef4555ff14ebc (diff)
feat(script): Optimize normal distribution generator
* feat(script): Finish experiment 1 and 2 Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'normal_distribution.cpp')
-rw-r--r--normal_distribution.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/normal_distribution.cpp b/normal_distribution.cpp
index fd52ac1..c320ce4 100644
--- a/normal_distribution.cpp
+++ b/normal_distribution.cpp
@@ -1,4 +1,5 @@
#include <algorithm>
+#include <cassert>
#include <cstdio>
#include <random>
#include <set>
@@ -22,13 +23,13 @@ int main() {
while (set.size() != length) {
auto element = (long long)std::round(normalDistribution(randomEngine));
auto ret = set.insert(element);
- if (ret.second)
+ if (ret.second) {
vector.push_back(element);
+ printf("%lld\n", element);
+ }
}
- for (long long element : vector) {
- printf("%lld\n", element);
- }
+ assert(vector.size() == length);
return 0;
} \ No newline at end of file