Skip to content

Commit afc2b75

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

File tree

7 files changed

+11
-23
lines changed

7 files changed

+11
-23
lines changed

lib/node_modules/@stdlib/stats/base/dists/poisson/mode/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ for ( i = 0; i < 10; i++ ) {
146146

147147
#### stdlib_base_dists_poisson_mode( lambda )
148148

149-
Evaluates the mode of a Poisson distribution.
149+
Returns the mode of a Poisson distribution.
150150

151151
```c
152152
double out = sstdlib_base_dists_poisson_mode( 9.0 );
@@ -197,7 +197,7 @@ int main( void ) {
197197
for ( i = 0; i < 10; i++ ) {
198198
lambda = random_uniform( 0.0, 10.0 );
199199
y = stdlib_base_dists_poisson_mode( lambda );
200-
printf( "\u03bb: %.4f, Mode(X;\u03bb): %.4f\n", lambda, y );
200+
printf( "λ: %.4f, Mode(X;λ): %.4f\n", lambda, y );
201201
}
202202
}
203203
```

lib/node_modules/@stdlib/stats/base/dists/poisson/mode/benchmark/benchmark.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26-
var randu = require( '@stdlib/random/base/randu' );
26+
var uniform = require( '@stdlib/random/base/uniform' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var tryRequire = require( '@stdlib/utils/try-require' );
2929
var EPS = require( '@stdlib/constants/float64/eps' );
@@ -49,7 +49,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4949
len = 100;
5050
lambda = new Float64Array( len );
5151
for ( i = 0; i < len; i++ ) {
52-
lambda[ i ] = ( randu() * 20.0 ) + EPS;
52+
lambda[ i ] = uniform( EPS, 20.0 );
5353
}
5454
b.tic();
5555
for ( i = 0; i < b.iterations; i++ ) {

lib/node_modules/@stdlib/stats/base/dists/poisson/mode/benchmark/c/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ static double benchmark( void ) {
9999
int i;
100100

101101
for ( i = 0; i < 100; i++ ) {
102-
lambda[i] = random_uniform(0.0, 20.0);
102+
lambda[ i ] = random_uniform( 0.0, 20.0 );
103103
}
104104

105105
t = tic();
106106
for ( i = 0; i < ITERATIONS; i++ ) {
107-
y = stdlib_base_dists_poisson_mode(lambda[i%100]);
107+
y = stdlib_base_dists_poisson_mode( lambda[ i % 100 ] );
108108
if ( y != y ) {
109109
printf( "should not return NaN\n" );
110110
break;

lib/node_modules/@stdlib/stats/base/dists/poisson/mode/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ int main( void ) {
3333
for ( i = 0; i < 10; i++ ) {
3434
lambda = random_uniform( 0.0, 20.0 );
3535
y = stdlib_base_dists_poisson_mode( lambda );
36-
printf( "\u03bb: %.4f, Mode(X;\u03bb): %.4f\n", lambda, y );
36+
printf( "λ: %.4f, Mode(X;λ): %.4f\n", lambda, y );
3737
}
3838
}

lib/node_modules/@stdlib/stats/base/dists/poisson/mode/include/stdlib/stats/base/dists/poisson/mode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Evaluates the mode for a Poisson distribution with parameter `lambda`.
30+
* Returns the mode for a Poisson distribution with parameter `lambda`.
3131
*/
3232
double stdlib_base_dists_poisson_mode( const double lambda );
3333

lib/node_modules/@stdlib/stats/base/dists/poisson/mode/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-
* Evaluates the mode of a Poisson distribution.
29+
* Returns the mode of a Poisson distribution.
3030
*
3131
* @private
3232
* @param {NonNegativeNumber} lambda - mean parameter

lib/node_modules/@stdlib/stats/base/dists/poisson/mode/src/main.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,12 @@
2323
/**
2424
* Returns the mode of a Poisson distribution with parameter `lambda`.
2525
*
26-
* @param lambda mean parameter of the distribution
27-
* @return mode of the Poisson distribution
26+
* @param lambda mean parameter
27+
* @return mode
2828
*
2929
* @example
3030
* double y = stdlib_base_dists_poisson_mode( 9.0 );
3131
* // returns 9
32-
*
33-
* @example
34-
* double y = stdlib_base_dists_poisson_mode( 1.0 );
35-
* // returns 1
36-
*
37-
* @example
38-
* double y = stdlib_base_dists_poisson_mode( -0.2 );
39-
* // returns NaN
40-
*
41-
* @example
42-
* double y = stdlib_base_dists_poisson_mode( NAN );
43-
* // returns NaN
4432
*/
4533
double stdlib_base_dists_poisson_mode( const double lambda ) {
4634
if (

0 commit comments

Comments
 (0)