Skip to content

Commit 0bf689f

Browse files
feat(add c implementation): add stats/base/dists/bernoulli/kurtosis
1 parent f1efcc9 commit 0bf689f

File tree

11 files changed

+100
-38
lines changed

11 files changed

+100
-38
lines changed

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/README.md

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,92 @@ for ( i = 0; i < 10; i++ ) {
120120

121121
</section>
122122

123-
<!-- /.examples -->
123+
<!-- C interface documentation. -->
124+
125+
* * *
126+
127+
<section class="c">
128+
129+
## C APIs
130+
131+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
132+
133+
<section class="intro">
134+
135+
</section>
136+
137+
<!-- /.intro -->
138+
139+
<!-- C usage documentation. -->
140+
141+
<section class="usage">
142+
143+
### Usage
144+
145+
```c
146+
#include "stdlib/stats/base/dists/bernoulli/kurtosis.h"
147+
```
148+
149+
#### stdlib_base_dists_bernoulli_kurtosis( p )
150+
151+
Returns the [excess kurtosis][kurtosis] of a [Bernoulli][bernoulli-distribution] distribution with success probability `p`.
152+
153+
```c
154+
double out = stdlib_base_dists_bernoulli_kurtosis( 0.1 );
155+
// returns ~5.111
156+
```
124157

125-
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
158+
The function accepts the following arguments:
126159

127-
<section class="references">
160+
- **p**: `[in] double` maximum support.
161+
162+
```c
163+
double stdlib_base_dists_bernoulli_kurtosis( const double p );
164+
```
165+
166+
</section>
167+
168+
<!-- /.usage -->
169+
170+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
171+
172+
<section class="notes">
173+
174+
</section>
175+
176+
<!-- /.notes -->
177+
178+
<!-- C API usage examples. -->
179+
180+
<section class="examples">
181+
182+
### Examples
183+
184+
```c
185+
#include "stdlib/stats/base/dists/bernoulli/kurtosis.h"
186+
#include <stdlib.h>
187+
#include <stdio.h>
188+
189+
int main( void ) {
190+
double p;
191+
double y;
192+
int i;
193+
194+
for ( i = 0; i < 25; i++ ) {
195+
p = ( (double)rand() / (double)RAND_MAX );
196+
y = stdlib_base_dists_arcsine_entropy( p );
197+
printf( "p: %lf, Kurt(X;p): %lf\n", p, y );
198+
}
199+
}
200+
```
201+
202+
</section>
203+
204+
<!-- /.examples -->
128205

129206
</section>
130207

131-
<!-- /.references -->
208+
<!-- /.c -->
132209

133210
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
134211

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/benchmark/c/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ run: $(c_targets)
143143
clean:
144144
$(QUIET) -rm -f *.o *.out
145145

146-
.PHONY: clean
146+
.PHONY: clean

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@
167167
], # end actions
168168
}, # end target copy_addon
169169
], # end targets
170-
}
170+
}

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/examples/c/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ run: $(c_targets)
143143
clean:
144144
$(QUIET) -rm -f *.o *.out
145145

146-
.PHONY: clean
146+
.PHONY: clean

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/examples/c/example.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ int main( void ) {
2626
int i;
2727

2828
for ( i = 0; i < 25; i++ ) {
29-
p = ( (double)rand() / (double)RAND_MAX ) ;
29+
p = ( (double)rand() / (double)RAND_MAX );
3030
y = stdlib_base_dists_bernoulli_kurtosis( p );
31-
printf( "x: %lf , H(X;p): %lf\n", p , y );
31+
printf( "x: %lf , H(X;p): %lf\n", p, y );
3232
}
33-
}
33+
}

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/include.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050
'<!@(node -e "var arr = require(\'@stdlib/utils/library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).libpath; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
5151
],
5252
}, # end variables
53-
}
53+
}

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/lib/native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ function kurtosis( p ) {
5858

5959
// EXPORTS //
6060

61-
module.exports = kurtosis;
61+
module.exports = kurtosis;

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/manifest.json

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,8 @@
3838
"libraries": [],
3939
"libpath": [],
4040
"dependencies": [
41-
"@stdlib/math/base/napi/ternary",
42-
"@stdlib/math/base/assert/is-nan",
43-
"@stdlib/math/base/special/ln",
44-
"@stdlib/constants/float64/ln-pi",
45-
"@stdlib/constants/float64/ln-two",
46-
"@stdlib/constants/float64/ninf",
47-
"@stdlib/math/base/special/asin",
48-
"@stdlib/math/base/special/sqrt"
41+
"@stdlib/math/base/napi/unary",
42+
"@stdlib/math/base/assert/is-nan"
4943
]
5044
},
5145
{
@@ -60,13 +54,7 @@
6054
"libraries": [],
6155
"libpath": [],
6256
"dependencies": [
63-
"@stdlib/math/base/assert/is-nan",
64-
"@stdlib/math/base/special/ln",
65-
"@stdlib/constants/float64/ln-pi",
66-
"@stdlib/constants/float64/ln-two",
67-
"@stdlib/constants/float64/ninf",
68-
"@stdlib/math/base/special/asin",
69-
"@stdlib/math/base/special/sqrt"
57+
"@stdlib/math/base/assert/is-nan"
7058
]
7159
},
7260
{
@@ -81,13 +69,7 @@
8169
"libraries": [],
8270
"libpath": [],
8371
"dependencies": [
84-
"@stdlib/math/base/assert/is-nan",
85-
"@stdlib/math/base/special/ln",
86-
"@stdlib/constants/float64/ln-pi",
87-
"@stdlib/constants/float64/ln-two",
88-
"@stdlib/constants/float64/ninf",
89-
"@stdlib/math/base/special/asin",
90-
"@stdlib/math/base/special/sqrt"
72+
"@stdlib/math/base/assert/is-nan"
9173
]
9274
}
9375
]

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
}
1515
],
1616
"main": "./lib",
17+
"gypfile": true,
1718
"directories": {
1819
"benchmark": "./benchmark",
1920
"doc": "./docs",
2021
"example": "./examples",
22+
"include": "./include",
2123
"lib": "./lib",
24+
"src": "./src",
2225
"test": "./test"
2326
},
2427
"types": "./docs/types",

lib/node_modules/@stdlib/stats/base/dists/bernoulli/kurtosis/src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ clean-addon:
6767
#/
6868
clean: clean-addon
6969

70-
.PHONY: clean
70+
.PHONY: clean

0 commit comments

Comments
 (0)