Skip to content

Commit 0a104fb

Browse files
committed
chore: address PR review feedback
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent a59b43a commit 0a104fb

File tree

6 files changed

+24
-27
lines changed

6 files changed

+24
-27
lines changed

lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,32 +176,44 @@ double stdlib_base_dists_logistic_entropy( const double mu, const double s );
176176
```
177177
178178
</section>
179+
179180
<!-- /.usage -->
181+
180182
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
183+
181184
<section class="notes">
185+
182186
</section>
187+
183188
<!-- /.notes -->
189+
184190
<!-- C API usage examples. -->
191+
185192
<section class="examples">
193+
186194
### Examples
195+
187196
```c
188197
#include "stdlib/stats/base/dists/logistic/entropy.h"
189198
#include <stdlib.h>
190199
#include <stdio.h>
200+
191201
static double random_uniform( const double min, const double max ) {
192202
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
193203
return min + ( v*(max-min) );
194204
}
205+
195206
int main( void ) {
196207
double mu;
197208
double s;
198209
double y;
199210
int i;
211+
200212
for ( i = 0; i < 25; i++ ) {
201213
mu = random_uniform( 0.0, 10.0 ) - 5.0;
202214
s = random_uniform( 0.0, 20.0 );
203215
y = stdlib_base_dists_logistic_entropy( mu, s );
204-
printf( "µ: %lf, s: %lf, Ent(X;µ,s): %lf\n", mu, s, y );
216+
printf( "µ: %lf, s: %lf, h(X;µ,s): %lf\n", mu, s, y );
205217
}
206218
}
207219
```

lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/benchmark/benchmark.native.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
2626
var tryRequire = require( '@stdlib/utils/try-require' );
27-
var randu = require( '@stdlib/random/base/randu' );
27+
var uniform = require( '@stdlib/random/base/uniform' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2929
var EPS = require( '@stdlib/constants/float64/eps' );
3030
var pkg = require( './../package.json' ).name;
@@ -51,8 +51,8 @@ bench( pkg, opts, function benchmark( b ) {
5151
mu = new Float64Array( len );
5252
s = new Float64Array( len );
5353
for ( i = 0; i < len; i++ ) {
54-
mu[ i ] = ( randu() * 100.0 ) - 50.0;
55-
s[ i ] = ( randu() * 20.0 ) + EPS;
54+
mu[ i ] = uniform( -50.0, 50.0 );
55+
s[ i ] = uniform( EPS, 20.0 );
5656
}
5757

5858
b.tic();

lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/benchmark/c/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ static double benchmark( void ) {
101101
int i;
102102

103103
for ( i = 0; i < 100; i++ ) {
104-
mu[ i ] = random_uniform( 0.0, 100.0 ) - 50.0;
105-
s[ i ] = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
104+
mu[ i ] = random_uniform( -50.0, 50.0 );
105+
s[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
106106
}
107107

108108
t = tic();

lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ int main( void ) {
3535
mu = random_uniform( 0.0, 10.0 ) - 5.0;
3636
s = random_uniform( 0.0, 20.0 );
3737
y = stdlib_base_dists_logistic_entropy( mu, s );
38-
printf( "µ: %lf, s: %lf, Ent(X;µ,s): %lf\n", mu, s, y );
38+
printf( "µ: %lf, s: %lf, h(X;µ,s): %lf\n", mu, s, y );
3939
}
4040
}

lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/lib/native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var addon = require( './../src/addon.node' );
2828
/**
2929
* Returns the differential entropy for a logistic distribution with location `mu` and scale `s`.
3030
*
31+
* @private
3132
* @param {number} mu - location parameter
3233
* @param {PositiveNumber} s - scale parameter
3334
* @returns {number} entropy

lib/node_modules/@stdlib/stats/base/dists/logistic/entropy/src/main.c

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,13 @@
2323
/**
2424
* Returns the differential entropy for a logistic distribution with location `mu` and scale `s`.
2525
*
26-
* @param {number} mu - location parameter
27-
* @param {PositiveNumber} s - scale parameter
28-
* @returns {number} entropy
26+
* @param mu location parameter
27+
* @param s scale parameter
28+
* @return entropy
2929
*
3030
* @example
31-
* var y = entropy( 0.0, 1.0 );
31+
* double y = stdlib_base_dists_logistic_entropy( 0.0, 1.0 );
3232
* // returns 2.0
33-
*
34-
* @example
35-
* var y = entropy( 5.0, 2.0 );
36-
* // returns ~2.693
37-
*
38-
* @example
39-
* var y = entropy( NaN, 1.0 );
40-
* // returns NaN
41-
*
42-
* @example
43-
* var y = entropy( 0.0, NaN );
44-
* // returns NaN
45-
*
46-
* @example
47-
* var y = entropy( 0.0, 0.0 );
48-
* // returns NaN
4933
*/
5034
double stdlib_base_dists_logistic_entropy( const double mu, const double s ) {
5135
if (

0 commit comments

Comments
 (0)