Browse code

removed normal dist

Tom Sherman authored on 15/08/2018 15:08:05
Showing2 changed files

... ...
@@ -52,28 +52,6 @@ TEST_CASE("Test Random.h - Random Number Generation")
52 52
         // TODO
53 53
     }
54 54
 
55
-    SECTION("Test normal distribution")
56
-    {
57
-        // sample distribution
58
-        float mean = 0.f, var = 0.f;
59
-        float norm[1024];
60
-        for (unsigned i = 0; i < 1024; ++i)
61
-        {
62
-            norm[i] = gaps::random::normal(0.f, 1.f);
63
-            mean += norm[i];
64
-        }
65
-
66
-        // check parameters
67
-        mean /= 1024.f;
68
-        for (unsigned i = 0; i < 1000; ++i)
69
-        {
70
-            var += pow(norm[i] - mean, 2);
71
-        }
72
-        var /= 1024.f;
73
-        REQUIRE(mean == Approx(0.f).epsilon(0.025f));
74
-        REQUIRE(var == Approx(1.f).epsilon(0.025f));
75
-    }
76
-
77 55
     SECTION("Test poisson distribution")
78 56
     {
79 57
         float total = 0.f;
... ...
@@ -63,7 +63,7 @@ TEST_CASE("Test Archive.h")
63 63
         Vector vec_read(100), vec_write(100);
64 64
         for (unsigned i = 0; i < 100; ++i)
65 65
         {
66
-            vec_write[i] = gaps::random::normal(0.0, 2.0);
66
+            vec_write[i] = gaps::random::uniform(0.0, 2.0);
67 67
         }
68 68
 
69 69
         Archive arWrite("test_ar.temp", ARCHIVE_WRITE);
... ...
@@ -91,8 +91,8 @@ TEST_CASE("Test Archive.h")
91 91
         {
92 92
             for (unsigned j = 0; j < 100; ++j)
93 93
             {
94
-                rMat_write(i,j) = gaps::random::normal(0.0, 2.0);
95
-                cMat_write(i,j) = gaps::random::normal(0.0, 2.0);
94
+                rMat_write(i,j) = gaps::random::uniform(0.0, 2.0);
95
+                cMat_write(i,j) = gaps::random::uniform(0.0, 2.0);
96 96
             }
97 97
         }
98 98
 
... ...
@@ -146,7 +146,6 @@ TEST_CASE("Test Archive.h")
146 146
         {
147 147
             randSequence.push_back(gaps::random::uniform());
148 148
             randSequence.push_back(gaps::random::uniform(0.3, 6.4));
149
-            randSequence.push_back(gaps::random::normal(0.0, 2.0));
150 149
             randSequence.push_back(gaps::random::exponential(5.5));
151 150
         }
152 151
     
... ...
@@ -159,7 +158,6 @@ TEST_CASE("Test Archive.h")
159 158
         {
160 159
             REQUIRE(gaps::random::uniform() == randSequence[i++]);
161 160
             REQUIRE(gaps::random::uniform(0.3, 6.4) == randSequence[i++]);
162
-            REQUIRE(gaps::random::normal(0.0, 2.0) == randSequence[i++]);
163 161
             REQUIRE(gaps::random::exponential(5.5) == randSequence[i]);
164 162
         }
165 163
     }