Skip to content

Commit ee78bc0

Browse files
feat: add C ndarray implementation for stats/base/dmeanpn
--- 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: 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: 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent ffa1357 commit ee78bc0

File tree

10 files changed

+29
-23
lines changed

10 files changed

+29
-23
lines changed

lib/node_modules/@stdlib/stats/base/dmeanpn/examples/c/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ int main( void ) {
2828
int64_t N = 4;
2929

3030
// Specify the stride length:
31-
int64_t stride = 2;
31+
int64_t strideX = 2;
3232

3333
// Compute the arithmetic mean:
34-
double v = stdlib_strided_dmeanpn( N, x, stride );
34+
double v = stdlib_strided_dmeanpn( N, x, strideX );
3535

3636
// Print the result:
3737
printf( "mean: %lf\n", v );

lib/node_modules/@stdlib/stats/base/dmeanpn/include/stdlib/stats/base/dmeanpn.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ extern "C" {
3434
double API_SUFFIX( stdlib_strided_dmeanpn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX );
3535

3636
/**
37+
<<<<<<< HEAD
3738
* Computes the arithmetic mean of a double-precision floating-point strided array using a two-pass error correction algorithm.
39+
=======
40+
* Computes the arithmetic mean of a double-precision floating-point strided array using a two-pass error correction algorithm and alternative indexing semantics.
41+
>>>>>>> 19798de3f (feat: add C ndarray implementation for stats/base/dmeanpn)
3842
*/
3943
double API_SUFFIX( stdlib_strided_dmeanpn_ndarray )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
4044

lib/node_modules/@stdlib/stats/base/dmeanpn/lib/dmeanpn.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ var ndarray = require( './ndarray.js' );
4747
* var Float64Array = require( '@stdlib/array/float64' );
4848
*
4949
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
50-
* var N = x.length;
5150
*
52-
* var v = dmeanpn( N, x, 1 );
51+
* var v = dmeanpn( 3, x, 1 );
5352
* // returns ~0.3333
5453
*/
5554
function dmeanpn( N, x, strideX ) {

lib/node_modules/@stdlib/stats/base/dmeanpn/lib/dmeanpn.native.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ var addon = require( './../src/addon.node' );
3737
* var Float64Array = require( '@stdlib/array/float64' );
3838
*
3939
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
40-
* var N = x.length;
4140
*
41+
<<<<<<< HEAD
4242
* var v = dmeanpn( N, x, 1 );
43+
=======
44+
* var v = dmeanpn( 3, x, 1 );
45+
>>>>>>> 19798de3f (feat: add C ndarray implementation for stats/base/dmeanpn)
4346
* //returns ~0.3333
4447
*/
4548
function dmeanpn( N, x, strideX ) {

lib/node_modules/@stdlib/stats/base/dmeanpn/lib/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
* var dmeanpn = require( '@stdlib/stats/base/dmeanpn' );
2929
*
3030
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
31-
* var N = x.length;
3231
*
33-
* var v = dmeanpn( N, x, 1 );
32+
* var v = dmeanpn( 3, x, 1 );
3433
* // returns ~0.3333
3534
*
3635
* @example
@@ -39,9 +38,8 @@
3938
* var dmeanpn = require( '@stdlib/stats/base/dmeanpn' );
4039
*
4140
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
42-
* var N = floor( x.length / 2 );
4341
*
44-
* var v = dmeanpn.ndarray( N, x, 2, 1 );
42+
* var v = dmeanpn.ndarray( 4, x, 2, 1 );
4543
* // returns 1.25
4644
*/
4745

lib/node_modules/@stdlib/stats/base/dmeanpn/lib/ndarray.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ).ndarray;
4949
* var floor = require( '@stdlib/math/base/special/floor' );
5050
*
5151
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
52-
* var N = floor( x.length / 2 );
5352
*
54-
* var v = dmeanpn( N, x, 2, 1 );
53+
* var v = dmeanpn( 4, x, 2, 1 );
5554
* // returns 1.25
5655
*/
5756
function dmeanpn( N, x, strideX, offset ) {

lib/node_modules/@stdlib/stats/base/dmeanpn/lib/ndarray.native.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ var addon = require( './../src/addon.node' );
3939
* var floor = require( '@stdlib/math/base/special/floor' );
4040
*
4141
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
42-
* var N = floor( x.length / 2 );
4342
*
43+
<<<<<<< HEAD
4444
* var v = dmeanpn( N, x, 2, 1 );
45+
=======
46+
* var v = dmeanpn( 4, x, 2, 1 );
47+
>>>>>>> 19798de3f (feat: add C ndarray implementation for stats/base/dmeanpn)
4548
* //returns 1.25
4649
*/
4750
function dmeanpn( N, x, strideX, offsetX ) {

lib/node_modules/@stdlib/stats/base/dmeanpn/test/test.dmeanpn.native.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
177177
t.end();
178178
});
179179

180-
tape( 'the function supports a `stride` parameter', opts, function test( t ) {
180+
tape( 'the function supports a `strideX` parameter', opts, function test( t ) {
181181
var N;
182182
var x;
183183
var v;
@@ -200,7 +200,7 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
200200
t.end();
201201
});
202202

203-
tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
203+
tape( 'the function supports a negative `strideX` parameter', opts, function test( t ) {
204204
var N;
205205
var x;
206206
var v;
@@ -223,7 +223,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
223223
t.end();
224224
});
225225

226-
tape( 'if provided a `stride` parameter equal to `0`, the function returns the first element', opts, function test( t ) {
226+
tape( 'if provided a `strideX` parameter equal to `0`, the function returns the first element', opts, function test( t ) {
227227
var x;
228228
var v;
229229

lib/node_modules/@stdlib/stats/base/dmeanpn/test/test.ndarray.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
8686
t.end();
8787
});
8888

89-
tape( 'the function supports a `stride` parameter', function test( t ) {
89+
tape( 'the function supports a `strideX` parameter', function test( t ) {
9090
var N;
9191
var x;
9292
var v;
@@ -109,7 +109,7 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
109109
t.end();
110110
});
111111

112-
tape( 'the function supports a negative `stride` parameter', function test( t ) {
112+
tape( 'the function supports a negative `strideX` parameter', function test( t ) {
113113
var N;
114114
var x;
115115
var v;
@@ -132,7 +132,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
132132
t.end();
133133
});
134134

135-
tape( 'if provided a `stride` parameter equal to `0`, the function returns the first indexed element', function test( t ) {
135+
tape( 'if provided a `strideX` parameter equal to `0`, the function returns the first indexed element', function test( t ) {
136136
var x;
137137
var v;
138138

@@ -144,7 +144,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
144144
t.end();
145145
});
146146

147-
tape( 'the function supports an `offset` parameter', function test( t ) {
147+
tape( 'the function supports an `offsetX` parameter', function test( t ) {
148148
var N;
149149
var x;
150150
var v;

lib/node_modules/@stdlib/stats/base/dmeanpn/test/test.ndarray.native.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
9595
t.end();
9696
});
9797

98-
tape( 'the function supports a `stride` parameter', opts, function test( t ) {
98+
tape( 'the function supports a `strideX` parameter', opts, function test( t ) {
9999
var N;
100100
var x;
101101
var v;
@@ -118,7 +118,7 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
118118
t.end();
119119
});
120120

121-
tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
121+
tape( 'the function supports a negative `strideX` parameter', opts, function test( t ) {
122122
var N;
123123
var x;
124124
var v;
@@ -141,7 +141,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
141141
t.end();
142142
});
143143

144-
tape( 'if provided a `stride` parameter equal to `0`, the function returns the first indexed element', opts, function test( t ) {
144+
tape( 'if provided a `strideX` parameter equal to `0`, the function returns the first indexed element', opts, function test( t ) {
145145
var x;
146146
var v;
147147

@@ -153,7 +153,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
153153
t.end();
154154
});
155155

156-
tape( 'the function supports an `offset` parameter', opts, function test( t ) {
156+
tape( 'the function supports an `offsetX` parameter', opts, function test( t ) {
157157
var N;
158158
var x;
159159
var v;

0 commit comments

Comments
 (0)