diff --git a/lib/node_modules/@stdlib/stats/base/dsem/README.md b/lib/node_modules/@stdlib/stats/base/dsem/README.md
index 129b5d6e40b7..b0db931e04fe 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/README.md
+++ b/lib/node_modules/@stdlib/stats/base/dsem/README.md
@@ -70,17 +70,16 @@ where `s` is the sample [standard deviation][standard-deviation].
var dsem = require( '@stdlib/stats/base/dsem' );
```
-#### dsem( N, correction, x, stride )
+#### dsem( N, correction, x, strideX )
-Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array `x`.
+Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array.
```javascript
var Float64Array = require( '@stdlib/array/float64' );
var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
-var N = x.length;
-var v = dsem( N, 1, x, 1 );
+var v = dsem( x.length, 1, x, 1 );
// returns ~1.20185
```
@@ -89,18 +88,16 @@ The function has the following parameters:
- **N**: number of indexed elements.
- **correction**: degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
- **x**: input [`Float64Array`][@stdlib/array/float64].
-- **stride**: index increment for `x`.
+- **strideX**: stride length for `x`.
-The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`,
+The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [standard error of the mean][standard-error] of every other element in `x`,
```javascript
var Float64Array = require( '@stdlib/array/float64' );
-var floor = require( '@stdlib/math/base/special/floor' );
var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
-var N = floor( x.length / 2 );
-var v = dsem( N, 1, x, 2 );
+var v = dsem( 4, 1, x, 2 );
// returns 1.25
```
@@ -110,18 +107,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [
```javascript
var Float64Array = require( '@stdlib/array/float64' );
-var floor = require( '@stdlib/math/base/special/floor' );
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
-var N = floor( x0.length / 2 );
-
-var v = dsem( N, 1, x1, 2 );
+var v = dsem( 4, 1, x1, 2 );
// returns 1.25
```
-#### dsem.ndarray( N, correction, x, stride, offset )
+#### dsem.ndarray( N, correction, x, strideX, offsetX )
Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using alternative indexing semantics.
@@ -129,26 +123,23 @@ Computes the [standard error of the mean][standard-error] of a double-precision
var Float64Array = require( '@stdlib/array/float64' );
var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
-var N = x.length;
-var v = dsem.ndarray( N, 1, x, 1, 0 );
+var v = dsem.ndarray( x.length, 1, x, 1, 0 );
// returns ~1.20185
```
The function has the following additional parameters:
-- **offset**: starting index for `x`.
+- **offsetX**: starting index for `x`.
-While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other value in `x` starting from the second value
+While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the [standard error of the mean][standard-error] for every other element in `x` starting from the second element
```javascript
var Float64Array = require( '@stdlib/array/float64' );
-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 = dsem.ndarray( N, 1, x, 2, 1 );
+var v = dsem.ndarray( 4, 1, x, 2, 1 );
// returns 1.25
```
@@ -174,18 +165,12 @@ var v = dsem.ndarray( N, 1, x, 2, 1 );
```javascript
-var randu = require( '@stdlib/random/base/randu' );
-var round = require( '@stdlib/math/base/special/round' );
-var Float64Array = require( '@stdlib/array/float64' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var dsem = require( '@stdlib/stats/base/dsem' );
-var x;
-var i;
-
-x = new Float64Array( 10 );
-for ( i = 0; i < x.length; i++ ) {
- x[ i ] = round( (randu()*100.0) - 50.0 );
-}
+var x = discreteUniform( 10, -50, 50, {
+ 'dtype': 'float64'
+});
console.log( x );
var v = dsem( x.length, 1, x, 1 );
@@ -196,6 +181,127 @@ console.log( v );
+
+
+* * *
+
+
+
+## C APIs
+
+
+
+
+
+
+
+
+
+
+
+### Usage
+
+```c
+#include "stdlib/stats/base/dsem.h"
+```
+
+#### stdlib_strided_dsem( N, correction, \*X, strideX )
+
+Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array.
+
+```c
+const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
+
+double v = stdlib_strided_dsem( 4, 1.0, x, 2 );
+// returns ~1.29099
+```
+
+The function accepts the following arguments:
+
+- **N**: `[in] CBLAS_INT` number of indexed elements.
+- **correction**: `[in] double` degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
+- **X**: `[in] double*` input array.
+- **strideX**: `[in] CBLAS_INT` stride length for `X`.
+
+```c
+double stdlib_strided_dsem( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX );
+```
+
+#### stdlib_strided_dsem_ndarray( N, correction, \*X, strideX, offsetX )
+
+Computes the [standard error of the mean][standard-error] of a double-precision floating-point strided array using alternative indexing semantics.
+
+```c
+const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
+
+double v = stdlib_strided_dsem_ndarray( 4, 1.0, x, 2, 0 );
+// returns ~1.29099
+```
+
+The function accepts the following arguments:
+
+- **N**: `[in] CBLAS_INT` number of indexed elements.
+- **correction**: `[in] double` degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
+- **X**: `[in] double*` input array.
+- **strideX**: `[in] CBLAS_INT` stride length for `X`.
+- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
+
+```c
+double stdlib_strided_dsem_ndarray( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### Examples
+
+```c
+#include "stdlib/stats/base/dsem.h"
+#include
+
+int main( void ) {
+ // Create a strided array:
+ const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
+
+ // Specify the number of elements:
+ const int N = 4;
+
+ // Specify the stride length:
+ const int strideX = 2;
+
+ // Compute the standard error of the mean:
+ double v = stdlib_strided_dsem( N, 1.0, x, strideX );
+
+ // Print the result:
+ printf( "dsem: %lf\n", v );
+}
+```
+
+
+
+
+
+
+
+
+
+* * *
+
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.js
index b84186241b10..439175a410e0 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.js
@@ -21,14 +21,20 @@
// MODULES //
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
-var Float64Array = require( '@stdlib/array/float64' );
+var uniform = require( '@stdlib/random/array/uniform' );
var pkg = require( './../package.json' ).name;
var dsem = require( './../lib/dsem.js' );
+// VARIABLES //
+
+var options = {
+ 'dtype': 'float64'
+};
+
+
// FUNCTIONS //
/**
@@ -39,13 +45,7 @@ var dsem = require( './../lib/dsem.js' );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var x;
- var i;
-
- x = new Float64Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.native.js
index 46ac600fd194..cf902d5f2530 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.native.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.native.js
@@ -22,10 +22,9 @@
var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
-var Float64Array = require( '@stdlib/array/float64' );
+var uniform = require( '@stdlib/random/array/uniform' );
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;
@@ -36,6 +35,9 @@ var dsem = tryRequire( resolve( __dirname, './../lib/dsem.native.js' ) );
var opts = {
'skip': ( dsem instanceof Error )
};
+var options = {
+ 'dtype': 'float64'
+};
// FUNCTIONS //
@@ -48,13 +50,7 @@ var opts = {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var x;
- var i;
-
- x = new Float64Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.js
index 449c37a40ef1..7565ccd97a82 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.js
@@ -21,14 +21,20 @@
// MODULES //
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
-var Float64Array = require( '@stdlib/array/float64' );
+var uniform = require( '@stdlib/random/array/uniform' );
var pkg = require( './../package.json' ).name;
var dsem = require( './../lib/ndarray.js' );
+// VARIABLES //
+
+var options = {
+ 'dtype': 'float64'
+};
+
+
// FUNCTIONS //
/**
@@ -39,13 +45,7 @@ var dsem = require( './../lib/ndarray.js' );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var x;
- var i;
-
- x = new Float64Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.native.js
index 611a42b7a291..bd29f6cd9e6b 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.native.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/benchmark/benchmark.ndarray.native.js
@@ -22,10 +22,9 @@
var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
-var Float64Array = require( '@stdlib/array/float64' );
+var uniform = require( '@stdlib/random/array/uniform' );
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;
@@ -36,6 +35,9 @@ var dsem = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
var opts = {
'skip': ( dsem instanceof Error )
};
+var options = {
+ 'dtype': 'float64'
+};
// FUNCTIONS //
@@ -48,13 +50,7 @@ var opts = {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var x;
- var i;
-
- x = new Float64Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dsem/docs/repl.txt
index 546435e89d49..8f87a40dd7ac 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/docs/repl.txt
+++ b/lib/node_modules/@stdlib/stats/base/dsem/docs/repl.txt
@@ -1,10 +1,10 @@
-{{alias}}( N, correction, x, stride )
+{{alias}}( N, correction, x, strideX )
Computes the standard error of the mean for a double-precision floating-
point strided array.
- The `N` and `stride` parameters determine which elements in `x` are accessed
- at runtime.
+ The `N` and stride parameters determine which elements in the strided array
+ are accessed at runtime.
Indexing is relative to the first index. To introduce an offset, use a typed
array view.
@@ -31,8 +31,8 @@
x: Float64Array
Input array.
- stride: integer
- Index increment.
+ strideX: integer
+ Stride length.
Returns
-------
@@ -46,22 +46,19 @@
> {{alias}}( x.length, 1, x, 1 )
~1.20185
- // Using `N` and `stride` parameters:
+ // Using `N` and stride parameters:
> x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] );
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
- > var stride = 2;
- > {{alias}}( N, 1, x, stride )
+ > {{alias}}( 3, 1, x, 2 )
~1.20185
// Using view offsets:
> var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
- > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
- > stride = 2;
- > {{alias}}( N, 1, x1, stride )
+ > {{alias}}( 3, 1, x1, 2 )
~1.20185
-{{alias}}.ndarray( N, correction, x, stride, offset )
+
+{{alias}}.ndarray( N, correction, x, strideX, offsetX )
Computes the standard error of the mean for a double-precision floating-
point strided array using alternative indexing semantics.
@@ -89,10 +86,10 @@
x: Float64Array
Input array.
- stride: integer
- Index increment.
+ strideX: integer
+ Stride length.
- offset: integer
+ offsetX: integer
Starting index.
Returns
@@ -109,8 +106,7 @@
// Using offset parameter:
> var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
- > {{alias}}.ndarray( N, 1, x, 2, 1 )
+ > {{alias}}.ndarray( 3, 1, x, 2, 1 )
~1.20185
See Also
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dsem/docs/types/index.d.ts
index 469c7f17f23d..cc0b08e48dd7 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/docs/types/index.d.ts
+++ b/lib/node_modules/@stdlib/stats/base/dsem/docs/types/index.d.ts
@@ -28,7 +28,7 @@ interface Routine {
* @param N - number of indexed elements
* @param correction - degrees of freedom adjustment
* @param x - input array
- * @param stride - stride length
+ * @param strideX - stride length
* @returns standard error of the mean
*
* @example
@@ -39,7 +39,7 @@ interface Routine {
* var v = dsem( x.length, 1, x, 1 );
* // returns ~1.20185
*/
- ( N: number, correction: number, x: Float64Array, stride: number ): number;
+ ( N: number, correction: number, x: Float64Array, strideX: number ): number;
/**
* Computes the standard error of the mean for a double-precision floating-point strided array using alternative indexing semantics.
@@ -47,8 +47,8 @@ interface Routine {
* @param N - number of indexed elements
* @param correction - degrees of freedom adjustment
* @param x - input array
- * @param stride - stride length
- * @param offset - starting index
+ * @param strideX - stride length
+ * @param offsetX - starting index
* @returns standard error of the mean
*
* @example
@@ -59,7 +59,7 @@ interface Routine {
* var v = dsem.ndarray( x.length, 1, x, 1, 0 );
* // returns ~1.20185
*/
- ndarray( N: number, correction: number, x: Float64Array, stride: number, offset: number ): number;
+ ndarray( N: number, correction: number, x: Float64Array, strideX: number, offsetX: number ): number;
}
/**
@@ -68,7 +68,7 @@ interface Routine {
* @param N - number of indexed elements
* @param correction - degrees of freedom adjustment
* @param x - input array
-* @param stride - stride length
+* @param strideX - stride length
* @returns standard error of the mean
*
* @example
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/dsem/examples/c/example.c
index a86c0702fb79..9ea8df0fffe6 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/examples/c/example.c
+++ b/lib/node_modules/@stdlib/stats/base/dsem/examples/c/example.c
@@ -17,22 +17,21 @@
*/
#include "stdlib/stats/base/dsem.h"
-#include
#include
int main( void ) {
// Create a strided array:
- double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
+ const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
// Specify the number of elements:
- int64_t N = 4;
+ const int N = 4;
// Specify the stride length:
- int64_t stride = 2;
+ const int strideX = 2;
// Compute the standard error of the mean:
- double v = stdlib_strided_dsem( N, 1, x, stride );
+ double v = stdlib_strided_dsem( N, 1.0, x, strideX );
// Print the result:
- printf( "standard error of the mean: %lf\n", v );
+ printf( "dsem: %lf\n", v );
}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/examples/index.js b/lib/node_modules/@stdlib/stats/base/dsem/examples/index.js
index c3a7b12b87d1..990a44e9f07d 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/examples/index.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/examples/index.js
@@ -18,18 +18,12 @@
'use strict';
-var randu = require( '@stdlib/random/base/randu' );
-var round = require( '@stdlib/math/base/special/round' );
-var Float64Array = require( '@stdlib/array/float64' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var dsem = require( './../lib' );
-var x;
-var i;
-
-x = new Float64Array( 10 );
-for ( i = 0; i < x.length; i++ ) {
- x[ i ] = round( (randu()*100.0) - 50.0 );
-}
+var x = discreteUniform( 10, -50, 50, {
+ 'dtype': 'float64'
+});
console.log( x );
var v = dsem( x.length, 1, x, 1 );
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/include/stdlib/stats/base/dsem.h b/lib/node_modules/@stdlib/stats/base/dsem/include/stdlib/stats/base/dsem.h
index a73f1085e11c..3787c47135fd 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/include/stdlib/stats/base/dsem.h
+++ b/lib/node_modules/@stdlib/stats/base/dsem/include/stdlib/stats/base/dsem.h
@@ -19,7 +19,7 @@
#ifndef STDLIB_STATS_BASE_DSEM_H
#define STDLIB_STATS_BASE_DSEM_H
-#include
+#include "stdlib/blas/base/shared.h"
/*
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
@@ -31,7 +31,12 @@ extern "C" {
/**
* Computes the standard error of the mean for a double-precision floating-point strided array.
*/
-double stdlib_strided_dsem( const int64_t N, const double correction, const double *X, const int64_t stride );
+double API_SUFFIX(stdlib_strided_dsem)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX );
+
+/**
+* Computes the standard error of the mean of a double-precision floating-point strided array using alternative indexing semantics.
+*/
+double API_SUFFIX(stdlib_strided_dsem_ndarray)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
#ifdef __cplusplus
}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.js b/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.js
index c3b76d277706..5a5b799038ee 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.js
@@ -20,7 +20,8 @@
// MODULES //
-var dsempn = require( '@stdlib/stats/base/dsempn' );
+var stride2offset = require( '@stdlib/strided/base/stride2offset' );
+var ndarray = require( './ndarray.js' );
// MAIN //
@@ -31,20 +32,19 @@ var dsempn = require( '@stdlib/stats/base/dsempn' );
* @param {PositiveInteger} N - number of indexed elements
* @param {number} correction - degrees of freedom adjustment
* @param {Float64Array} x - input array
-* @param {integer} stride - stride length
+* @param {integer} strideX - stride length
* @returns {number} standard error of the mean
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
-* var N = x.length;
*
-* var v = dsem( N, 1, x, 1 );
+* var v = dsem( x.length, 1, x, 1 );
* // returns ~1.20185
*/
-function dsem( N, correction, x, stride ) {
- return dsempn( N, correction, x, stride );
+function dsem( N, correction, x, strideX ) {
+ return ndarray( N, correction, x, strideX, stride2offset( N, strideX ) );
}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.native.js b/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.native.js
index d84283d03828..1fa27b17d530 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.native.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/lib/dsem.native.js
@@ -31,20 +31,19 @@ var addon = require( './../src/addon.node' );
* @param {PositiveInteger} N - number of indexed elements
* @param {number} correction - degrees of freedom adjustment
* @param {Float64Array} x - input array
-* @param {integer} stride - stride length
+* @param {integer} strideX - stride length
* @returns {number} standard error of the mean
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
-* var N = x.length;
*
-* var v = dsem( N, 1, x, 1 );
+* var v = dsem( x.length, 1, x, 1 );
* // returns ~1.20185
*/
-function dsem( N, correction, x, stride ) {
- return addon( N, correction, x, stride );
+function dsem( N, correction, x, strideX ) {
+ return addon( N, correction, x, strideX );
}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/lib/index.js b/lib/node_modules/@stdlib/stats/base/dsem/lib/index.js
index 516ab0d4a663..cd680e42d07a 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/lib/index.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/lib/index.js
@@ -28,20 +28,17 @@
* var dsem = require( '@stdlib/stats/base/dsem' );
*
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
-* var N = x.length;
*
-* var v = dsem( N, 1, x, 1 );
+* var v = dsem( x.length, 1, x, 1 );
* // returns ~1.20185
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
-* var floor = require( '@stdlib/math/base/special/floor' );
* var dsem = require( '@stdlib/stats/base/dsem' );
*
* 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 = dsem.ndarray( N, 1, x, 2, 1 );
+* var v = dsem.ndarray( 4, 1, x, 2, 1 );
* // returns 1.25
*/
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.js b/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.js
index a3ce023c3bc0..69b9c3920e03 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.js
@@ -31,22 +31,20 @@ var dsempn = require( '@stdlib/stats/base/dsempn' ).ndarray;
* @param {PositiveInteger} N - number of indexed elements
* @param {number} correction - degrees of freedom adjustment
* @param {Float64Array} x - input array
-* @param {integer} stride - stride length
-* @param {NonNegativeInteger} offset - starting index
+* @param {integer} strideX - stride length
+* @param {NonNegativeInteger} offsetX - starting index
* @returns {number} standard error of the mean
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
-* 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 = dsem( N, 1, x, 2, 1 );
+* var v = dsem( 4, 1, x, 2, 1 );
* // returns 1.25
*/
-function dsem( N, correction, x, stride, offset ) {
- return dsempn( N, correction, x, stride, offset );
+function dsem( N, correction, x, strideX, offsetX ) {
+ return dsempn( N, correction, x, strideX, offsetX );
}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.native.js
index 927c1c15ec61..e1d13c8ffe6b 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.native.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/lib/ndarray.native.js
@@ -20,8 +20,7 @@
// MODULES //
-var Float64Array = require( '@stdlib/array/float64' );
-var addon = require( './dsem.native.js' );
+var addon = require( './../src/addon.node' );
// MAIN //
@@ -32,27 +31,20 @@ var addon = require( './dsem.native.js' );
* @param {PositiveInteger} N - number of indexed elements
* @param {number} correction - degrees of freedom adjustment
* @param {Float64Array} x - input array
-* @param {integer} stride - stride length
-* @param {NonNegativeInteger} offset - starting index
+* @param {integer} strideX - stride length
+* @param {NonNegativeInteger} offsetX - starting index
* @returns {number} standard error of the mean
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
-* 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 = dsem( N, 1, x, 2, 1 );
+* var v = dsem( 4, 1, x, 2, 1 );
* // returns 1.25
*/
-function dsem( N, correction, x, stride, offset ) {
- var view;
- if ( stride < 0 ) {
- offset += (N-1) * stride;
- }
- view = new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len
- return addon( N, correction, view, stride );
+function dsem( N, correction, x, strideX, offsetX ) {
+ return addon.ndarray( N, correction, x, strideX, offsetX );
}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/manifest.json b/lib/node_modules/@stdlib/stats/base/dsem/manifest.json
index 187a0f677a7d..ec0dd08f6f10 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/manifest.json
+++ b/lib/node_modules/@stdlib/stats/base/dsem/manifest.json
@@ -1,6 +1,7 @@
{
"options": {
- "task": "build"
+ "task": "build",
+ "wasm": false
},
"fields": [
{
@@ -27,17 +28,18 @@
"confs": [
{
"task": "build",
+ "wasm": false,
"src": [
- "./src/dsem.c"
+ "./src/main.c"
],
"include": [
"./include"
],
- "libraries": [
- "-lm"
- ],
+ "libraries": [],
"libpath": [],
"dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/strided/base/stride2offset",
"@stdlib/stats/base/dsempn",
"@stdlib/napi/export",
"@stdlib/napi/argv",
@@ -49,33 +51,52 @@
},
{
"task": "benchmark",
+ "wasm": false,
"src": [
- "./src/dsem.c"
+ "./src/main.c"
],
"include": [
"./include"
],
- "libraries": [
- "-lm"
- ],
+ "libraries": [],
"libpath": [],
"dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/strided/base/stride2offset",
"@stdlib/stats/base/dsempn"
]
},
{
"task": "examples",
+ "wasm": false,
"src": [
- "./src/dsem.c"
+ "./src/main.c"
],
"include": [
"./include"
],
- "libraries": [
- "-lm"
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/strided/base/stride2offset",
+ "@stdlib/stats/base/dsempn"
+ ]
+ },
+ {
+ "task": "",
+ "wasm": true,
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
],
+ "libraries": [],
"libpath": [],
"dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/strided/base/stride2offset",
"@stdlib/stats/base/dsempn"
]
}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/src/addon.c b/lib/node_modules/@stdlib/stats/base/dsem/src/addon.c
index abe84aa1c901..304ee3bb1bc6 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/src/addon.c
+++ b/lib/node_modules/@stdlib/stats/base/dsem/src/addon.c
@@ -35,11 +35,29 @@
static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV( env, info, argv, argc, 4 );
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
- STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 );
+ STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
STDLIB_NAPI_ARGV_DOUBLE( env, correction, argv, 1 );
- STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, stride, argv, 2 );
- STDLIB_NAPI_CREATE_DOUBLE( env, stdlib_strided_dsem( N, correction, X, stride ), v );
+ STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 );
+ STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_dsem)( N, correction, X, strideX ), v );
return v;
}
-STDLIB_NAPI_MODULE_EXPORT_FCN( addon )
+/**
+* Receives JavaScript callback invocation data.
+*
+* @param env environment under which the function is invoked
+* @param info callback data
+* @return Node-API value
+*/
+static napi_value addon_method( napi_env env, napi_callback_info info ) {
+ STDLIB_NAPI_ARGV( env, info, argv, argc, 5 );
+ STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
+ STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
+ STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 4 );
+ STDLIB_NAPI_ARGV_DOUBLE( env, correction, argv, 1 );
+ STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 );
+ STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_dsem_ndarray)( N, correction, X, strideX, offsetX ), v );
+ return v;
+}
+
+STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method )
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/src/dsem.c b/lib/node_modules/@stdlib/stats/base/dsem/src/dsem.c
deleted file mode 100644
index 56ae3afe7b87..000000000000
--- a/lib/node_modules/@stdlib/stats/base/dsem/src/dsem.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2020 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-#include "stdlib/stats/base/dsem.h"
-#include "stdlib/stats/base/dsempn.h"
-#include
-
-/**
-* Computes the standard error of the mean for a double-precision floating-point strided array.
-*
-* @param N number of indexed elements
-* @param correction degrees of freedom adjustment
-* @param X input array
-* @param stride stride length
-* @return output value
-*/
-double stdlib_strided_dsem( const int64_t N, const double correction, const double *X, const int64_t stride ) {
- return stdlib_strided_dsempn( N, correction, X, stride );
-}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/src/main.c b/lib/node_modules/@stdlib/stats/base/dsem/src/main.c
new file mode 100644
index 000000000000..f31154ccab20
--- /dev/null
+++ b/lib/node_modules/@stdlib/stats/base/dsem/src/main.c
@@ -0,0 +1,50 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "stdlib/stats/base/dsem.h"
+#include "stdlib/stats/base/dsempn.h"
+#include "stdlib/blas/base/shared.h"
+#include "stdlib/strided/base/stride2offset.h"
+
+/**
+* Computes the standard error of the mean for a double-precision floating-point strided array.
+*
+* @param N number of indexed elements
+* @param correction degrees of freedom adjustment
+* @param X input array
+* @param strideX stride length
+* @return output value
+*/
+double API_SUFFIX(stdlib_strided_dsem)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX ) {
+ const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
+ return API_SUFFIX(stdlib_strided_dsem_ndarray)( N, correction, X, strideX, ox );
+}
+
+/**
+* Computes the standard error of the mean of a double-precision floating-point strided array using alternative indexing semantics.
+*
+* @param N number of indexed elements
+* @param correction degrees of freedom adjustment
+* @param X input array
+* @param strideX stride length
+* @param offsetX starting index for X
+* @return output value
+*/
+double API_SUFFIX(stdlib_strided_dsem_ndarray)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
+ return API_SUFFIX(stdlib_strided_dsempn_ndarray)( N, correction, X, strideX, offsetX );
+}
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.js b/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.js
index 9d85afc13614..01030547667a 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.js
@@ -21,7 +21,6 @@
// MODULES //
var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var abs = require( '@stdlib/math/base/special/abs' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
@@ -138,7 +137,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
});
tape( 'the function supports a `stride` parameter', function test( t ) {
- var N;
var x;
var v;
@@ -153,15 +151,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, 2 );
+ v = dsem( 4, 1, x, 2 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
});
tape( 'the function supports a negative `stride` parameter', function test( t ) {
- var N;
var x;
var v;
@@ -176,8 +172,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, -2 );
+ v = dsem( 4, 1, x, -2 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
@@ -198,7 +193,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
tape( 'the function supports view offsets', function test( t ) {
var x0;
var x1;
- var N;
var v;
x0 = new Float64Array([
@@ -214,9 +208,8 @@ tape( 'the function supports view offsets', function test( t ) {
]);
x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
- N = floor(x1.length / 2);
- v = dsem( N, 1, x1, 2 );
+ v = dsem( 4, 1, x1, 2 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.native.js b/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.native.js
index 176fc754ef00..6603f2b46f6a 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.native.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/test/test.dsem.native.js
@@ -22,7 +22,6 @@
var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var abs = require( '@stdlib/math/base/special/abs' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
@@ -147,7 +146,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
});
tape( 'the function supports a `stride` parameter', opts, function test( t ) {
- var N;
var x;
var v;
@@ -162,15 +160,13 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, 2 );
+ v = dsem( 4, 1, x, 2 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
});
tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
- var N;
var x;
var v;
@@ -185,8 +181,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, -2 );
+ v = dsem( 4, 1, x, -2 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
@@ -207,7 +202,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
tape( 'the function supports view offsets', opts, function test( t ) {
var x0;
var x1;
- var N;
var v;
x0 = new Float64Array([
@@ -223,9 +217,8 @@ tape( 'the function supports view offsets', opts, function test( t ) {
]);
x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
- N = floor(x1.length / 2);
- v = dsem( N, 1, x1, 2 );
+ v = dsem( 4, 1, x1, 2 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.js b/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.js
index 742195ed6786..19a1f3116c6f 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.js
@@ -21,7 +21,6 @@
// MODULES //
var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var abs = require( '@stdlib/math/base/special/abs' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
@@ -138,7 +137,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
});
tape( 'the function supports a `stride` parameter', function test( t ) {
- var N;
var x;
var v;
@@ -153,15 +151,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, 2, 0 );
+ v = dsem( 4, 1, x, 2, 0 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
});
tape( 'the function supports a negative `stride` parameter', function test( t ) {
- var N;
var x;
var v;
@@ -176,8 +172,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, -2, 6 );
+ v = dsem( 4, 1, x, -2, 6 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
@@ -196,7 +191,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
});
tape( 'the function supports an `offset` parameter', function test( t ) {
- var N;
var x;
var v;
@@ -210,9 +204,8 @@ tape( 'the function supports an `offset` parameter', function test( t ) {
3.0,
4.0 // 3
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, 2, 1 );
+ v = dsem( 4, 1, x, 2, 1 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
diff --git a/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.native.js
index 4d200590b18f..8ef80400841c 100644
--- a/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.native.js
+++ b/lib/node_modules/@stdlib/stats/base/dsem/test/test.ndarray.native.js
@@ -22,7 +22,6 @@
var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var abs = require( '@stdlib/math/base/special/abs' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
@@ -147,7 +146,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
});
tape( 'the function supports a `stride` parameter', opts, function test( t ) {
- var N;
var x;
var v;
@@ -162,15 +160,13 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, 2, 0 );
+ v = dsem( 4, 1, x, 2, 0 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
});
tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
- var N;
var x;
var v;
@@ -185,8 +181,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
2.0
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, -2, 6 );
+ v = dsem( 4, 1, x, -2, 6 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();
@@ -205,7 +200,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
});
tape( 'the function supports an `offset` parameter', opts, function test( t ) {
- var N;
var x;
var v;
@@ -219,9 +213,8 @@ tape( 'the function supports an `offset` parameter', opts, function test( t ) {
3.0,
4.0 // 3
]);
- N = floor( x.length / 2 );
- v = dsem( N, 1, x, 2, 1 );
+ v = dsem( 4, 1, x, 2, 1 );
t.strictEqual( v, 1.25, 'returns expected value' );
t.end();