Browse code

clean up linter warnings

Tom Sherman authored on 24/06/2019 19:44:02
Showing1 changed files
... ...
@@ -7,15 +7,16 @@
7 7
 
8 8
 namespace gaps
9 9
 {
10
+    // constants
10 11
     const float epsilon = 1.0e-5f;
11 12
     const float pi = 3.1415926535897932384626433832795f;
12
-    const float pi_double = 3.1415926535897932384626433832795;
13
+    const double pi_double = 3.1415926535897932384626433832795;
13 14
     const float sqrt2 = 1.4142135623730950488016887242097f;
14 15
 
16
+    // basic calculations
15 17
     float min(float a, float b);
16 18
     unsigned min(unsigned a, unsigned b);
17 19
     uint64_t min(uint64_t a, uint64_t b);
18
-
19 20
     float max(float a, float b);
20 21
     unsigned max(unsigned a, unsigned b);
21 22
     uint64_t max(uint64_t a, uint64_t b);
... ...
@@ -27,9 +28,7 @@ namespace gaps
27 28
     float d_norm(float d, float mean, float sd);
28 29
     float p_norm(float p, float mean, float sd);
29 30
     float q_norm(float q, float mean, float sd);
30
-
31 31
     double lgamma(double x);
32
-
33 32
 } // namespace gaps
34 33
 
35 34
 #endif // __COGAPS_MATH_H__
36 35
\ No newline at end of file
Browse code

updated config to commit file permissions

Tom Sherman authored on 29/10/2018 19:56:14
Showing1 changed files
1 1
old mode 100644
2 2
new mode 100755
Browse code

use free functions instead of class for gaps runner

Tom Sherman authored on 23/10/2018 21:37:09
Showing1 changed files
... ...
@@ -20,6 +20,16 @@ namespace gaps
20 20
     unsigned max(unsigned a, unsigned b);
21 21
     uint64_t max(uint64_t a, uint64_t b);
22 22
 
23
+    // distribution calculations (cdf, pdf, quantile)
24
+    float d_gamma(float d, float shape, float scale);
25
+    float p_gamma(float p, float shape, float scale);
26
+    float q_gamma(float q, float shape, float scale);
27
+    float d_norm(float d, float mean, float sd);
28
+    float p_norm(float p, float mean, float sd);
29
+    float q_norm(float q, float mean, float sd);
30
+
31
+    double lgamma(double x);
32
+
23 33
 } // namespace gaps
24 34
 
25 35
 #endif // __COGAPS_MATH_H__
26 36
\ No newline at end of file
Browse code

dense sampler appears to be working

Tom Sherman authored on 15/10/2018 20:52:28
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+#ifndef __COGAPS_MATH_H__
2
+#define __COGAPS_MATH_H__
3
+
4
+#include <stdint.h>
5
+#include <string>
6
+#include <sstream>
7
+
8
+namespace gaps
9
+{
10
+    const float epsilon = 1.0e-5f;
11
+    const float pi = 3.1415926535897932384626433832795f;
12
+    const float pi_double = 3.1415926535897932384626433832795;
13
+    const float sqrt2 = 1.4142135623730950488016887242097f;
14
+
15
+    float min(float a, float b);
16
+    unsigned min(unsigned a, unsigned b);
17
+    uint64_t min(uint64_t a, uint64_t b);
18
+
19
+    float max(float a, float b);
20
+    unsigned max(unsigned a, unsigned b);
21
+    uint64_t max(uint64_t a, uint64_t b);
22
+
23
+} // namespace gaps
24
+
25
+#endif // __COGAPS_MATH_H__
0 26
\ No newline at end of file
Browse code

basic framework in place for full async

Tom Sherman authored on 29/08/2018 21:41:05
Showing1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,34 +0,0 @@
1
-#ifndef __COGAPS_MATH_H__
2
-#define __COGAPS_MATH_H__
3
-
4
-#include <stdint.h>
5
-#include <string>
6
-#include <sstream>
7
-
8
-namespace gaps
9
-{
10
-    const float epsilon = 1.0e-10f;
11
-    const float pi = 3.1415926535897932384626433832795f;
12
-    const float pi_double = 3.1415926535897932384626433832795;
13
-
14
-    float min(float a, float b);
15
-    unsigned min(unsigned a, unsigned b);
16
-    uint64_t min(uint64_t a, uint64_t b);
17
-
18
-    float max(float a, float b);
19
-    unsigned max(unsigned a, unsigned b);
20
-    uint64_t max(uint64_t a, uint64_t b);
21
-
22
-    template <class T>
23
-    std::string to_string(T a);
24
-}
25
-
26
-template <class T>
27
-std::string gaps::to_string(T a)
28
-{
29
-    std::stringstream ss;
30
-    ss << a;
31
-    return ss.str();
32
-}
33
-
34
-#endif
35 0
\ No newline at end of file
Browse code

Use OptionalFloats instead of pair<bool, float>

Tom Sherman authored on 23/08/2018 22:31:43
Showing1 changed files
... ...
@@ -8,8 +8,8 @@
8 8
 namespace gaps
9 9
 {
10 10
     const float epsilon = 1.0e-10f;
11
-    const float pi = 3.14159265358979323846264f;
12
-    const float pi_double = 3.14159265358979323846264;
11
+    const float pi = 3.1415926535897932384626433832795f;
12
+    const float pi_double = 3.1415926535897932384626433832795;
13 13
 
14 14
     float min(float a, float b);
15 15
     unsigned min(unsigned a, unsigned b);
Browse code

wrapped new RNG in old interface

Tom Sherman authored on 15/08/2018 15:08:15
Showing1 changed files
... ...
@@ -9,6 +9,7 @@ namespace gaps
9 9
 {
10 10
     const float epsilon = 1.0e-10f;
11 11
     const float pi = 3.14159265358979323846264f;
12
+    const float pi_double = 3.14159265358979323846264;
12 13
 
13 14
     float min(float a, float b);
14 15
     unsigned min(unsigned a, unsigned b);
Browse code

added more features to GWCoGAPS and scCoGAPS

Tom Sherman authored on 08/08/2018 22:34:56
Showing1 changed files
... ...
@@ -2,6 +2,8 @@
2 2
 #define __COGAPS_MATH_H__
3 3
 
4 4
 #include <stdint.h>
5
+#include <string>
6
+#include <sstream>
5 7
 
6 8
 namespace gaps
7 9
 {
... ...
@@ -15,6 +17,17 @@ namespace gaps
15 17
     float max(float a, float b);
16 18
     unsigned max(unsigned a, unsigned b);
17 19
     uint64_t max(uint64_t a, uint64_t b);
20
+
21
+    template <class T>
22
+    std::string to_string(T a);
23
+}
24
+
25
+template <class T>
26
+std::string gaps::to_string(T a)
27
+{
28
+    std::stringstream ss;
29
+    ss << a;
30
+    return ss.str();
18 31
 }
19 32
 
20 33
 #endif
21 34
\ No newline at end of file
Browse code

clean up output

Tom Sherman authored on 02/08/2018 16:52:31
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,20 @@
1
+#ifndef __COGAPS_MATH_H__
2
+#define __COGAPS_MATH_H__
3
+
4
+#include <stdint.h>
5
+
6
+namespace gaps
7
+{
8
+    const float epsilon = 1.0e-10f;
9
+    const float pi = 3.14159265358979323846264f;
10
+
11
+    float min(float a, float b);
12
+    unsigned min(unsigned a, unsigned b);
13
+    uint64_t min(uint64_t a, uint64_t b);
14
+
15
+    float max(float a, float b);
16
+    unsigned max(unsigned a, unsigned b);
17
+    uint64_t max(uint64_t a, uint64_t b);
18
+}
19
+
20
+#endif
0 21
\ No newline at end of file