Skip to content

Commit a899535

Browse files
authored
chore: apply suggestions from code review
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent e89333f commit a899535

File tree

10 files changed

+12
-17
lines changed

10 files changed

+12
-17
lines changed

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ for ( i = 0; i < 10; i++ ) {
172172
Returns the [skewness][skewness] of an [Erlang][erlang-distribution] distribution with parameters `k` (shape parameter) and `lambda` (rate parameter).
173173

174174
```c
175-
double y = stdlib_base_dists_erlang_skewness( 1.0, 0.1 );
175+
double y = stdlib_base_dists_erlang_skewness( 1, 1.0 );
176176
// returns 2.0
177177
```
178178

179179
The function accepts the following arguments:
180180

181-
- **k**: `[in] double` shape parameter.
181+
- **k**: `[in] int32_t` shape parameter.
182182
- **lambda**: `[in] double` rate parameter.
183183

184184
```c
@@ -218,8 +218,8 @@ static double random_uniform( const double min, const double max ) {
218218
}
219219
220220
int main( void ) {
221-
int32_t k;
222221
double lambda;
222+
int32_t k;
223223
double y;
224224
int i;
225225

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bench( pkg, function benchmark( b ) {
4444
k = new Int32Array( len );
4545
lambda = new Float64Array( len );
4646
for ( i = 0; i < len; i++ ) {
47-
k[ i ] = discreteUniform( 1.0, 10.0 );
47+
k[ i ] = discreteUniform( 1, 10 );
4848
lambda[ i ] = uniform( EPS, 10.0 );
4949
}
5050

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5454
k = new Int32Array( len );
5555
lambda = new Float64Array( len );
5656
for ( i = 0; i < len; i++ ) {
57-
k[ i ] = discreteUniform( 1.0, 10.0 );
57+
k[ i ] = discreteUniform( 1, 10 );
5858
lambda[ i ] = uniform( EPS, 10.0 );
5959
}
6060

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/benchmark/c/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ static double random_uniform( const double min, const double max ) {
9595
* @return elapsed time in seconds
9696
*/
9797
static double benchmark( void ) {
98-
double elapsed;
99-
int32_t k[ 100 ];
10098
double lambda[ 100 ];
99+
int32_t k[ 100 ];
100+
double elapsed;
101101
double y;
102102
double t;
103103
int i;

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ static double random_uniform( const double min, const double max ) {
2929
}
3030

3131
int main( void ) {
32-
int32_t k;
3332
double lambda;
33+
int32_t k;
3434
double y;
3535
int i;
3636

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/include/stdlib/stats/base/dists/erlang/skewness.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern "C" {
2929
#endif
3030

3131
/**
32-
* Returns the excess skewness for a erlang distribution with shape parameter `k` and rate parameter `lambda`.
32+
* Returns the excess skewness for an Erlang distribution with shape parameter `k` and rate parameter `lambda`.
3333
*/
3434
double stdlib_base_dists_erlang_skewness( const int32_t k, const double lambda );
3535

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/lib/native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' );
2626
// MAIN //
2727

2828
/**
29-
* Returns the skewness of an Erlang distribution.
29+
* Returns the excess skewness for an Erlang distribution with shape parameter `k` and rate parameter `lambda`.
3030
*
3131
* @private
3232
* @param {PositiveInteger} k - shape parameter

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/manifest.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"libpath": [],
4040
"dependencies": [
4141
"@stdlib/math/base/napi/binary",
42-
"@stdlib/math/base/assert/is-positive-integer",
4342
"@stdlib/math/base/assert/is-nan",
4443
"@stdlib/math/base/special/sqrt"
4544
]
@@ -58,7 +57,6 @@
5857
"dependencies": [
5958
"@stdlib/constants/float64/eps",
6059
"@stdlib/math/base/special/ceil",
61-
"@stdlib/math/base/assert/is-positive-integer",
6260
"@stdlib/math/base/assert/is-nan",
6361
"@stdlib/math/base/special/sqrt"
6462
]
@@ -76,7 +74,6 @@
7674
"libpath": [],
7775
"dependencies": [
7876
"@stdlib/constants/float64/eps",
79-
"@stdlib/math/base/assert/is-positive-integer",
8077
"@stdlib/math/base/assert/is-nan",
8178
"@stdlib/math/base/special/round",
8279
"@stdlib/math/base/special/sqrt"

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/src/addon.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
#include "stdlib/math/base/napi/binary.h"
2020
#include "stdlib/stats/base/dists/erlang/skewness.h"
2121

22-
// cppcheck-suppress shadowFunction
2322
STDLIB_MATH_BASE_NAPI_MODULE_ID_D( stdlib_base_dists_erlang_skewness )

lib/node_modules/@stdlib/stats/base/dists/erlang/skewness/src/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,19 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dists/erlang/skewness.h"
20-
#include "stdlib/math/base/assert/is_positive_integer.h"
2120
#include "stdlib/math/base/assert/is_nan.h"
2221
#include "stdlib/math/base/special/sqrt.h"
2322
#include <stdint.h>
2423

2524
/**
26-
* Returns the excess skewness for a erlang distribution with shape parameter `k` and rate parameter `lambda`.
25+
* Returns the excess skewness for an Erlang distribution with shape parameter `k` and rate parameter `lambda`.
2726
*
2827
* @param k shape parameter
2928
* @param lambda rate parameter
3029
* @return excess skewness
3130
*
3231
* @example
33-
* double y = stdlib_base_dists_bernoulli_skewness( 1.0, 0.1 );
32+
* double y = stdlib_base_dists_erlang_skewness( 1, 1.0 );
3433
* // returns 2.0
3534
*/
3635
double stdlib_base_dists_erlang_skewness( const int32_t k, const double lambda ) {

0 commit comments

Comments
 (0)