From e686acb51a836cca58f2043c404ac8d42d12fe5f Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Sun, 26 Jun 2022 20:39:50 +0800 Subject: feat(script): Add E output Signed-off-by: KunoiSayami --- exp_3.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/exp_3.cpp b/exp_3.cpp index a1d55b9..b7598e9 100644 --- a/exp_3.cpp +++ b/exp_3.cpp @@ -12,6 +12,8 @@ int main() { std::vector vector1, vector2; + std::vector E; + std::set set1, set2; FILE *file = fopen("normal_distribution.txt", "r"); @@ -74,9 +76,15 @@ int main() { } // printf("%lld %lld %lld ", *ita, *it, *itb); long double res = (cnt2 + (*iter - *ita) / dx) / (sample_length - 1); - e += std::abs(res - (long double)cnt1 / (length - 1)); + auto single_e = std::abs(res - (long double)cnt1 / (length - 1)); + E.push_back(single_e); + e += single_e; printf("%.4Lf ", res * 100); } printf("\n%.4Lf", e); + for (auto element : E) { + printf("%.8Lf ", element); + } + puts(""); return 0; } \ No newline at end of file -- cgit v1.3.1