Skip to content

Commit 3c25701

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

File tree

7 files changed

+9
-13
lines changed

7 files changed

+9
-13
lines changed

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

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

176176
```c
177-
double y = stdlib_base_dists_beta_variance( 1.0, 1.0 );
177+
double y = stdlib_base_dists_beta_variance( 1, 1.0 );
178178
// returns 1.0
179179
```
180180

@@ -221,16 +221,16 @@ static double random_uniform( const double min, const double max ) {
221221
}
222222
223223
int main( void ) {
224-
int32_t k;
225224
double lambda;
225+
int32_t k;
226226
double y;
227227
int i;
228228
229229
for ( i = 0; i < 10; i++ ) {
230230
k = stdlib_base_round( random_uniform( 0.0, 10.0 ) );
231231
lambda = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
232232
y = stdlib_base_dists_erlang_variance( k, lambda );
233-
printf( "k: %d, λ: %lf, Var(X;k,λ):: %lf\n", k, lambda, y );
233+
printf( "k: %d, λ: %lf, Var(X;k,λ): %lf\n", k, lambda, y );
234234
}
235235
}
236236
```

lib/node_modules/@stdlib/stats/base/dists/erlang/variance/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/variance/benchmark/benchmark.native.js

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ 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

3737
for ( i = 0; i < 10; i++ ) {
3838
k = stdlib_base_round( random_uniform( 0.0, 10.0 ) );
3939
lambda = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
4040
y = stdlib_base_dists_erlang_variance( k, lambda );
41-
printf( "k: %d, λ: %lf, Var(X;k,λ):: %lf\n", k, lambda, y );
41+
printf( "k: %d, λ: %lf, Var(X;k,λ): %lf\n", k, lambda, y );
4242
}
4343
}

lib/node_modules/@stdlib/stats/base/dists/erlang/variance/include/stdlib/stats/base/dists/erlang/variance.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 variance for a erlang distribution with shape parameter `k` and rate parameter `lambda`.
32+
* Returns the variance for an Erlang distribution with shape parameter `k` and rate parameter `lambda`.
3333
*/
3434
double stdlib_base_dists_erlang_variance( const int32_t k, const double lambda );
3535

lib/node_modules/@stdlib/stats/base/dists/erlang/variance/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
]
4544
},
@@ -57,7 +56,6 @@
5756
"dependencies": [
5857
"@stdlib/constants/float64/eps",
5958
"@stdlib/math/base/special/ceil",
60-
"@stdlib/math/base/assert/is-positive-integer",
6159
"@stdlib/math/base/assert/is-nan"
6260
]
6361
},
@@ -74,7 +72,6 @@
7472
"libpath": [],
7573
"dependencies": [
7674
"@stdlib/constants/float64/eps",
77-
"@stdlib/math/base/assert/is-positive-integer",
7875
"@stdlib/math/base/assert/is-nan",
7976
"@stdlib/math/base/special/round"
8077
]

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

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

@@ -29,7 +28,7 @@
2928
* @return variance
3029
*
3130
* @example
32-
* double y = stdlib_base_dists_beta_variance( 1.0, 1.0 );
31+
* double y = stdlib_base_dists_erlang_variance( 1, 1.0 );
3332
* // returns 1.0
3433
*/
3534
double stdlib_base_dists_erlang_variance( const int32_t k, const double lambda ) {

0 commit comments

Comments
 (0)