Browse code

updated config to commit file permissions

Tom Sherman authored on 29/10/2018 19:56:14
Showing180 changed files

1 1
old mode 100644
2 2
new mode 100755
3 3
old mode 100644
4 4
new mode 100755
5 5
old mode 100644
6 6
new mode 100755
7 7
old mode 100644
8 8
new mode 100755
9 9
old mode 100644
10 10
new mode 100755
11 11
old mode 100644
12 12
new mode 100755
13 13
old mode 100644
14 14
new mode 100755
15 15
old mode 100644
16 16
new mode 100755
17 17
old mode 100644
18 18
new mode 100755
19 19
old mode 100644
20 20
new mode 100755
21 21
old mode 100644
22 22
new mode 100755
23 23
old mode 100644
24 24
new mode 100755
25 25
old mode 100644
26 26
new mode 100755
27 27
old mode 100644
28 28
new mode 100755
29 29
old mode 100644
30 30
new mode 100755
31 31
old mode 100644
32 32
new mode 100755
33 33
old mode 100644
34 34
new mode 100755
35 35
old mode 100644
36 36
new mode 100755
37 37
old mode 100644
38 38
new mode 100755
39 39
old mode 100644
40 40
new mode 100755
41 41
old mode 100644
42 42
new mode 100755
43 43
old mode 100644
44 44
new mode 100755
45 45
old mode 100644
46 46
new mode 100755
47 47
old mode 100644
48 48
new mode 100755
49 49
old mode 100644
50 50
new mode 100755
51 51
old mode 100644
52 52
new mode 100755
53 53
old mode 100644
54 54
new mode 100755
55 55
old mode 100644
56 56
new mode 100755
57 57
old mode 100644
58 58
new mode 100755
59 59
old mode 100644
60 60
new mode 100755
61 61
old mode 100644
62 62
new mode 100755
63 63
old mode 100644
64 64
new mode 100755
65 65
old mode 100644
66 66
new mode 100755
67 67
old mode 100644
68 68
new mode 100755
69 69
old mode 100644
70 70
new mode 100755
71 71
old mode 100644
72 72
new mode 100755
73 73
old mode 100644
74 74
new mode 100755
75 75
old mode 100644
76 76
new mode 100755
77 77
old mode 100644
78 78
new mode 100755
79 79
old mode 100644
80 80
new mode 100755
81 81
old mode 100644
82 82
new mode 100755
83 83
old mode 100644
84 84
new mode 100755
85 85
old mode 100644
86 86
new mode 100755
87 87
old mode 100644
88 88
new mode 100755
89 89
old mode 100644
90 90
new mode 100755
91 91
old mode 100644
92 92
new mode 100755
93 93
old mode 100644
94 94
new mode 100755
95 95
old mode 100644
96 96
new mode 100755
97 97
old mode 100644
98 98
new mode 100755
99 99
old mode 100644
100 100
new mode 100755
101 101
old mode 100644
102 102
new mode 100755
103 103
old mode 100644
104 104
new mode 100755
105 105
old mode 100644
106 106
new mode 100755
107 107
old mode 100644
108 108
new mode 100755
109 109
old mode 100644
110 110
new mode 100755
111 111
old mode 100644
112 112
new mode 100755
113 113
old mode 100644
114 114
new mode 100755
115 115
old mode 100644
116 116
new mode 100755
117 117
old mode 100644
118 118
new mode 100755
119 119
old mode 100644
120 120
new mode 100755
121 121
old mode 100644
122 122
new mode 100755
123 123
old mode 100644
124 124
new mode 100755
125 125
old mode 100644
126 126
new mode 100755
127 127
old mode 100644
128 128
new mode 100755
129 129
old mode 100644
130 130
new mode 100755
131 131
old mode 100644
132 132
new mode 100755
133 133
old mode 100644
134 134
new mode 100755
135 135
old mode 100644
136 136
new mode 100755
137 137
old mode 100644
138 138
new mode 100755
139 139
old mode 100644
140 140
new mode 100755
141 141
old mode 100644
142 142
new mode 100755
143 143
old mode 100644
144 144
new mode 100755
145 145
old mode 100644
146 146
new mode 100755
147 147
old mode 100644
148 148
new mode 100755
149 149
old mode 100644
150 150
new mode 100755
151 151
old mode 100644
152 152
new mode 100755
153 153
old mode 100644
154 154
new mode 100755
155 155
old mode 100644
156 156
new mode 100755
157 157
old mode 100644
158 158
new mode 100755
159 159
old mode 100644
160 160
new mode 100755
161 161
old mode 100644
162 162
new mode 100755
163 163
old mode 100644
164 164
new mode 100755
165 165
old mode 100644
166 166
new mode 100755
167 167
old mode 100644
168 168
new mode 100755
169 169
old mode 100644
170 170
new mode 100755
171 171
old mode 100644
172 172
new mode 100755
173 173
old mode 100644
174 174
new mode 100755
175 175
old mode 100644
176 176
new mode 100755
177 177
old mode 100644
178 178
new mode 100755
179 179
old mode 100644
180 180
new mode 100755
181 181
old mode 100644
182 182
new mode 100755
183 183
old mode 100644
184 184
new mode 100755
185 185
old mode 100644
186 186
new mode 100755
187 187
old mode 100644
188 188
new mode 100755
189 189
old mode 100644
190 190
new mode 100755
191 191
old mode 100644
192 192
new mode 100755
193 193
old mode 100644
194 194
new mode 100755
195 195
old mode 100644
196 196
new mode 100755
197 197
old mode 100644
198 198
new mode 100755
199 199
old mode 100644
200 200
new mode 100755
... ...
@@ -38,6 +38,7 @@ OBJECTS =   Cogaps.o \
38 38
             cpp_tests/testHybridMatrix.o \
39 39
             cpp_tests/testHybridVector.o \
40 40
             cpp_tests/testMatrix.o \
41
+            cpp_tests/testRandom.o \
41 42
             cpp_tests/testSerialization.o \
42 43
             cpp_tests/testSparseGibbsSampler.o \
43 44
             cpp_tests/testSparseIterator.o \
44 45
old mode 100644
45 46
new mode 100755
46 47
old mode 100644
47 48
new mode 100755
48 49
old mode 100644
49 50
new mode 100755
50 51
old mode 100644
51 52
new mode 100755
52 53
old mode 100644
53 54
new mode 100755
54 55
old mode 100644
55 56
new mode 100755
56 57
old mode 100644
57 58
new mode 100755
58 59
old mode 100644
59 60
new mode 100755
60 61
old mode 100644
61 62
new mode 100755
62 63
old mode 100644
63 64
new mode 100755
64 65
old mode 100644
65 66
new mode 100755
66 67
old mode 100644
67 68
new mode 100755
68 69
old mode 100644
69 70
new mode 100755
70 71
old mode 100644
71 72
new mode 100755
72 73
old mode 100644
73 74
new mode 100755
74 75
old mode 100644
75 76
new mode 100755
76 77
old mode 100644
77 78
new mode 100755
... ...
@@ -1,9 +1,37 @@
1 1
 #include "catch.h"
2
-#include "../math/Algorithms.h"
3 2
 #include "../math/Random.h"
3
+#include "../math/Math.h"
4 4
 
5 5
 #define TEST_APPROX(x) Approx(x).epsilon(0.001)
6 6
 
7
+static void requireSmallError(float in, float out, float est, float tol)
8
+{
9
+    float denom = gaps::max(std::abs(out), 1.f);
10
+    if (std::abs(est - out) / denom >= tol)
11
+    {
12
+        gaps_printf("input: %f, output: %f, error: %f\n", in, out,
13
+            std::abs(est - out));
14
+    }
15
+    REQUIRE(std::abs(est - out) / denom < tol);
16
+}
17
+
18
+TEST_CASE("Test error of q_norm lookup table")
19
+{
20
+    GapsRandomState randState(123);
21
+
22
+    const unsigned nIterations = 10000;
23
+    const float mean = 0.f;
24
+    const float sd = 1.f;
25
+    const float tolerance = 0.00001f;
26
+    for (unsigned i = 1; i < nIterations; ++i)
27
+    {
28
+        float q = static_cast<float>(i) / static_cast<float>(nIterations);
29
+        float lookup_val = randState.q_norm_fast(q, mean, sd);
30
+        float actual_val = gaps::q_norm(q, mean, sd);
31
+        requireSmallError(q, actual_val, lookup_val, tolerance);
32
+    }
33
+}
34
+
7 35
 #if 0
8 36
 
9 37
 TEST_CASE("Test Random.h - Random Number Generation")
10 38
old mode 100644
11 39
new mode 100755
12 40
old mode 100644
13 41
new mode 100755
14 42
old mode 100644
15 43
new mode 100755
16 44
old mode 100644
17 45
new mode 100755
18 46
old mode 100644
19 47
new mode 100755
20 48
old mode 100644
21 49
new mode 100755
22 50
old mode 100644
23 51
new mode 100755
24 52
old mode 100644
25 53
new mode 100755
26 54
old mode 100644
27 55
new mode 100755
28 56
old mode 100644
29 57
new mode 100755
30 58
old mode 100644
31 59
new mode 100755
32 60
old mode 100644
33 61
new mode 100755
34 62
old mode 100644
35 63
new mode 100755
36 64
old mode 100644
37 65
new mode 100755
38 66
old mode 100644
39 67
new mode 100755
40 68
old mode 100644
41 69
new mode 100755
42 70
old mode 100644
43 71
new mode 100755
44 72
old mode 100644
45 73
new mode 100755
46 74
old mode 100644
47 75
new mode 100755
48 76
old mode 100644
49 77
new mode 100755
50 78
old mode 100644
51 79
new mode 100755
52 80
old mode 100644
53 81
new mode 100755
54 82
old mode 100644
55 83
new mode 100755
56 84
old mode 100644
57 85
new mode 100755
58 86
old mode 100644
59 87
new mode 100755
60 88
old mode 100644
61 89
new mode 100755
62 90
old mode 100644
63 91
new mode 100755
64 92
old mode 100644
65 93
new mode 100755
66 94
old mode 100644
67 95
new mode 100755
68 96
old mode 100644
69 97
new mode 100755
70 98
old mode 100644
71 99
new mode 100755
72 100
old mode 100644
73 101
new mode 100755
74 102
old mode 100644
75 103
new mode 100755
76 104
old mode 100644
77 105
new mode 100755
78 106
old mode 100644
79 107
new mode 100755
80 108
old mode 100644
81 109
new mode 100755
82 110
old mode 100644
83 111
new mode 100755
84 112
old mode 100644
85 113
new mode 100755
86 114
old mode 100644
87 115
new mode 100755
88 116
old mode 100644
89 117
new mode 100755
90 118
old mode 100644
91 119
new mode 100755
92 120
old mode 100644
93 121
new mode 100755
94 122
old mode 100644
95 123
new mode 100755
96 124
old mode 100644
97 125
new mode 100755
98 126
old mode 100644
99 127
new mode 100755
100 128
old mode 100644
101 129
new mode 100755
102 130
old mode 100644
103 131
new mode 100755
104 132
old mode 100644
105 133
new mode 100755
106 134
old mode 100644
107 135
new mode 100755
108 136
old mode 100644
109 137
new mode 100755
110 138
old mode 100644
111 139
new mode 100755
112 140
old mode 100644
113 141
new mode 100755
114 142
old mode 100644
115 143
new mode 100755
116 144
old mode 100644
117 145
new mode 100755
118 146
old mode 100644
119 147
new mode 100755
120 148
old mode 100644
121 149
new mode 100755
122 150
old mode 100644
123 151
new mode 100755
124 152
old mode 100644
125 153
new mode 100755
126 154
old mode 100644
127 155
new mode 100755
128 156
old mode 100644
129 157
new mode 100755
130 158
old mode 100644
131 159
new mode 100755
132 160
old mode 100644
133 161
new mode 100755
134 162
old mode 100644
135 163
new mode 100755