Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ int main( void ) {
int64_t N = 4;

// Specify the stride length:
int64_t stride = 2;
int64_t strideX = 2;

// Compute the arithmetic mean:
double v = stdlib_strided_dmeanpn( N, x, stride );
double v = stdlib_strided_dmeanpn( N, x, strideX );

// Print the result:
printf( "mean: %lf\n", v );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ extern "C" {
double API_SUFFIX( stdlib_strided_dmeanpn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX );

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

Expand Down
3 changes: 1 addition & 2 deletions lib/node_modules/@stdlib/stats/base/dmeanpn/lib/dmeanpn.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ var ndarray = require( './ndarray.js' );
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
* var N = x.length;
*
* var v = dmeanpn( N, x, 1 );
* var v = dmeanpn( 3, x, 1 );
* // returns ~0.3333
*/
function dmeanpn( N, x, strideX ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ var addon = require( './../src/addon.node' );
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
* var N = x.length;
*
<<<<<<< HEAD
* var v = dmeanpn( N, x, 1 );
=======
* var v = dmeanpn( 3, x, 1 );
>>>>>>> 19798de3f (feat: add C ndarray implementation for stats/base/dmeanpn)
* //returns ~0.3333
*/
function dmeanpn( N, x, strideX ) {
Expand Down
6 changes: 2 additions & 4 deletions lib/node_modules/@stdlib/stats/base/dmeanpn/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
* var dmeanpn = require( '@stdlib/stats/base/dmeanpn' );
*
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
* var N = x.length;
*
* var v = dmeanpn( N, x, 1 );
* var v = dmeanpn( 3, x, 1 );
* // returns ~0.3333
*
* @example
Expand All @@ -39,9 +38,8 @@
* var dmeanpn = require( '@stdlib/stats/base/dmeanpn' );
*
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
* var N = floor( x.length / 2 );
*
* var v = dmeanpn.ndarray( N, x, 2, 1 );
* var v = dmeanpn.ndarray( 4, x, 2, 1 );
* // returns 1.25
*/

Expand Down
3 changes: 1 addition & 2 deletions lib/node_modules/@stdlib/stats/base/dmeanpn/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' ).ndarray;
* var floor = require( '@stdlib/math/base/special/floor' );
*
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
* var N = floor( x.length / 2 );
*
* var v = dmeanpn( N, x, 2, 1 );
* var v = dmeanpn( 4, x, 2, 1 );
* // returns 1.25
*/
function dmeanpn( N, x, strideX, offset ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ var addon = require( './../src/addon.node' );
* var floor = require( '@stdlib/math/base/special/floor' );
*
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
* var N = floor( x.length / 2 );
*
<<<<<<< HEAD
* var v = dmeanpn( N, x, 2, 1 );
=======
* var v = dmeanpn( 4, x, 2, 1 );
>>>>>>> 19798de3f (feat: add C ndarray implementation for stats/base/dmeanpn)
* //returns 1.25
*/
function dmeanpn( N, x, strideX, offsetX ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
t.end();
});

tape( 'the function supports a `stride` parameter', opts, function test( t ) {
tape( 'the function supports a `strideX` parameter', opts, function test( t ) {
var N;
var x;
var v;
Expand All @@ -200,7 +200,7 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
t.end();
});

tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
tape( 'the function supports a negative `strideX` parameter', opts, function test( t ) {
var N;
var x;
var v;
Expand All @@ -223,7 +223,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
t.end();
});

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
t.end();
});

tape( 'the function supports a `stride` parameter', function test( t ) {
tape( 'the function supports a `strideX` parameter', function test( t ) {
var N;
var x;
var v;
Expand All @@ -109,7 +109,7 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
t.end();
});

tape( 'the function supports a negative `stride` parameter', function test( t ) {
tape( 'the function supports a negative `strideX` parameter', function test( t ) {
var N;
var x;
var v;
Expand All @@ -132,7 +132,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
t.end();
});

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

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

tape( 'the function supports an `offset` parameter', function test( t ) {
tape( 'the function supports an `offsetX` parameter', function test( t ) {
var N;
var x;
var v;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
t.end();
});

tape( 'the function supports a `stride` parameter', opts, function test( t ) {
tape( 'the function supports a `strideX` parameter', opts, function test( t ) {
var N;
var x;
var v;
Expand All @@ -118,7 +118,7 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
t.end();
});

tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
tape( 'the function supports a negative `strideX` parameter', opts, function test( t ) {
var N;
var x;
var v;
Expand All @@ -141,7 +141,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
t.end();
});

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

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

tape( 'the function supports an `offset` parameter', opts, function test( t ) {
tape( 'the function supports an `offsetX` parameter', opts, function test( t ) {
var N;
var x;
var v;
Expand Down