diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md b/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md
index 7ade5f2c90e2..8aca28e34a93 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/README.md
@@ -54,11 +54,11 @@ The function has the following parameters:
- **N**: number of indexed elements.
- **x**: input [`Float32Array`][@stdlib/array/float32].
-- **strideX**: index increment for `x`.
+- **strideX**: stride length for `x`.
- **y**: output [`Float32Array`][@stdlib/array/float32].
-- **strideY**: index increment for `y`.
+- **strideY**: stride length for `y`.
-The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum absolute value of every other element in `x`,
+The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative maximum absolute value of every other element in `x`,
```javascript
var Float32Array = require( '@stdlib/array/float32' );
@@ -108,7 +108,7 @@ The function has the following additional parameters:
- **offsetX**: starting index for `x`.
- **offsetY**: starting index for `y`.
-While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element
+While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum absolute value of every other element in `x` starting from the second element and to store in the last `N` elements of `y` starting from the last element
```javascript
var Float32Array = require( '@stdlib/array/float32' );
@@ -141,20 +141,14 @@ scumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 );
```javascript
-var randu = require( '@stdlib/random/base/randu' );
-var round = require( '@stdlib/math/base/special/round' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var Float32Array = require( '@stdlib/array/float32' );
var scumaxabs = require( '@stdlib/stats/base/scumaxabs' );
-var y;
-var x;
-var i;
-
-x = new Float32Array( 10 );
-y = new Float32Array( x.length );
-for ( i = 0; i < x.length; i++ ) {
- x[ i ] = round( (randu()*100.0) - 50.0 );
-}
+var x = discreteUniform( 10, -50, 50, {
+ 'dtype': 'float32'
+});
+var y = new Float32Array( x.length );
console.log( x );
console.log( y );
@@ -166,6 +160,93 @@ console.log( y );
+
+
+* * *
+
+
+
+## C APIs
+
+
+
+
+
+
+
+
+
+
+
+### Usage
+
+```c
+#include "stdlib/stats/base/scumaxabs.h"
+```
+
+#### stdlib_strided_scumaxabs( N, \*X, strideX, \*Y, strideY )
+
+Computes the cumulative maximum absolute value of single-precision floating-point strided array elements.
+
+```c
+const float x[] = { 1.0f, 2.0f, -3.0f, 4.0f, -5.0f, 6.0f, 7.0f, 8.0f };
+float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
+
+stdlib_strided_scumaxabs( 4, x, 2, y, -2 );
+```
+
+The function accepts the following arguments:
+
+- **N**: `[in] CBLAS_INT` number of indexed elements.
+- **X**: `[in] float*` input array.
+- **strideX**: `[in] CBLAS_INT` stride length for `X`.
+- **Y**: `[out] float*` output array.
+- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
+
+```c
+void stdlib_strided_scumaxabs( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, float *Y, const CBLAS_INT strideY );
+```
+
+#### stdlib_strided_scumaxabs_ndarray(N, \*X, strideX, offsetX, \*Y, strideY, offsetY )
+
+Computes the cumulative maximum absolute value of single-precision floating-point strided array elements using alternative indexing semantics.
+
+```c
+#include "stdlib/stats/base/scumaxabs.h"
+#include
+
+int main( void ) {
+ // Create strided arrays:
+ const float x[] = { 1.0f, 2.0f, -3.0f, 4.0f, -5.0f, 6.0f, 7.0f, 8.0f };
+ const float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
+
+ // Specify the number of elements:
+ const int N = 4;
+
+ // Specify stride lengths:
+ const int strideX = 2;
+ const int strideY = -2;
+
+ // Compute the cumulative maximum absolute value:
+ stdlib_strided_scumaxabs( N, x, strideX, y, strideY );
+
+ // Print the result:
+ for ( int i = 0; i < 8; i++ ) {
+ printf( "y[ %d ] = %f\n", i, y[ i ] );
+ }
+}
+```
+
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.js
index 82398dc1f0e7..b6f45a54ba58 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.js
@@ -21,7 +21,7 @@
// MODULES //
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
+var uniform = require( '@stdlib/random/array/uniform' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -29,6 +29,13 @@ var pkg = require( './../package.json' ).name;
var scumaxabs = require( './../lib/scumaxabs.js' );
+// VARIABLES //
+
+var options = {
+ 'dtype': 'float32'
+};
+
+
// FUNCTIONS //
/**
@@ -39,15 +46,8 @@ var scumaxabs = require( './../lib/scumaxabs.js' );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var y;
- var x;
- var i;
-
- x = new Float32Array( len );
- y = new Float32Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
+ var y = new Float32Array( len );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.native.js
index 32e449882464..1afedec83a0b 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.native.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.native.js
@@ -22,7 +22,7 @@
var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
+var uniform = require( '@stdlib/random/array/uniform' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -36,6 +36,9 @@ var scumaxabs = tryRequire( resolve( __dirname, './../lib/scumaxabs.native.js' )
var opts = {
'skip': ( scumaxabs instanceof Error )
};
+var options = {
+ 'dtype': 'float32'
+};
// FUNCTIONS //
@@ -48,15 +51,8 @@ var opts = {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var x;
- var y;
- var i;
-
- x = new Float32Array( len );
- y = new Float32Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
+ var y = new Float32Array( len );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.js
index fb37fb74fd29..990341f028c2 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.js
@@ -21,7 +21,7 @@
// MODULES //
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
+var uniform = require( '@stdlib/random/array/uniform' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -29,6 +29,13 @@ var pkg = require( './../package.json' ).name;
var scumaxabs = require( './../lib/ndarray.js' );
+// VARIABLES //
+
+var options = {
+ 'dtype': 'float32'
+};
+
+
// FUNCTIONS //
/**
@@ -39,15 +46,8 @@ var scumaxabs = require( './../lib/ndarray.js' );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var x;
- var y;
- var i;
-
- x = new Float32Array( len );
- y = new Float32Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
+ var y = new Float32Array( len );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.native.js
index 94455ec12af2..14c4755c7f62 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.native.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/benchmark.ndarray.native.js
@@ -22,7 +22,7 @@
var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
+var uniform = require( '@stdlib/random/array/uniform' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -36,6 +36,9 @@ var scumaxabs = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) )
var opts = {
'skip': ( scumaxabs instanceof Error )
};
+var options = {
+ 'dtype': 'float32'
+};
// FUNCTIONS //
@@ -48,15 +51,8 @@ var opts = {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
- var x;
- var y;
- var i;
-
- x = new Float32Array( len );
- y = new Float32Array( len );
- for ( i = 0; i < x.length; i++ ) {
- x[ i ] = ( randu()*20.0 ) - 10.0;
- }
+ var x = uniform( len, -10.0, 10.0, options );
+ var y = new Float32Array( len );
return benchmark;
function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/c/benchmark.length.c
index ed32e9bdf31f..1d0cb614f0cf 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/c/benchmark.length.c
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/benchmark/c/benchmark.length.c
@@ -94,7 +94,7 @@ static float rand_float( void ) {
* @param len array length
* @return elapsed time in seconds
*/
-static double benchmark( int iterations, int len ) {
+static double benchmark1( int iterations, int len ) {
double elapsed;
float x[ len ];
float y[ len ];
@@ -121,6 +121,40 @@ static double benchmark( int iterations, int len ) {
return elapsed;
}
+/**
+* Runs a benchmark.
+*
+* @param iterations number of iterations
+* @param len array length
+* @return elapsed time in seconds
+*/
+static double benchmark2( int iterations, int len ) {
+ double elapsed;
+ float x[ len ];
+ float y[ len ];
+ double t;
+ int i;
+
+ for ( i = 0; i < len; i++ ) {
+ x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f;
+ y[ i ] = 0.0f;
+ }
+ t = tic();
+ for ( i = 0; i < iterations; i++ ) {
+ x[ 0 ] += 1.0f;
+ stdlib_strided_scumaxabs_ndarray( len, x, 1, 0, y, 1, 0 );
+ if ( y[ 0 ] != y[ 0 ] ) {
+ printf( "should not return NaN\n" );
+ break;
+ }
+ }
+ elapsed = tic() - t;
+ if ( y[ len-1 ] != y[ len-1 ] ) {
+ printf( "should not return NaN\n" );
+ }
+ return elapsed;
+}
+
/**
* Main execution sequence.
*/
@@ -143,7 +177,18 @@ int main( void ) {
for ( j = 0; j < REPEATS; j++ ) {
count += 1;
printf( "# c::%s:len=%d\n", NAME, len );
- elapsed = benchmark( iter, len );
+ elapsed = benchmark1( iter, len );
+ print_results( iter, elapsed );
+ printf( "ok %d benchmark finished\n", count );
+ }
+ }
+ for ( i = MIN; i <= MAX; i++ ) {
+ len = pow( 10, i );
+ iter = ITERATIONS / pow( 10, i-1 );
+ for ( j = 0; j < REPEATS; j++ ) {
+ count += 1;
+ printf( "# c::%s:ndarray:len=%d\n", NAME, len );
+ elapsed = benchmark2( iter, len );
print_results( iter, elapsed );
printf( "ok %d benchmark finished\n", count );
}
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/scumaxabs/docs/repl.txt
index 859cd438cbb3..3637670e9a63 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/docs/repl.txt
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/docs/repl.txt
@@ -3,8 +3,8 @@
Computes the cumulative maximum absolute value of single-precision floating-
point strided array elements.
- The `N` and `stride` parameters determine which elements in `x` and `y` are
- accessed at runtime.
+ The `N` and stride parameters determine which elements in the strided arrays
+ are accessed at runtime.
Indexing is relative to the first index. To introduce an offset, use a typed
array view.
@@ -20,13 +20,13 @@
Input array.
strideX: integer
- Index increment for `x`.
+ Stride Length for `x`.
y: Float32Array
Output array.
strideY: integer
- Index increment for `y`.
+ Stride Length for `y`.
Returns
-------
@@ -41,11 +41,10 @@
> {{alias}}( x.length, x, 1, y, 1 )
[ 1.0, 2.0, 2.0 ]
- // Using `N` and `stride` parameters:
+ // Using `N` and stride parameters:
> x = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] );
> y = new {{alias:@stdlib/array/float32}}( x.length );
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
- > {{alias}}( N, x, 2, y, 2 )
+ > {{alias}}( 3, x, 2, y, 2 )
[ 2.0, 0.0, 2.0, 0.0, 2.0, 0.0 ]
// Using view offsets:
@@ -53,12 +52,12 @@
> var y0 = new {{alias:@stdlib/array/float32}}( x0.length );
> var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
> var y1 = new {{alias:@stdlib/array/float32}}( y0.buffer, y0.BYTES_PER_ELEMENT*3 );
- > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
- > {{alias}}( N, x1, 2, y1, 1 )
+ > {{alias}}( 3, x1, 2, y1, 1 )
[ 2.0, 2.0, 2.0 ]
> y0
[ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ]
+
{{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
Computes the cumulative maximum absolute value of single-precision floating-
point strided array elements using alternative indexing semantics.
@@ -76,7 +75,7 @@
Input array.
strideX: integer
- Index increment for `x`.
+ Stride Length for `x`.
offsetX: integer
Starting index for `x`.
@@ -85,7 +84,7 @@
Output array.
strideY: integer
- Index increment for `y`.
+ Stride Length for `y`.
offsetY: integer
Starting index for `y`.
@@ -106,8 +105,7 @@
// Advanced indexing:
> x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
> y = new {{alias:@stdlib/array/float32}}( x.length );
- > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
- > {{alias}}.ndarray( N, x, 2, 1, y, -1, y.length-1 )
+ > {{alias}}.ndarray( 3, x, 2, 1, y, -1, y.length-1 )
[ 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ]
See Also
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/c/example.c
index b0c3db4c3732..080896b69d17 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/c/example.c
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/c/example.c
@@ -17,27 +17,25 @@
*/
#include "stdlib/stats/base/scumaxabs.h"
-#include
#include
-#include
int main( void ) {
// Create strided arrays:
- float x[] = { 1.0, 2.0, -3.0, 4.0, -5.0, 6.0, 7.0, 8.0 };
- float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+ const float x[] = { 1.0f, 2.0f, -3.0f, 4.0f, -5.0f, 6.0f, 7.0f, 8.0f };
+ const float y[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
// Specify the number of elements:
- int64_t N = 4;
+ const int N = 4;
// Specify stride lengths:
- int64_t strideX = 2;
- int64_t strideY = -2;
+ const int strideX = 2;
+ const int strideY = -2;
// Compute the cumulative maximum absolute value:
stdlib_strided_scumaxabs( N, x, strideX, y, strideY );
// Print the result:
- for ( int64_t i = 0; i < 8; i++ ) {
- printf( "y[ %"PRId64" ] = %f\n", i, y[ i ] );
+ for ( int i = 0; i < 8; i++ ) {
+ printf( "y[ %d ] = %f\n", i, y[ i ] );
}
}
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/index.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/index.js
index bbe24bdcbbd4..8744b695ba7a 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/index.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/examples/index.js
@@ -18,20 +18,14 @@
'use strict';
-var randu = require( '@stdlib/random/base/randu' );
-var round = require( '@stdlib/math/base/special/round' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var Float32Array = require( '@stdlib/array/float32' );
var scumaxabs = require( './../lib' );
-var y;
-var x;
-var i;
-
-x = new Float32Array( 10 );
-y = new Float32Array( x.length );
-for ( i = 0; i < x.length; i++ ) {
- x[ i ] = round( (randu()*100.0) - 50.0 );
-}
+var x = discreteUniform( 10, -50, 50, {
+ 'dtype': 'float32'
+});
+var y = new Float32Array( x.length );
console.log( x );
console.log( y );
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/include/stdlib/stats/base/scumaxabs.h b/lib/node_modules/@stdlib/stats/base/scumaxabs/include/stdlib/stats/base/scumaxabs.h
index e321b0e8f82b..b9702bd53f92 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/include/stdlib/stats/base/scumaxabs.h
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/include/stdlib/stats/base/scumaxabs.h
@@ -19,7 +19,7 @@
#ifndef STDLIB_STATS_BASE_SCUMAXABS_H
#define STDLIB_STATS_BASE_SCUMAXABS_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 cumulative maximum absolute value of single-precision floating-point strided array elements.
*/
-void stdlib_strided_scumaxabs( const int64_t N, const float *X, const int64_t strideX, float *Y, const int64_t strideY );
+void API_SUFFIX(stdlib_strided_scumaxabs)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, float *Y, const CBLAS_INT strideY );
+
+/**
+* Computes the cumulative maximum absolute value of single-precision floating-point strided array elements using alternative indexing semantics.
+*/
+void API_SUFFIX(stdlib_strided_scumaxabs_ndarray)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
#ifdef __cplusplus
}
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/index.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/index.js
index 1aa9570e16e8..23c87266898f 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/index.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/index.js
@@ -29,21 +29,18 @@
*
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
* var y = new Float32Array( x.length );
-* var N = x.length;
*
-* scumaxabs( N, x, 1, y, 1 );
+* scumaxabs( x.length, x, 1, y, 1 );
* // y => [ 1.0, 2.0, 2.0 ]
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
-* var floor = require( '@stdlib/math/base/special/floor' );
* var scumaxabs = require( '@stdlib/stats/base/scumaxabs' );
*
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
* var y = new Float32Array( x.length );
-* var N = floor( x.length / 2 );
*
-* scumaxabs.ndarray( N, x, 2, 1, y, 1, 0 );
+* scumaxabs.ndarray( 4, x, 2, 1, y, 1, 0 );
* // y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ]
*/
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.js
index 61cad0018816..6643194c63ba 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.js
@@ -21,7 +21,7 @@
// MODULES //
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
-var abs = require( '@stdlib/math/base/special/abs' );
+var absf = require( '@stdlib/math/base/special/absf' );
// MAIN //
@@ -40,13 +40,11 @@ var abs = require( '@stdlib/math/base/special/abs' );
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
-* var floor = require( '@stdlib/math/base/special/floor' );
*
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
* var y = new Float32Array( x.length );
-* var N = floor( x.length / 2 );
*
-* var v = scumaxabs( N, x, 2, 1, y, 1, 0 );
+* var v = scumaxabs( 4, x, 2, 1, y, 1, 0 );
* // returns [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ]
*/
function scumaxabs( N, x, strideX, offsetX, y, strideY, offsetY ) {
@@ -62,7 +60,7 @@ function scumaxabs( N, x, strideX, offsetX, y, strideY, offsetY ) {
ix = offsetX;
iy = offsetY;
- max = abs( x[ ix ] );
+ max = absf( x[ ix ] );
y[ iy ] = max;
iy += strideY;
@@ -70,7 +68,7 @@ function scumaxabs( N, x, strideX, offsetX, y, strideY, offsetY ) {
if ( isnanf( max ) === false ) {
for ( i; i < N; i++ ) {
ix += strideX;
- v = abs( x[ ix ] );
+ v = absf( x[ ix ] );
if ( isnanf( v ) ) {
max = v;
break;
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.native.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.native.js
index 14943adb206f..c3cf1859ccaf 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.native.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/ndarray.native.js
@@ -20,8 +20,7 @@
// MODULES //
-var Float32Array = require( '@stdlib/array/float32' );
-var addon = require( './scumaxabs.native.js' );
+var addon = require( './../src/addon.node' );
// MAIN //
@@ -40,27 +39,15 @@ var addon = require( './scumaxabs.native.js' );
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
-* var floor = require( '@stdlib/math/base/special/floor' );
*
* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
* var y = new Float32Array( x.length );
-* var N = floor( x.length / 2 );
*
-* var v = scumaxabs( N, x, 2, 1, y, 1, 0 );
+* var v = scumaxabs( 4, x, 2, 1, y, 1, 0 );
* // returns [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ]
*/
function scumaxabs( N, x, strideX, offsetX, y, strideY, offsetY ) {
- var viewX;
- var viewY;
- if ( strideX < 0 ) {
- offsetX += (N-1) * strideX;
- }
- if ( strideY < 0 ) {
- offsetY += (N-1) * strideY;
- }
- viewX = new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offsetX), x.length-offsetX ); // eslint-disable-line max-len
- viewY = new Float32Array( y.buffer, y.byteOffset+(y.BYTES_PER_ELEMENT*offsetY), y.length-offsetY ); // eslint-disable-line max-len
- addon( N, viewX, strideX, viewY, strideY );
+ addon.ndarray( N, x, strideX, offsetX, y, strideY, offsetY );
return y;
}
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.js
index 196f202b882a..85444f7847e3 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.js
@@ -20,8 +20,8 @@
// MODULES //
-var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
-var abs = require( '@stdlib/math/base/special/abs' );
+var stride2offset = require( '@stdlib/strided/base/stride2offset' );
+var ndarray = require( './ndarray.js' );
// MAIN //
@@ -41,58 +41,14 @@ var abs = require( '@stdlib/math/base/special/abs' );
*
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
* var y = new Float32Array( x.length );
-* var N = x.length;
*
-* var v = scumaxabs( N, x, 1, y, 1 );
+* var v = scumaxabs( x.length, x, 1, y, 1 );
* // returns [ 1.0, 2.0, 2.0 ]
*/
function scumaxabs( N, x, strideX, y, strideY ) {
- var max;
- var ix;
- var iy;
- var v;
- var i;
-
- if ( N <= 0 ) {
- return y;
- }
- if ( strideX < 0 ) {
- ix = (1-N) * strideX;
- } else {
- ix = 0;
- }
- if ( strideY < 0 ) {
- iy = (1-N) * strideY;
- } else {
- iy = 0;
- }
- max = abs( x[ ix ] );
- y[ iy ] = max;
-
- iy += strideY;
- i = 1;
- if ( isnanf( max ) === false ) {
- for ( i; i < N; i++ ) {
- ix += strideX;
- v = abs( x[ ix ] );
- if ( isnanf( v ) ) {
- max = v;
- break;
- }
- if ( v > max ) {
- max = v;
- }
- y[ iy ] = max;
- iy += strideY;
- }
- }
- if ( isnanf( max ) ) {
- for ( i; i < N; i++ ) {
- y[ iy ] = max;
- iy += strideY;
- }
- }
- return y;
+ var ox = stride2offset( N, strideX );
+ var oy = stride2offset( N, strideY );
+ return ndarray( N, x, strideX, ox, y, strideY, oy );
}
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.native.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.native.js
index 82500500ee19..388a7551e979 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.native.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/lib/scumaxabs.native.js
@@ -40,9 +40,8 @@ var addon = require( './../src/addon.node' );
*
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
* var y = new Float32Array( x.length );
-* var N = x.length;
*
-* var v = scumaxabs( N, x, 1, y, 1 );
+* var v = scumaxabs( x.length, x, 1, y, 1 );
* // returns [ 1.0, 2.0, 2.0 ]
*/
function scumaxabs( N, x, strideX, y, strideY ) {
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/manifest.json b/lib/node_modules/@stdlib/stats/base/scumaxabs/manifest.json
index e5e7c12f76fe..890d09728a73 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/manifest.json
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/manifest.json
@@ -1,6 +1,7 @@
{
"options": {
- "task": "build"
+ "task": "build",
+ "wasm": false
},
"fields": [
{
@@ -27,18 +28,20 @@
"confs": [
{
"task": "build",
+ "wasm": false,
"src": [
- "./src/scumaxabs.c"
+ "./src/main.c"
],
"include": [
"./include"
],
- "libraries": [
- "-lm"
- ],
+ "libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-nanf",
+ "@stdlib/blas/base/shared",
+ "@stdlib/math/base/special/absf",
+ "@stdlib/strided/base/stride2offset",
"@stdlib/napi/export",
"@stdlib/napi/argv",
"@stdlib/napi/argv-int64",
@@ -47,34 +50,56 @@
},
{
"task": "benchmark",
+ "wasm": false,
"src": [
- "./src/scumaxabs.c"
+ "./src/main.c"
],
"include": [
"./include"
],
- "libraries": [
- "-lm"
- ],
+ "libraries": [],
"libpath": [],
"dependencies": [
- "@stdlib/math/base/assert/is-nanf"
+ "@stdlib/blas/base/shared",
+ "@stdlib/strided/base/stride2offset",
+ "@stdlib/math/base/assert/is-nanf",
+ "@stdlib/math/base/special/absf"
]
},
{
"task": "examples",
+ "wasm": false,
"src": [
- "./src/scumaxabs.c"
+ "./src/main.c"
],
"include": [
"./include"
],
- "libraries": [
- "-lm"
+ "libraries": [],
+ "libpath": [],
+ "dependencies": [
+ "@stdlib/blas/base/shared",
+ "@stdlib/strided/base/stride2offset",
+ "@stdlib/math/base/assert/is-nanf",
+ "@stdlib/math/base/special/absf"
+ ]
+ },
+ {
+ "task": "",
+ "wasm": true,
+ "src": [
+ "./src/main.c"
+ ],
+ "include": [
+ "./include"
],
+ "libraries": [],
"libpath": [],
"dependencies": [
- "@stdlib/math/base/assert/is-nanf"
+ "@stdlib/blas/base/shared",
+ "@stdlib/strided/base/stride2offset",
+ "@stdlib/math/base/assert/is-nanf",
+ "@stdlib/math/base/special/absf"
]
}
]
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/src/addon.c b/lib/node_modules/@stdlib/stats/base/scumaxabs/src/addon.c
index b76a3a4c6380..3e55634c1dea 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/src/addon.c
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/src/addon.c
@@ -17,6 +17,7 @@
*/
#include "stdlib/stats/base/scumaxabs.h"
+#include "stdlib/blas/base/shared.h"
#include "stdlib/napi/export.h"
#include "stdlib/napi/argv.h"
#include "stdlib/napi/argv_int64.h"
@@ -37,8 +38,28 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 4 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 3 );
- stdlib_strided_scumaxabs( N, X, strideX, Y, strideY );
+ API_SUFFIX(stdlib_strided_scumaxabs)( N, X, strideX, Y, strideY );
return NULL;
}
-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, 7 );
+ STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
+ STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
+ STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 );
+ STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 );
+ STDLIB_NAPI_ARGV_INT64( env, offsetY, argv, 6 );
+ STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
+ STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 );
+ API_SUFFIX(stdlib_strided_scumaxabs_ndarray)( N, X, strideX, offsetX, Y, strideY, offsetY );
+ return NULL;
+}
+
+STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method )
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/src/scumaxabs.c b/lib/node_modules/@stdlib/stats/base/scumaxabs/src/main.c
similarity index 53%
rename from lib/node_modules/@stdlib/stats/base/scumaxabs/src/scumaxabs.c
rename to lib/node_modules/@stdlib/stats/base/scumaxabs/src/main.c
index 58c94e0a4099..f8875d80ac18 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/src/scumaxabs.c
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/src/main.c
@@ -18,8 +18,9 @@
#include "stdlib/stats/base/scumaxabs.h"
#include "stdlib/math/base/assert/is_nanf.h"
-#include
-#include
+#include "stdlib/math/base/special/absf.h"
+#include "stdlib/blas/base/shared.h"
+#include "stdlib/strided/base/stride2offset.h"
/**
* Computes the cumulative maximum absolute value of single-precision floating-point strided array elements.
@@ -30,27 +31,37 @@
* @param Y output array
* @param strideY Y stride length
*/
-void stdlib_strided_scumaxabs( const int64_t N, const float *X, const int64_t strideX, float *Y, const int64_t strideY ) {
- int64_t ix;
- int64_t iy;
- int64_t i;
+void API_SUFFIX(stdlib_strided_scumaxabs)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, float *Y, const CBLAS_INT strideY ) {
+ const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
+ const CBLAS_INT oy = stdlib_strided_stride2offset( N, strideY );
+ API_SUFFIX(stdlib_strided_scumaxabs_ndarray)( N, X, strideX, ox, Y, strideY, oy );
+ return;
+}
+
+/**
+* Computes the cumulative maximum absolute value of single-precision floating-point strided array elements using alternative indexing semantics.
+*
+* @param N number of indexed elements
+* @param X input array
+* @param strideX X stride length
+* @param offsetX starting index for X
+* @param Y output array
+* @param strideY Y stride length
+* @param offsetY starting index for Y
+*/
+void API_SUFFIX(stdlib_strided_scumaxabs_ndarray)( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {
+ CBLAS_INT ix;
+ CBLAS_INT iy;
+ CBLAS_INT i;
float max;
float v;
if ( N <= 0 ) {
return;
}
- if ( strideX < 0 ) {
- ix = (1-N) * strideX;
- } else {
- ix = 0;
- }
- if ( strideY < 0 ) {
- iy = (1-N) * strideY;
- } else {
- iy = 0;
- }
- max = fabsf( X[ ix ] );
+ ix = offsetX;
+ iy = offsetY;
+ max = stdlib_base_absf( X[ ix ] );
Y[ iy ] = max;
iy += strideY;
@@ -58,7 +69,7 @@ void stdlib_strided_scumaxabs( const int64_t N, const float *X, const int64_t st
if ( !stdlib_base_is_nanf( max ) ) {
for (; i < N; i++ ) {
ix += strideX;
- v = fabsf( X[ ix ] );
+ v = stdlib_base_absf( X[ ix ] );
if ( stdlib_base_is_nanf( v ) ) {
max = v;
break;
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.ndarray.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.ndarray.js
index f20609abed47..98e8cb46d663 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.ndarray.js
@@ -21,7 +21,6 @@
// MODULES //
var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -150,7 +149,6 @@ tape( 'the function supports an `x` stride', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -166,9 +164,8 @@ tape( 'the function supports an `x` stride', function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, 0, y, 1, 0 );
+ scumaxabs( 3, x, 2, 0, y, 1, 0 );
expected = new Float32Array( [ 1.0, 3.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -180,7 +177,6 @@ tape( 'the function supports a `y` stride', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -196,9 +192,8 @@ tape( 'the function supports a `y` stride', function test( t ) {
0.0,
0.0 // 2
]);
- N = 3;
- scumaxabs( N, x, 1, 0, y, 2, 0 );
+ scumaxabs( 3, x, 1, 0, y, 2, 0 );
expected = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 3.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -210,7 +205,6 @@ tape( 'the function supports negative strides', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 2
@@ -226,9 +220,8 @@ tape( 'the function supports negative strides', function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, -2, x.length-1, y, -1, 2 );
+ scumaxabs( 3, x, -2, x.length-1, y, -1, 2 );
expected = new Float32Array( [ 5.0, 5.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -238,7 +231,6 @@ tape( 'the function supports negative strides', function test( t ) {
tape( 'the function supports an `x` offset', function test( t ) {
var expected;
- var N;
var x;
var y;
@@ -262,9 +254,8 @@ tape( 'the function supports an `x` offset', function test( t ) {
0.0,
0.0
]);
- N = floor( x.length / 2 );
- scumaxabs( N, x, 2, 1, y, 1, 0 );
+ scumaxabs( 4, x, 2, 1, y, 1, 0 );
expected = new Float32Array( [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -274,7 +265,6 @@ tape( 'the function supports an `x` offset', function test( t ) {
tape( 'the function supports a `y` offset', function test( t ) {
var expected;
- var N;
var x;
var y;
@@ -298,9 +288,8 @@ tape( 'the function supports a `y` offset', function test( t ) {
0.0,
0.0 // 3
]);
- N = floor( x.length / 2 );
- scumaxabs( N, x, 1, 0, y, 2, 1 );
+ scumaxabs( 4, x, 1, 0, y, 2, 1 );
expected = new Float32Array( [ 0.0, 2.0, 0.0, 2.0, 0.0, 2.0, 0.0, 2.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -312,7 +301,6 @@ tape( 'the function supports complex access patterns', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -330,9 +318,8 @@ tape( 'the function supports complex access patterns', function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, 0, y, -1, 2 );
+ scumaxabs( 3, x, 2, 0, y, -1, 2 );
expected = new Float32Array( [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.ndarray.native.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.ndarray.native.js
index ab9906f3764f..1a8132d813a3 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.ndarray.native.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/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 isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -159,7 +158,6 @@ tape( 'the function supports an `x` stride', opts, function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -175,9 +173,8 @@ tape( 'the function supports an `x` stride', opts, function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, 0, y, 1, 0 );
+ scumaxabs( 3, x, 2, 0, y, 1, 0 );
expected = new Float32Array( [ 1.0, 3.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -189,7 +186,6 @@ tape( 'the function supports a `y` stride', opts, function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -205,9 +201,8 @@ tape( 'the function supports a `y` stride', opts, function test( t ) {
0.0,
0.0 // 2
]);
- N = 3;
- scumaxabs( N, x, 1, 0, y, 2, 0 );
+ scumaxabs( 3, x, 1, 0, y, 2, 0 );
expected = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 3.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -219,7 +214,6 @@ tape( 'the function supports negative strides', opts, function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 2
@@ -235,9 +229,8 @@ tape( 'the function supports negative strides', opts, function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, -2, x.length-1, y, -1, 2 );
+ scumaxabs( 3, x, -2, x.length-1, y, -1, 2 );
expected = new Float32Array( [ 5.0, 5.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -247,7 +240,6 @@ tape( 'the function supports negative strides', opts, function test( t ) {
tape( 'the function supports an `x` offset', opts, function test( t ) {
var expected;
- var N;
var x;
var y;
@@ -271,9 +263,8 @@ tape( 'the function supports an `x` offset', opts, function test( t ) {
0.0,
0.0
]);
- N = floor( x.length / 2 );
- scumaxabs( N, x, 2, 1, y, 1, 0 );
+ scumaxabs( 4, x, 2, 1, y, 1, 0 );
expected = new Float32Array( [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -283,7 +274,6 @@ tape( 'the function supports an `x` offset', opts, function test( t ) {
tape( 'the function supports a `y` offset', opts, function test( t ) {
var expected;
- var N;
var x;
var y;
@@ -307,9 +297,8 @@ tape( 'the function supports a `y` offset', opts, function test( t ) {
0.0,
0.0 // 3
]);
- N = floor( x.length / 2 );
- scumaxabs( N, x, 1, 0, y, 2, 1 );
+ scumaxabs( 4, x, 1, 0, y, 2, 1 );
expected = new Float32Array( [ 0.0, 2.0, 0.0, 2.0, 0.0, 2.0, 0.0, 2.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -321,7 +310,6 @@ tape( 'the function supports complex access patterns', opts, function test( t )
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -339,9 +327,8 @@ tape( 'the function supports complex access patterns', opts, function test( t )
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, 0, y, -1, 2 );
+ scumaxabs( 3, x, 2, 0, y, -1, 2 );
expected = new Float32Array( [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.js
index 81b849b45b5f..5981bd871fc3 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.js
@@ -21,7 +21,6 @@
// MODULES //
var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -150,7 +149,6 @@ tape( 'the function supports an `x` stride', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -166,9 +164,8 @@ tape( 'the function supports an `x` stride', function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, y, 1 );
+ scumaxabs( 3, x, 2, y, 1 );
expected = new Float32Array( [ 1.0, 3.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -180,7 +177,6 @@ tape( 'the function supports a `y` stride', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -196,9 +192,8 @@ tape( 'the function supports a `y` stride', function test( t ) {
0.0,
0.0 // 2
]);
- N = 3;
- scumaxabs( N, x, 1, y, 2 );
+ scumaxabs( 3, x, 1, y, 2 );
expected = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 3.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -210,7 +205,6 @@ tape( 'the function supports negative strides', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 2
@@ -226,9 +220,8 @@ tape( 'the function supports negative strides', function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, -2, y, -1 );
+ scumaxabs( 3, x, -2, y, -1 );
expected = new Float32Array( [ 5.0, 5.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -240,7 +233,6 @@ tape( 'the function supports complex access patterns', function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -258,9 +250,8 @@ tape( 'the function supports complex access patterns', function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, y, -1 );
+ scumaxabs( 3, x, 2, y, -1 );
expected = new Float32Array( [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -274,7 +265,6 @@ tape( 'the function supports view offsets', function test( t ) {
var y0;
var x1;
var y1;
- var N;
// Initial arrays...
x0 = new Float32Array([
@@ -298,9 +288,7 @@ tape( 'the function supports view offsets', function test( t ) {
x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // begin at 2nd element
y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // begin at the 4th element
- N = floor( x0.length / 2 );
-
- scumaxabs( N, x1, -2, y1, 1 );
+ scumaxabs( 3, x1, -2, y1, 1 );
expected = new Float32Array( [ 0.0, 0.0, 0.0, 6.0, 6.0, 6.0 ] );
t.deepEqual( y0, expected, 'returns expected value' );
diff --git a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.native.js b/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.native.js
index 44af1d08f49c..5ed692dba4d8 100644
--- a/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.native.js
+++ b/lib/node_modules/@stdlib/stats/base/scumaxabs/test/test.scumaxabs.native.js
@@ -22,7 +22,6 @@
var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
var Float32Array = require( '@stdlib/array/float32' );
@@ -159,7 +158,6 @@ tape( 'the function supports an `x` stride', opts, function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -175,9 +173,8 @@ tape( 'the function supports an `x` stride', opts, function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, y, 1 );
+ scumaxabs( 3, x, 2, y, 1 );
expected = new Float32Array( [ 1.0, 3.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -189,7 +186,6 @@ tape( 'the function supports a `y` stride', opts, function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -205,9 +201,8 @@ tape( 'the function supports a `y` stride', opts, function test( t ) {
0.0,
0.0 // 2
]);
- N = 3;
- scumaxabs( N, x, 1, y, 2 );
+ scumaxabs( 3, x, 1, y, 2 );
expected = new Float32Array( [ 1.0, 0.0, 2.0, 0.0, 3.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -219,7 +214,6 @@ tape( 'the function supports negative strides', opts, function test( t ) {
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 2
@@ -235,9 +229,8 @@ tape( 'the function supports negative strides', opts, function test( t ) {
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, -2, y, -1 );
+ scumaxabs( 3, x, -2, y, -1 );
expected = new Float32Array( [ 5.0, 5.0, 5.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -249,7 +242,6 @@ tape( 'the function supports complex access patterns', opts, function test( t )
var expected;
var x;
var y;
- var N;
x = new Float32Array([
1.0, // 0
@@ -267,9 +259,8 @@ tape( 'the function supports complex access patterns', opts, function test( t )
0.0,
0.0
]);
- N = 3;
- scumaxabs( N, x, 2, y, -1 );
+ scumaxabs( 3, x, 2, y, -1 );
expected = new Float32Array( [ 5.0, 3.0, 1.0, 0.0, 0.0, 0.0 ] );
t.deepEqual( y, expected, 'returns expected value' );
@@ -283,7 +274,6 @@ tape( 'the function supports view offsets', opts, function test( t ) {
var y0;
var x1;
var y1;
- var N;
// Initial arrays...
x0 = new Float32Array([
@@ -307,9 +297,7 @@ tape( 'the function supports view offsets', opts, function test( t ) {
x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // begin at 2nd element
y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // begin at the 4th element
- N = floor( x0.length / 2 );
-
- scumaxabs( N, x1, -2, y1, 1 );
+ scumaxabs( 3, x1, -2, y1, 1 );
expected = new Float32Array( [ 0.0, 0.0, 0.0, 6.0, 6.0, 6.0 ] );
t.deepEqual( y0, expected, 'returns expected value' );