Skip to content

Commit ceb625c

Browse files
committed
fix: implement C Doxygen style comments in main.c
--- 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: na - 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: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - 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 cbca601 commit ceb625c

File tree

3 files changed

+49
-50
lines changed

3 files changed

+49
-50
lines changed

lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/benchmark/benchmark.js

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2020 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -20,27 +20,19 @@
2020

2121
// MODULES //
2222

23-
var resolve = require( 'path' ).resolve;
2423
var bench = require( '@stdlib/bench' );
2524
var Float64Array = require( '@stdlib/array/float64' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2626
var randu = require( '@stdlib/random/base/randu' );
2727
var ceil = require( '@stdlib/math/base/special/ceil' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
29-
var tryRequire = require( '@stdlib/utils/try-require' );
3029
var pkg = require( './../package.json' ).name;
31-
32-
33-
// VARIABLES //
34-
35-
var pdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
36-
var opts = {
37-
'skip': ( pdf instanceof Error )
38-
};
30+
var pdf = require( './../lib' );
3931

4032

4133
// MAIN //
4234

43-
bench( pkg, opts, function benchmark( b ) {
35+
bench( pkg, function benchmark( b ) {
4436
var len;
4537
var n;
4638
var x;
@@ -69,3 +61,29 @@ bench( pkg, opts, function benchmark( b ) {
6961
b.pass( 'benchmark finished' );
7062
b.end();
7163
});
64+
65+
bench( pkg+':factory', function benchmark( b ) {
66+
var mypdf;
67+
var n;
68+
var x;
69+
var y;
70+
var i;
71+
72+
n = 20;
73+
mypdf = pdf.factory( n );
74+
x = uniform( 100, -2.0, 2.0 );
75+
76+
b.tic();
77+
for ( i = 0; i < b.iterations; i++ ) {
78+
y = mypdf( x[ i % x.length] );
79+
if ( isnan( y ) ) {
80+
b.fail( 'should not return NaN' );
81+
}
82+
}
83+
b.toc();
84+
if ( isnan( y ) ) {
85+
b.fail( 'should not return NaN' );
86+
}
87+
b.pass( 'benchmark finished' );
88+
b.end();
89+
});

lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/benchmark/benchmark.native.js

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -20,19 +20,27 @@
2020

2121
// MODULES //
2222

23+
var resolve = require( 'path' ).resolve;
2324
var bench = require( '@stdlib/bench' );
2425
var Float64Array = require( '@stdlib/array/float64' );
25-
var uniform = require( '@stdlib/random/array/uniform' );
2626
var randu = require( '@stdlib/random/base/randu' );
2727
var ceil = require( '@stdlib/math/base/special/ceil' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
29+
var tryRequire = require( '@stdlib/utils/try-require' );
2930
var pkg = require( './../package.json' ).name;
30-
var pdf = require( './../lib' );
31+
32+
33+
// VARIABLES //
34+
35+
var pdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
36+
var opts = {
37+
'skip': ( pdf instanceof Error )
38+
};
3139

3240

3341
// MAIN //
3442

35-
bench( pkg, function benchmark( b ) {
43+
bench( pkg, opts, function benchmark( b ) {
3644
var len;
3745
var n;
3846
var x;
@@ -61,29 +69,3 @@ bench( pkg, function benchmark( b ) {
6169
b.pass( 'benchmark finished' );
6270
b.end();
6371
});
64-
65-
bench( pkg+':factory', function benchmark( b ) {
66-
var mypdf;
67-
var n;
68-
var x;
69-
var y;
70-
var i;
71-
72-
n = 20;
73-
mypdf = pdf.factory( n );
74-
x = uniform( 100, -2.0, 2.0 );
75-
76-
b.tic();
77-
for ( i = 0; i < b.iterations; i++ ) {
78-
y = mypdf( x[ i % x.length] );
79-
if ( isnan( y ) ) {
80-
b.fail( 'should not return NaN' );
81-
}
82-
}
83-
b.toc();
84-
if ( isnan( y ) ) {
85-
b.fail( 'should not return NaN' );
86-
}
87-
b.pass( 'benchmark finished' );
88-
b.end();
89-
});

lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/src/main.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
#include <stdint.h>
2626

2727
/**
28-
* Calculates the weight for the `(x,n)` pair and memoizes the result.
28+
* Calculates the weight for the (x,n) pair and memoizes the result.
2929
*
30-
* @private
31-
* @param {number} x - input value
32-
* @param {NonNegativeInteger} n - number of observations
33-
* @returns {number} weight
30+
* @param x Input value
31+
* @param n Number of observations (must be a non-negative)
32+
* @return Weight value
3433
*/
3534
static double weights( double x, const int32_t n ) {
3635
double mlim;
@@ -51,9 +50,9 @@ static double weights( double x, const int32_t n ) {
5150
/**
5251
* Evaluates the probability density function (PDF) of the Wilcoxon signed rank test statistic with `n` observations.
5352
*
54-
* @param {number} x - input value
55-
* @param {PositiveInteger} n - number of observations
56-
* @returns {Probability} evaluated PDF
53+
* @param x Input value
54+
* @param n Number of observations (must be a non-negative)
55+
* @return Evaluated PDF
5756
*
5857
* @example
5958
* double y = stdlib_base_dists_signrank_pdf( 7.0, 9 );

0 commit comments

Comments
 (0)