Skip to content

Commit 31d2fba

Browse files
committed
fix: addressing second round comments
--- 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: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - 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: na - task: lint_c_examples status: passed - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent cd443b8 commit 31d2fba

8 files changed

Lines changed: 116 additions & 95 deletions

File tree

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logpdf/README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ y = mylogpdf( 1.2 );
132132
```javascript
133133
var randu = require( '@stdlib/random/base/randu' );
134134
var logpdf = require( '@stdlib/stats/base/dists/halfnormal/logpdf' );
135+
135136
var i;
136137
var x;
137138
var y;
@@ -141,14 +142,30 @@ for ( i = 0; i < 25; i++ ) {
141142
x = randu() * 3.0;
142143
sigma = randu() * 3.0;
143144
y = logpdf( x, sigma );
144-
console.log( 'x: %d, σ: %d, ln(f(x;σ)): %d', x.toFixed( 4 ), sigma.toFixed( 4 ), y.toFixed( 4 ) );
145+
console.log( 'x: %d, σ: %d, ln(f(x;σ)): %d', x, sigma, y );
145146
}
146147
```
147148

148149
</section>
149150

150151
<!-- /.examples -->
151152

153+
<!-- C interface documentation. -->
154+
155+
* * *
156+
157+
<section class="c">
158+
159+
## C APIs
160+
161+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
162+
163+
<section class="intro">
164+
165+
</section>
166+
167+
<!-- /.intro -->
168+
152169
<!-- C usage documentation. -->
153170

154171
<section class="usage">
@@ -213,7 +230,7 @@ int main( void ) {
213230
214231
for ( i = 0; i < 25; i++ ) {
215232
x = random_uniform( 0.0, 10.0 );
216-
sigma = random_uniform( 0.1, 10.0 ); // sigma must be > 0
233+
sigma = random_uniform( 0.1, 10.0 );
217234
y = stdlib_base_dists_halfnormal_logpdf( x, sigma );
218235
printf( "x: %lf, σ: %lf, ln(f(x;σ)): %lf\n", x, sigma, y );
219236
}
@@ -224,6 +241,8 @@ int main( void ) {
224241

225242
<!-- /.examples -->
226243

244+
</section>
245+
227246
<!-- /.c -->
228247

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

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logpdf/benchmark/benchmark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var bench = require( '@stdlib/bench' );
2424
var Float64Array = require( '@stdlib/array/float64' );
2525
var uniform = require( '@stdlib/random/base/uniform' );
26+
var format = require( '@stdlib/string/format' );
2627
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2728
var EPS = require( '@stdlib/constants/float64/eps' );
2829
var pkg = require( './../package.json' ).name;
@@ -61,7 +62,7 @@ bench( pkg, function benchmark( b ) {
6162
b.end();
6263
});
6364

64-
bench( pkg+':factory', function benchmark( b ) {
65+
bench( format( '%s:factory', pkg ), function benchmark( b ) {
6566
var mylogpdf;
6667
var sigma;
6768
var len;

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logpdf/benchmark/benchmark.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25+
var format = require( '@stdlib/string/format' );
2526
var Float64Array = require( '@stdlib/array/float64' );
2627
var randu = require( '@stdlib/random/base/randu' );
2728
var isnan = require( '@stdlib/math/base/assert/is-nan' );
@@ -40,7 +41,7 @@ var opts = {
4041

4142
// MAIN //
4243

43-
bench( pkg+'::native', opts, function benchmark( b ) {
44+
bench( format( '%s::native', pkg ), opts, function benchmark( b ) {
4445
var sigma;
4546
var len;
4647
var x;

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logpdf/examples/c/example.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ int main( void ) {
3333

3434
for ( i = 0; i < 25; i++ ) {
3535
x = random_uniform( 0.0, 10.0 );
36-
sigma = random_uniform( 0.0, 10.0 );
36+
sigma = random_uniform( 0.1, 10.0 );
3737
y = stdlib_base_dists_halfnormal_logpdf( x, sigma );
3838
printf( "x: %lf, σ: %lf, ln(f(x;σ)): %lf\n", x, sigma, y );
3939
}
4040
}
41-

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logpdf/examples/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
var randu = require( '@stdlib/random/base/randu' );
2222
var logpdf = require( './../lib' );
23+
2324
var i;
2425
var x;
2526
var y;
@@ -29,5 +30,5 @@ for ( i = 0; i < 25; i++ ) {
2930
x = randu() * 3.0;
3031
sigma = randu() * 3.0;
3132
y = logpdf( x, sigma );
32-
console.log( 'x: %lf, σ: %lf, ln(f(x;σ)): %lf', x, sigma, y );
33+
console.log( 'x: %d, σ: %d, ln(f(x;σ)): %d', x, sigma, y );
3334
}
Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
11
{
2-
"options": {
3-
"task": "build",
4-
"wasm": false
2+
"options": {
3+
"task": "build",
4+
"wasm": false
5+
},
6+
"fields": [
7+
{
8+
"field": "src",
9+
"resolve": true,
10+
"relative": true
511
},
6-
"fields": [
7-
{
8-
"field": "src",
9-
"resolve": true,
10-
"relative": true
11-
},
12-
{
13-
"field": "include",
14-
"resolve": true,
15-
"relative": true
16-
},
17-
{
18-
"field": "libraries",
19-
"resolve": false,
20-
"relative": false
21-
},
22-
{
23-
"field": "libpath",
24-
"resolve": true,
25-
"relative": false
26-
}
27-
],
28-
"confs": [
29-
{
30-
"task": "build",
31-
"wasm": false,
32-
"src": [
33-
"./src/main.c"
34-
],
35-
"include": [
36-
"./include"
37-
],
38-
"libraries": [],
39-
"libpath": [],
40-
"dependencies": [
41-
"@stdlib/math/base/napi/binary",
42-
"@stdlib/math/base/assert/is-nan",
43-
"@stdlib/math/base/special/ln",
44-
"@stdlib/constants/float64/ninf",
45-
"@stdlib/constants/float64/ln-two",
46-
"@stdlib/constants/float64/ln-pi"
47-
]
48-
},
49-
{
50-
"task": "benchmark",
51-
"wasm": false,
52-
"src": [
53-
"./src/main.c"
54-
],
55-
"include": [
56-
"./include"
57-
],
58-
"libraries": [],
59-
"libpath": [],
60-
"dependencies": [
61-
"@stdlib/constants/float64/eps",
62-
"@stdlib/math/base/assert/is-nan",
63-
"@stdlib/math/base/special/ln",
64-
"@stdlib/constants/float64/ninf",
65-
"@stdlib/constants/float64/ln-two",
66-
"@stdlib/constants/float64/ln-pi"
67-
]
68-
},
69-
{
70-
"task": "examples",
71-
"wasm": false,
72-
"src": [
73-
"./src/main.c"
74-
],
75-
"include": [
76-
"./include"
77-
],
78-
"libraries": [],
79-
"libpath": [],
80-
"dependencies": [
81-
"@stdlib/math/base/assert/is-nan",
82-
"@stdlib/math/base/special/ln",
83-
"@stdlib/constants/float64/ninf",
84-
"@stdlib/constants/float64/ln-two",
85-
"@stdlib/constants/float64/ln-pi"
86-
]
87-
}
88-
]
12+
{
13+
"field": "include",
14+
"resolve": true,
15+
"relative": true
16+
},
17+
{
18+
"field": "libraries",
19+
"resolve": false,
20+
"relative": false
21+
},
22+
{
23+
"field": "libpath",
24+
"resolve": true,
25+
"relative": false
26+
}
27+
],
28+
"confs": [
29+
{
30+
"task": "build",
31+
"wasm": false,
32+
"src": [
33+
"./src/main.c"
34+
],
35+
"include": [
36+
"./include"
37+
],
38+
"libraries": [],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/math/base/napi/binary",
42+
"@stdlib/math/base/assert/is-nan",
43+
"@stdlib/math/base/special/ln",
44+
"@stdlib/constants/float64/ninf",
45+
"@stdlib/constants/float64/ln-two",
46+
"@stdlib/constants/float64/ln-pi"
47+
]
48+
},
49+
{
50+
"task": "benchmark",
51+
"wasm": false,
52+
"src": [
53+
"./src/main.c"
54+
],
55+
"include": [
56+
"./include"
57+
],
58+
"libraries": [],
59+
"libpath": [],
60+
"dependencies": [
61+
"@stdlib/constants/float64/eps",
62+
"@stdlib/math/base/assert/is-nan",
63+
"@stdlib/math/base/special/ln",
64+
"@stdlib/constants/float64/ninf",
65+
"@stdlib/constants/float64/ln-two",
66+
"@stdlib/constants/float64/ln-pi"
67+
]
68+
},
69+
{
70+
"task": "examples",
71+
"wasm": false,
72+
"src": [
73+
"./src/main.c"
74+
],
75+
"include": [
76+
"./include"
77+
],
78+
"libraries": [],
79+
"libpath": [],
80+
"dependencies": [
81+
"@stdlib/math/base/assert/is-nan",
82+
"@stdlib/math/base/special/ln",
83+
"@stdlib/constants/float64/ninf",
84+
"@stdlib/constants/float64/ln-two",
85+
"@stdlib/constants/float64/ln-pi"
86+
]
87+
}
88+
]
8989
}

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logpdf/test/fixtures/julia/data.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/node_modules/@stdlib/stats/base/dists/halfnormal/logpdf/test/fixtures/julia/runner.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ file = @__FILE__;
6969
dir = dirname( file );
7070

7171
# Generate a single fixture file:
72-
x = rand( 10 ) .* 10.0;
72+
x = rand( 1000 ) .* 10.0;
7373
sigma = rand( 1000 ) .* 10.0 .+ 1e-80; # Ensure sigma is positive
7474
gen( x, sigma, "data.json" );

0 commit comments

Comments
 (0)