From f301a55b2214d4632b768bdc6641809f52433ef3 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 2 Dec 2023 13:01:41 +0000 Subject: [PATCH] Auto-generated commit --- base/dasum/src/addon.c | 2 +- base/dcopy/src/addon.c | 2 +- base/ddot/src/addon.c | 2 +- base/dnrm2/manifest.json | 7 +- base/dnrm2/src/addon.c | 2 +- base/dscal/README.md | 31 +- base/dscal/benchmark/benchmark.js | 17 +- base/dscal/benchmark/benchmark.native.js | 13 +- base/dscal/benchmark/benchmark.ndarray.js | 17 +- .../benchmark/benchmark.ndarray.native.js | 13 +- base/dscal/docs/repl.txt | 22 +- base/dscal/docs/types/index.d.ts | 6 +- base/dscal/examples/c/example.c | 4 +- base/dscal/examples/index.js | 22 +- base/dscal/include.gypi | 2 +- base/dscal/lib/ndarray.js | 3 +- base/dscal/lib/ndarray.native.js | 10 +- base/dscal/manifest.json | 282 +++++++++++------- base/dscal/package.json | 4 +- base/dscal/src/addon.c | 45 +++ base/dscal/src/addon.cpp | 128 -------- base/dscal/test/test.dscal.js | 4 +- base/dscal/test/test.dscal.native.js | 4 +- base/dscal/test/test.js | 4 +- base/dscal/test/test.ndarray.js | 4 +- base/dscal/test/test.ndarray.native.js | 4 +- dist/index.js.map | 4 +- 27 files changed, 281 insertions(+), 377 deletions(-) create mode 100644 base/dscal/src/addon.c delete mode 100644 base/dscal/src/addon.cpp diff --git a/base/dasum/src/addon.c b/base/dasum/src/addon.c index 6e545a9c2..33233e099 100644 --- a/base/dasum/src/addon.c +++ b/base/dasum/src/addon.c @@ -39,7 +39,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); napi_value v; - napi_status status = napi_create_double( env, c_dasum( N, (double *)X, strideX ), &v ); + napi_status status = napi_create_double( env, c_dasum( N, X, strideX ), &v ); assert( status == napi_ok ); return v; diff --git a/base/dcopy/src/addon.c b/base/dcopy/src/addon.c index e612705ae..7d94f82f1 100644 --- a/base/dcopy/src/addon.c +++ b/base/dcopy/src/addon.c @@ -38,7 +38,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 4 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 3 ); - c_dcopy( N, (double *)X, strideX, (double *)Y, strideY ); + c_dcopy( N, X, strideX, Y, strideY ); return NULL; } diff --git a/base/ddot/src/addon.c b/base/ddot/src/addon.c index c50c400c0..bc89133ae 100644 --- a/base/ddot/src/addon.c +++ b/base/ddot/src/addon.c @@ -41,7 +41,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 3 ); napi_value v; - napi_status status = napi_create_double( env, c_ddot( N, (double *)X, strideX, (double *)Y, strideY ), &v ); + napi_status status = napi_create_double( env, c_ddot( N, X, strideX, Y, strideY ), &v ); assert( status == napi_ok ); return v; diff --git a/base/dnrm2/manifest.json b/base/dnrm2/manifest.json index 42ab17e7d..d99921767 100644 --- a/base/dnrm2/manifest.json +++ b/base/dnrm2/manifest.json @@ -162,12 +162,7 @@ "-m" ], "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" - ] + "dependencies": [] } ] } diff --git a/base/dnrm2/src/addon.c b/base/dnrm2/src/addon.c index 028075e34..e9412a94c 100644 --- a/base/dnrm2/src/addon.c +++ b/base/dnrm2/src/addon.c @@ -39,7 +39,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); napi_value v; - napi_status status = napi_create_double( env, c_dnrm2( N, (double *)X, strideX ), &v ); + napi_status status = napi_create_double( env, c_dnrm2( N, X, strideX ), &v ); assert( status == napi_ok ); return v; diff --git a/base/dscal/README.md b/base/dscal/README.md index 60b62085c..a9b1f962e 100644 --- a/base/dscal/README.md +++ b/base/dscal/README.md @@ -54,13 +54,10 @@ The `N` and `stride` parameters determine which elements in `x` are accessed at ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var N = floor( x.length / 2 ); - -dscal( N, 5.0, x, 2 ); +dscal( 4, 5.0, x, 2 ); // x => [ -10.0, 1.0, 15.0, -5.0, 20.0, 0.0, -5.0, -3.0 ] ``` @@ -68,17 +65,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' ); // Initial array... var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view... var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = 3; // Scale every other value... -dscal( N, 5.0, x1, 2 ); +dscal( 3, 5.0, x1, 2 ); // x0 => [ 1.0, -10.0, 3.0, -20.0, 5.0, -30.0 ] ``` @@ -134,27 +129,11 @@ dscal.ndarray( 3, 5.0, x, 1, x.length-3 ); ```javascript -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var dscal = require( '@stdlib/blas/base/dscal' ); -var rand; -var sign; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); - if ( sign < 0.5 ) { - sign = -1.0; - } else { - sign = 1.0; - } - x[ i ] = sign * rand; -} +var x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); console.log( x ); dscal( x.length, 5.0, x, 1 ); diff --git a/base/dscal/benchmark/benchmark.js b/base/dscal/benchmark/benchmark.js index db27c5e4b..0938ee00d 100644 --- a/base/dscal/benchmark/benchmark.js +++ b/base/dscal/benchmark/benchmark.js @@ -21,14 +21,19 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var pkg = require( './../package.json' ).name; var dscal = require( './../lib/dscal.js' ); +// VARIABLES // + +var rand = uniform( -100.0, 100.0 ); + + // FUNCTIONS // /** @@ -39,13 +44,7 @@ var dscal = require( './../lib/dscal.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/base/dscal/benchmark/benchmark.native.js b/base/dscal/benchmark/benchmark.native.js index db0d4da7e..6d118ff4f 100644 --- a/base/dscal/benchmark/benchmark.native.js +++ b/base/dscal/benchmark/benchmark.native.js @@ -22,10 +22,10 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -36,6 +36,7 @@ var dscal = tryRequire( resolve( __dirname, './../lib/dscal.native.js' ) ); var opts = { 'skip': ( dscal instanceof Error ) }; +var rand = uniform( -100.0, 100.0 ); // FUNCTIONS // @@ -48,13 +49,7 @@ var opts = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*10.0 ) - 20.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/base/dscal/benchmark/benchmark.ndarray.js b/base/dscal/benchmark/benchmark.ndarray.js index ab79908ac..85d8a40b8 100644 --- a/base/dscal/benchmark/benchmark.ndarray.js +++ b/base/dscal/benchmark/benchmark.ndarray.js @@ -21,14 +21,19 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var pkg = require( './../package.json' ).name; var dscal = require( './../lib/ndarray.js' ); +// VARIABLES // + +var rand = uniform( -100.0, 100.0 ); + + // FUNCTIONS // /** @@ -39,13 +44,7 @@ var dscal = require( './../lib/ndarray.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/base/dscal/benchmark/benchmark.ndarray.native.js b/base/dscal/benchmark/benchmark.ndarray.native.js index d15d7ad4a..49ea54a82 100644 --- a/base/dscal/benchmark/benchmark.ndarray.native.js +++ b/base/dscal/benchmark/benchmark.ndarray.native.js @@ -22,10 +22,10 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -36,6 +36,7 @@ var dscal = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); var opts = { 'skip': ( dscal instanceof Error ) }; +var rand = uniform( -100.0, 100.0 ); // FUNCTIONS // @@ -48,13 +49,7 @@ var opts = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/base/dscal/docs/repl.txt b/base/dscal/docs/repl.txt index 526246a66..b2ff25d60 100644 --- a/base/dscal/docs/repl.txt +++ b/base/dscal/docs/repl.txt @@ -34,29 +34,23 @@ -------- // Standard Usage: > var x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ] ); - > var alpha = 5.0; - > {{alias}}( x.length, alpha, x, 1 ) + > {{alias}}( x.length, 5.0, x, 1 ) [ -10.0, 5.0, 15.0, -25.0, 20.0, -5.0, -15.0 ] // Using `N` and `stride` parameters: > x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ] ); - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > alpha = 5.0; - > var stride = 2; - > {{alias}}( N, alpha, x, stride ) + > {{alias}}( 3, 5.0, x, 2 ) [ -10.0, 1.0, 15.0, -5.0, 20.0, -1.0, -3.0 ] // Using view offsets: > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.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 ); - > alpha = 5.0; - > stride = 2; - > {{alias}}( N, alpha, x1, stride ) + > {{alias}}( 3, 5.0, x1, 2 ) [ -10.0, 3.0, -20.0, 5.0, -30.0 ] > x0 [ 1.0, -10.0, 3.0, -20.0, 5.0, -30.0 ] + {{alias}}.ndarray( N, alpha, x, stride, offset ) Multiplies a double-precision floating-point vector `x` by a constant `alpha` using alternative indexing semantics. @@ -91,16 +85,12 @@ -------- // Standard Usage: > var x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ] ); - > var alpha = 5.0; - > {{alias}}.ndarray( x.length, alpha, x, 1, 0 ) + > {{alias}}.ndarray( x.length, 5.0, x, 1, 0 ) [ -10.0, 5.0, 15.0, -25.0, 20.0, -5.0, -15.0 ] // Using an index offset: > x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > alpha = 5.0; - > var stride = 2; - > {{alias}}.ndarray( N, alpha, x, stride, 1 ) + > {{alias}}.ndarray( 3, 5.0, x, 2, 1 ) [ 1.0, -10.0, 3.0, -20.0, 5.0, -30.0 ] See Also diff --git a/base/dscal/docs/types/index.d.ts b/base/dscal/docs/types/index.d.ts index 749607c0c..d062f2fb4 100644 --- a/base/dscal/docs/types/index.d.ts +++ b/base/dscal/docs/types/index.d.ts @@ -29,7 +29,7 @@ interface Routine { * @param alpha - constant * @param x - input array * @param stride - stride length - * @returns `y` + * @returns input array * * @example * var Float64Array = require( `@stdlib/array/float64` ); @@ -49,7 +49,7 @@ interface Routine { * @param x - input array * @param stride - stride length * @param offset - starting index - * @returns `x` + * @returns input array * * @example * var Float64Array = require( `@stdlib/array/float64` ); @@ -69,7 +69,7 @@ interface Routine { * @param alpha - constant * @param x - input array * @param stride - stride length -* @returns `x` +* @returns input array * * @example * var Float64Array = require( `@stdlib/array/float64` ); diff --git a/base/dscal/examples/c/example.c b/base/dscal/examples/c/example.c index 2664b3fc4..432487bbf 100644 --- a/base/dscal/examples/c/example.c +++ b/base/dscal/examples/c/example.c @@ -24,10 +24,10 @@ int main( void ) { double x[] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 }; // Specify the number of elements: - int N = 8; + const int N = 8; // Specify a stride: - int strideX = 1; + const int strideX = 1; // Scale the vector: c_dscal( N, 5.0, x, strideX ); diff --git a/base/dscal/examples/index.js b/base/dscal/examples/index.js index b2d91309b..7f472cf5d 100644 --- a/base/dscal/examples/index.js +++ b/base/dscal/examples/index.js @@ -18,27 +18,11 @@ 'use strict'; -var round = require( '@stdlib/math/base/special/round' ); -var randu = require( '@stdlib/random/base/randu' ); -var Float64Array = require( '@stdlib/array/float64' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var dscal = require( './../lib' ); -var rand; -var sign; -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - rand = round( randu()*100.0 ); - sign = randu(); - if ( sign < 0.5 ) { - sign = -1.0; - } else { - sign = 1.0; - } - x[ i ] = sign * rand; -} +var x = filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) ); console.log( x ); dscal( x.length, 5.0, x, 1 ); diff --git a/base/dscal/include.gypi b/base/dscal/include.gypi index 9a3ec86b9..be025fb6b 100644 --- a/base/dscal/include.gypi +++ b/base/dscal/include.gypi @@ -52,7 +52,7 @@ # Source files: 'src_files': [ - '<(src_dir)/addon.cpp', + '<(src_dir)/addon.c', ' [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ] */ function dscal( N, alpha, x, stride, offset ) { diff --git a/base/dscal/lib/ndarray.native.js b/base/dscal/lib/ndarray.native.js index e43ef550e..149e4c971 100644 --- a/base/dscal/lib/ndarray.native.js +++ b/base/dscal/lib/ndarray.native.js @@ -20,7 +20,8 @@ // MODULES // -var Float64Array = require( '@stdlib/array/float64' ); +var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); +var offsetView = require( '@stdlib/strided/base/offset-view' ); var addon = require( './dscal.native.js' ); @@ -40,18 +41,17 @@ var addon = require( './dscal.native.js' ); * var Float64Array = require( '@stdlib/array/float64' ); * * var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); -* var alpha = 5.0; * -* dscal( 3, alpha, x, 1, x.length-3 ); +* dscal( 3, 5.0, x, 1, x.length-3 ); * // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ] */ function dscal( N, alpha, x, stride, offset ) { var view; + offset = minViewBufferIndex( N, stride, offset ); if ( stride < 0 ) { stride *= -1; - offset -= (N-1) * stride; } - view = new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len + view = offsetView( x, offset ); addon( N, alpha, view, stride ); return x; } diff --git a/base/dscal/manifest.json b/base/dscal/manifest.json index c66b7a5f2..48801cfaa 100644 --- a/base/dscal/manifest.json +++ b/base/dscal/manifest.json @@ -1,118 +1,168 @@ { - "options": { - "os": "linux", - "blas": "" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "os": "linux", - "blas": "", - "src": [ - "./src/dscal.f", - "./src/dscal_f.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [] - }, - { - "os": "linux", - "blas": "openblas", - "src": [ - "./src/dscal_cblas.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lopenblas", - "-lpthread" - ], - "libpath": [], - "dependencies": [] - }, - { - "os": "mac", - "blas": "", - "src": [ - "./src/dscal.f", - "./src/dscal_f.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [] - }, - { - "os": "mac", - "blas": "apple_accelerate_framework", - "src": [ - "./src/dscal_cblas.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lblas" - ], - "libpath": [], - "dependencies": [] - }, - { - "os": "mac", - "blas": "openblas", - "src": [ - "./src/dscal_cblas.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lopenblas", - "-lpthread" - ], - "libpath": [], - "dependencies": [] - }, - { - "os": "win", - "blas": "", - "src": [ - "./src/dscal.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [] - } - ] + "options": { + "os": "linux", + "blas": "" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "os": "linux", + "blas": "", + "src": [ + "./src/dscal.f", + "./src/dscal_f.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "os": "linux", + "blas": "openblas", + "src": [ + "./src/dscal_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "os": "mac", + "blas": "", + "src": [ + "./src/dscal.f", + "./src/dscal_f.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "os": "mac", + "blas": "apple_accelerate_framework", + "src": [ + "./src/dscal_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "os": "mac", + "blas": "openblas", + "src": [ + "./src/dscal_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "os": "win", + "blas": "", + "src": [ + "./src/dscal.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + }, + { + "os": "", + "blas": "", + "wasm": true, + "src": [ + "./src/dscal.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [] + } + ] } diff --git a/base/dscal/package.json b/base/dscal/package.json index 13f1d195e..f41574e44 100644 --- a/base/dscal/package.json +++ b/base/dscal/package.json @@ -74,5 +74,7 @@ "double", "float64array" ], - "__stdlib__": {} + "__stdlib__": { + "wasm": false + } } diff --git a/base/dscal/src/addon.c b/base/dscal/src/addon.c new file mode 100644 index 000000000..c0ab86eeb --- /dev/null +++ b/base/dscal/src/addon.c @@ -0,0 +1,45 @@ +/** +* @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/blas/base/dscal.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_double.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_float64array.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @private +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +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_DOUBLE( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 ); + c_dscal( N, alpha, X, strideX ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) diff --git a/base/dscal/src/addon.cpp b/base/dscal/src/addon.cpp deleted file mode 100644 index 037f52b03..000000000 --- a/base/dscal/src/addon.cpp +++ /dev/null @@ -1,128 +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/blas/base/dscal.h" -#include -#include -#include -#include -#include - -/** -* Add-on namespace. -*/ -namespace stdlib_blas_base_dscal { - - /** - * Multiplies a double-precision floating-point vector by a constant. - * - * ## Notes - * - * - When called from JavaScript, the function expects four arguments: - * - * - `N`: number of indexed elements - * - `alpha`: scalar - * - `X`: input array - * - `strideX`: `X` stride length - */ - napi_value node_dscal( napi_env env, napi_callback_info info ) { - napi_status status; - - size_t argc = 4; - napi_value argv[ 4 ]; - status = napi_get_cb_info( env, info, &argc, argv, nullptr, nullptr ); - assert( status == napi_ok ); - - if ( argc < 4 ) { - napi_throw_error( env, nullptr, "invalid invocation. Must provide 4 arguments." ); - return nullptr; - } - - napi_valuetype vtype0; - status = napi_typeof( env, argv[ 0 ], &vtype0 ); - assert( status == napi_ok ); - if ( vtype0 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. First argument must be a number." ); - return nullptr; - } - - napi_valuetype vtype1; - status = napi_typeof( env, argv[ 1 ], &vtype1 ); - assert( status == napi_ok ); - if ( vtype1 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a number." ); - return nullptr; - } - - bool res2; - status = napi_is_typedarray( env, argv[ 2 ], &res2 ); - assert( status == napi_ok ); - if ( res2 == false ) { - napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a Float64Array." ); - return nullptr; - } - - napi_valuetype vtype3; - status = napi_typeof( env, argv[ 3 ], &vtype3 ); - assert( status == napi_ok ); - if ( vtype3 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. Fourth argument must be a number." ); - return nullptr; - } - - int64_t N; - status = napi_get_value_int64( env, argv[ 0 ], &N ); - assert( status == napi_ok ); - - double alpha; - status = napi_get_value_double( env, argv[ 1 ], &alpha ); - assert( status == napi_ok ); - - int64_t strideX; - status = napi_get_value_int64( env, argv[ 3 ], &strideX ); - assert( status == napi_ok ); - - napi_typedarray_type vtype2; - size_t xlen; - void *X; - status = napi_get_typedarray_info( env, argv[ 2 ], &vtype2, &xlen, &X, nullptr, nullptr ); - assert( status == napi_ok ); - if ( vtype2 != napi_float64_array ) { - napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a Float64Array." ); - return nullptr; - } - if ( (N-1)*llabs(strideX) >= (int64_t)xlen ) { - napi_throw_range_error( env, nullptr, "invalid argument. Third argument has insufficient elements based on the associated stride and the number of indexed elements." ); - return nullptr; - } - - c_dscal( N, alpha, (double *)X, strideX ); - - return nullptr; - } - - napi_value Init( napi_env env, napi_value exports ) { - napi_status status; - napi_value fcn; - status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, node_dscal, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; - } - - NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) -} // end namespace stdlib_blas_base_dscal diff --git a/base/dscal/test/test.dscal.js b/base/dscal/test/test.dscal.js index 6eaf671b1..e4c327a0c 100644 --- a/base/dscal/test/test.dscal.js +++ b/base/dscal/test/test.dscal.js @@ -34,7 +34,7 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function has an arity of 4', function test( t ) { - t.strictEqual( dscal.length, 4, 'has expected arity' ); + t.strictEqual( dscal.length, 4, 'returns expected value' ); t.end(); }); @@ -82,7 +82,7 @@ tape( 'the function returns a reference to the input array', function test( t ) x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); out = dscal( x.length, 3.0, x, 1 ); - t.strictEqual( out, x, 'same reference' ); + t.strictEqual( out, x, 'returns expected value' ); t.end(); }); diff --git a/base/dscal/test/test.dscal.native.js b/base/dscal/test/test.dscal.native.js index c500c0128..f72631941 100644 --- a/base/dscal/test/test.dscal.native.js +++ b/base/dscal/test/test.dscal.native.js @@ -43,7 +43,7 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function has an arity of 4', opts, function test( t ) { - t.strictEqual( dscal.length, 4, 'has expected arity' ); + t.strictEqual( dscal.length, 4, 'returns expected value' ); t.end(); }); @@ -91,7 +91,7 @@ tape( 'the function returns a reference to the input array', opts, function test x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); out = dscal( x.length, 3.0, x, 1 ); - t.strictEqual( out, x, 'same reference' ); + t.strictEqual( out, x, 'returns expected value' ); t.end(); }); diff --git a/base/dscal/test/test.js b/base/dscal/test/test.js index 4263a2b4f..512b7443a 100644 --- a/base/dscal/test/test.js +++ b/base/dscal/test/test.js @@ -51,7 +51,7 @@ tape( 'if a native implementation is available, the main export is the native im '@stdlib/utils/try-require': tryRequire }); - t.strictEqual( dscal, mock, 'returns native implementation' ); + t.strictEqual( dscal, mock, 'returns expected value' ); t.end(); function tryRequire() { @@ -73,7 +73,7 @@ tape( 'if a native implementation is not available, the main export is a JavaScr '@stdlib/utils/try-require': tryRequire }); - t.strictEqual( dscal, main, 'returns JavaScript implementation' ); + t.strictEqual( dscal, main, 'returns expected value' ); t.end(); function tryRequire() { diff --git a/base/dscal/test/test.ndarray.js b/base/dscal/test/test.ndarray.js index f45ed3a72..ac4ed28bc 100644 --- a/base/dscal/test/test.ndarray.js +++ b/base/dscal/test/test.ndarray.js @@ -34,7 +34,7 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function has an arity of 5', function test( t ) { - t.strictEqual( dscal.length, 5, 'has expected arity' ); + t.strictEqual( dscal.length, 5, 'returns expected value' ); t.end(); }); @@ -82,7 +82,7 @@ tape( 'the function returns a reference to the input array', function test( t ) x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); out = dscal( x.length, 3.0, x, 1, 0 ); - t.strictEqual( out, x, 'same reference' ); + t.strictEqual( out, x, 'returns expected value' ); t.end(); }); diff --git a/base/dscal/test/test.ndarray.native.js b/base/dscal/test/test.ndarray.native.js index 33929ff0a..e6fadd05a 100644 --- a/base/dscal/test/test.ndarray.native.js +++ b/base/dscal/test/test.ndarray.native.js @@ -43,7 +43,7 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function has an arity of 5', opts, function test( t ) { - t.strictEqual( dscal.length, 5, 'has expected arity' ); + t.strictEqual( dscal.length, 5, 'returns expected value' ); t.end(); }); @@ -91,7 +91,7 @@ tape( 'the function returns a reference to the input array', opts, function test x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); out = dscal( x.length, 3.0, x, 1, 0 ); - t.strictEqual( out, x, 'same reference' ); + t.strictEqual( out, x, 'returns expected value' ); t.end(); }); diff --git a/dist/index.js.map b/dist/index.js.map index 9be52a177..2f98ac492 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../base/ccopy/lib/ccopy.js", "../base/ccopy/lib/ndarray.js", "../base/ccopy/lib/main.js", "../base/ccopy/lib/index.js", "../base/cswap/lib/cswap.js", "../base/cswap/lib/ndarray.js", "../base/cswap/lib/main.js", "../base/cswap/lib/index.js", "../base/dasum/lib/dasum.js", "../base/dasum/lib/ndarray.js", "../base/dasum/lib/main.js", "../base/dasum/lib/index.js", "../base/daxpy/lib/daxpy.js", "../base/daxpy/lib/ndarray.js", "../base/daxpy/lib/main.js", "../base/daxpy/lib/index.js", "../base/dcopy/lib/dcopy.js", "../base/dcopy/lib/ndarray.js", "../base/dcopy/lib/main.js", "../base/dcopy/lib/index.js", "../base/ddot/lib/ddot.js", "../base/ddot/lib/ndarray.js", "../base/ddot/lib/main.js", "../base/ddot/lib/index.js", "../base/dnrm2/lib/dnrm2.js", "../base/dnrm2/lib/ndarray.js", "../base/dnrm2/lib/main.js", "../base/dnrm2/lib/index.js", "../base/dscal/lib/dscal.js", "../base/dscal/lib/ndarray.js", "../base/dscal/lib/main.js", "../base/dscal/lib/index.js", "../base/dsdot/lib/dsdot.js", "../base/dsdot/lib/ndarray.js", "../base/dsdot/lib/main.js", "../base/dsdot/lib/index.js", "../base/dswap/lib/dswap.js", "../base/dswap/lib/ndarray.js", "../base/dswap/lib/main.js", "../base/dswap/lib/index.js", "../base/gasum/lib/main.js", "../base/gasum/lib/ndarray.js", "../base/gasum/lib/index.js", "../base/gaxpy/lib/main.js", "../base/gaxpy/lib/ndarray.js", "../base/gaxpy/lib/index.js", "../base/gcopy/lib/accessors.js", "../base/gcopy/lib/main.js", "../base/gcopy/lib/ndarray.js", "../base/gcopy/lib/index.js", "../base/gdot/lib/main.js", "../base/gdot/lib/ndarray.js", "../base/gdot/lib/index.js", "../base/gnrm2/lib/gnrm2.js", "../base/gnrm2/lib/ndarray.js", "../base/gnrm2/lib/main.js", "../base/gnrm2/lib/index.js", "../base/gscal/lib/main.js", "../base/gscal/lib/ndarray.js", "../base/gscal/lib/index.js", "../base/gswap/lib/accessors.js", "../base/gswap/lib/main.js", "../base/gswap/lib/ndarray.js", "../base/gswap/lib/index.js", "../base/sasum/lib/sasum.js", "../base/sasum/lib/ndarray.js", "../base/sasum/lib/main.js", "../base/sasum/lib/index.js", "../base/saxpy/lib/saxpy.js", "../base/saxpy/lib/ndarray.js", "../base/saxpy/lib/main.js", "../base/saxpy/lib/index.js", "../base/scopy/lib/scopy.js", "../base/scopy/lib/ndarray.js", "../base/scopy/lib/main.js", "../base/scopy/lib/index.js", "../base/sdot/lib/sdot.js", "../base/sdot/lib/ndarray.js", "../base/sdot/lib/main.js", "../base/sdot/lib/index.js", "../base/sdsdot/lib/sdsdot.js", "../base/sdsdot/lib/ndarray.js", "../base/sdsdot/lib/main.js", "../base/sdsdot/lib/index.js", "../base/snrm2/lib/snrm2.js", "../base/snrm2/lib/ndarray.js", "../base/snrm2/lib/main.js", "../base/snrm2/lib/index.js", "../base/srotg/lib/assign.js", "../base/srotg/lib/main.js", "../base/srotg/lib/index.js", "../base/sscal/lib/sscal.js", "../base/sscal/lib/ndarray.js", "../base/sscal/lib/main.js", "../base/sscal/lib/index.js", "../base/sswap/lib/sswap.js", "../base/sswap/lib/ndarray.js", "../base/sswap/lib/main.js", "../base/sswap/lib/index.js", "../base/lib/index.js", "../ddot/lib/main.js", "../ddot/lib/index.js", "../dswap/lib/main.js", "../dswap/lib/index.js", "../ext/base/dapx/lib/dapx.js", "../ext/base/dapx/lib/ndarray.js", "../ext/base/dapx/lib/main.js", "../ext/base/dapx/lib/index.js", "../ext/base/dapxsumkbn/lib/dapxsumkbn.js", "../ext/base/dapxsumkbn/lib/ndarray.js", "../ext/base/dapxsumkbn/lib/main.js", "../ext/base/dapxsumkbn/lib/index.js", "../ext/base/dapxsum/lib/dapxsum.js", "../ext/base/dapxsum/lib/ndarray.js", "../ext/base/dapxsum/lib/main.js", "../ext/base/dapxsum/lib/index.js", "../ext/base/dapxsumkbn2/lib/dapxsumkbn2.js", "../ext/base/dapxsumkbn2/lib/ndarray.js", "../ext/base/dapxsumkbn2/lib/main.js", "../ext/base/dapxsumkbn2/lib/index.js", "../ext/base/dapxsumors/lib/dapxsumors.js", "../ext/base/dapxsumors/lib/ndarray.js", "../ext/base/dapxsumors/lib/main.js", "../ext/base/dapxsumors/lib/index.js", "../ext/base/dapxsumpw/lib/ndarray.js", "../ext/base/dapxsumpw/lib/dapxsumpw.js", "../ext/base/dapxsumpw/lib/main.js", "../ext/base/dapxsumpw/lib/index.js", "../ext/base/dasumpw/lib/ndarray.js", "../ext/base/dasumpw/lib/dasumpw.js", "../ext/base/dasumpw/lib/main.js", "../ext/base/dasumpw/lib/index.js", "../ext/base/dcusumkbn/lib/dcusumkbn.js", "../ext/base/dcusumkbn/lib/ndarray.js", "../ext/base/dcusumkbn/lib/main.js", "../ext/base/dcusumkbn/lib/index.js", "../ext/base/dcusum/lib/dcusum.js", "../ext/base/dcusum/lib/ndarray.js", "../ext/base/dcusum/lib/main.js", "../ext/base/dcusum/lib/index.js", "../ext/base/dcusumkbn2/lib/dcusumkbn2.js", "../ext/base/dcusumkbn2/lib/ndarray.js", "../ext/base/dcusumkbn2/lib/main.js", "../ext/base/dcusumkbn2/lib/index.js", "../ext/base/dcusumors/lib/dcusumors.js", "../ext/base/dcusumors/lib/ndarray.js", "../ext/base/dcusumors/lib/main.js", "../ext/base/dcusumors/lib/index.js", "../ext/base/dcusumpw/lib/ndarray.js", "../ext/base/dcusumpw/lib/dcusumpw.js", "../ext/base/dcusumpw/lib/main.js", "../ext/base/dcusumpw/lib/index.js", "../ext/base/dfill/lib/dfill.js", "../ext/base/dfill/lib/ndarray.js", "../ext/base/dfill/lib/main.js", "../ext/base/dfill/lib/index.js", "../ext/base/dnanasumors/lib/dnanasumors.js", "../ext/base/dnanasumors/lib/ndarray.js", "../ext/base/dnanasumors/lib/main.js", "../ext/base/dnanasumors/lib/index.js", "../ext/base/dnanasum/lib/dnanasum.js", "../ext/base/dnanasum/lib/ndarray.js", "../ext/base/dnanasum/lib/main.js", "../ext/base/dnanasum/lib/index.js", "../ext/base/dnannsumkbn/lib/dnannsumkbn.js", "../ext/base/dnannsumkbn/lib/ndarray.js", "../ext/base/dnannsumkbn/lib/main.js", "../ext/base/dnannsumkbn/lib/index.js", "../ext/base/dnannsum/lib/dnannsum.js", "../ext/base/dnannsum/lib/ndarray.js", "../ext/base/dnannsum/lib/main.js", "../ext/base/dnannsum/lib/index.js", "../ext/base/dnannsumkbn2/lib/dnannsumkbn2.js", "../ext/base/dnannsumkbn2/lib/ndarray.js", "../ext/base/dnannsumkbn2/lib/main.js", "../ext/base/dnannsumkbn2/lib/index.js", "../ext/base/dnannsumors/lib/dnannsumors.js", "../ext/base/dnannsumors/lib/ndarray.js", "../ext/base/dnannsumors/lib/main.js", "../ext/base/dnannsumors/lib/index.js", "../ext/base/dnannsumpw/lib/sumpw.js", "../ext/base/dnannsumpw/lib/dnannsumpw.js", "../ext/base/dnannsumpw/lib/ndarray.js", "../ext/base/dnannsumpw/lib/main.js", "../ext/base/dnannsumpw/lib/index.js", "../ext/base/dnansumkbn/lib/dnansumkbn.js", "../ext/base/dnansumkbn/lib/ndarray.js", "../ext/base/dnansumkbn/lib/main.js", "../ext/base/dnansumkbn/lib/index.js", "../ext/base/dnansum/lib/dnansum.js", "../ext/base/dnansum/lib/ndarray.js", "../ext/base/dnansum/lib/main.js", "../ext/base/dnansum/lib/index.js", "../ext/base/dnansumkbn2/lib/dnansumkbn2.js", "../ext/base/dnansumkbn2/lib/ndarray.js", "../ext/base/dnansumkbn2/lib/main.js", "../ext/base/dnansumkbn2/lib/index.js", "../ext/base/dnansumors/lib/dnansumors.js", "../ext/base/dnansumors/lib/ndarray.js", "../ext/base/dnansumors/lib/main.js", "../ext/base/dnansumors/lib/index.js", "../ext/base/dnansumpw/lib/ndarray.js", "../ext/base/dnansumpw/lib/dnansumpw.js", "../ext/base/dnansumpw/lib/main.js", "../ext/base/dnansumpw/lib/index.js", "../ext/base/drev/lib/drev.js", "../ext/base/drev/lib/ndarray.js", "../ext/base/drev/lib/main.js", "../ext/base/drev/lib/index.js", "../ext/base/dsapxsumpw/lib/ndarray.js", "../ext/base/dsapxsumpw/lib/dsapxsumpw.js", "../ext/base/dsapxsumpw/lib/main.js", "../ext/base/dsapxsumpw/lib/index.js", "../ext/base/dsapxsum/lib/dsapxsum.js", "../ext/base/dsapxsum/lib/ndarray.js", "../ext/base/dsapxsum/lib/main.js", "../ext/base/dsapxsum/lib/index.js", "../ext/base/dsnannsumors/lib/dsnannsumors.js", "../ext/base/dsnannsumors/lib/ndarray.js", "../ext/base/dsnannsumors/lib/main.js", "../ext/base/dsnannsumors/lib/index.js", "../ext/base/dsnansumpw/lib/ndarray.js", "../ext/base/dsnansumpw/lib/dsnansumpw.js", "../ext/base/dsnansumpw/lib/main.js", "../ext/base/dsnansumpw/lib/index.js", "../ext/base/dsnansum/lib/dsnansum.js", "../ext/base/dsnansum/lib/ndarray.js", "../ext/base/dsnansum/lib/main.js", "../ext/base/dsnansum/lib/index.js", "../ext/base/dsnansumors/lib/dsnansumors.js", "../ext/base/dsnansumors/lib/ndarray.js", "../ext/base/dsnansumors/lib/main.js", "../ext/base/dsnansumors/lib/index.js", "../ext/base/dsort2hp/lib/dsort2hp.js", "../ext/base/dsort2hp/lib/ndarray.js", "../ext/base/dsort2hp/lib/main.js", "../ext/base/dsort2hp/lib/index.js", "../ext/base/dsort2ins/lib/dsort2ins.js", "../ext/base/dsort2ins/lib/ndarray.js", "../ext/base/dsort2ins/lib/main.js", "../ext/base/dsort2ins/lib/index.js", "../ext/base/dsort2sh/lib/gaps.json", "../ext/base/dsort2sh/lib/dsort2sh.js", "../ext/base/dsort2sh/lib/ndarray.js", "../ext/base/dsort2sh/lib/main.js", "../ext/base/dsort2sh/lib/index.js", "../ext/base/dsorthp/lib/dsorthp.js", "../ext/base/dsorthp/lib/ndarray.js", "../ext/base/dsorthp/lib/main.js", "../ext/base/dsorthp/lib/index.js", "../ext/base/dsortins/lib/dsortins.js", "../ext/base/dsortins/lib/ndarray.js", "../ext/base/dsortins/lib/main.js", "../ext/base/dsortins/lib/index.js", "../ext/base/dsortsh/lib/gaps.json", "../ext/base/dsortsh/lib/dsortsh.js", "../ext/base/dsortsh/lib/ndarray.js", "../ext/base/dsortsh/lib/main.js", "../ext/base/dsortsh/lib/index.js", "../ext/base/dssumpw/lib/ndarray.js", "../ext/base/dssumpw/lib/dssumpw.js", "../ext/base/dssumpw/lib/main.js", "../ext/base/dssumpw/lib/index.js", "../ext/base/dssum/lib/dssum.js", "../ext/base/dssum/lib/ndarray.js", "../ext/base/dssum/lib/main.js", "../ext/base/dssum/lib/index.js", "../ext/base/dssumors/lib/dssumors.js", "../ext/base/dssumors/lib/ndarray.js", "../ext/base/dssumors/lib/main.js", "../ext/base/dssumors/lib/index.js", "../ext/base/dsumkbn/lib/dsumkbn.js", "../ext/base/dsumkbn/lib/ndarray.js", "../ext/base/dsumkbn/lib/main.js", "../ext/base/dsumkbn/lib/index.js", "../ext/base/dsum/lib/dsum.js", "../ext/base/dsum/lib/ndarray.js", "../ext/base/dsum/lib/main.js", "../ext/base/dsum/lib/index.js", "../ext/base/dsumkbn2/lib/dsumkbn2.js", "../ext/base/dsumkbn2/lib/ndarray.js", "../ext/base/dsumkbn2/lib/main.js", "../ext/base/dsumkbn2/lib/index.js", "../ext/base/dsumors/lib/dsumors.js", "../ext/base/dsumors/lib/ndarray.js", "../ext/base/dsumors/lib/main.js", "../ext/base/dsumors/lib/index.js", "../ext/base/dsumpw/lib/ndarray.js", "../ext/base/dsumpw/lib/dsumpw.js", "../ext/base/dsumpw/lib/main.js", "../ext/base/dsumpw/lib/index.js", "../ext/base/gapx/lib/main.js", "../ext/base/gapx/lib/ndarray.js", "../ext/base/gapx/lib/index.js", "../ext/base/gapxsumkbn/lib/main.js", "../ext/base/gapxsumkbn/lib/ndarray.js", "../ext/base/gapxsumkbn/lib/index.js", "../ext/base/gapxsum/lib/main.js", "../ext/base/gapxsum/lib/ndarray.js", "../ext/base/gapxsum/lib/index.js", "../ext/base/gapxsumkbn2/lib/main.js", "../ext/base/gapxsumkbn2/lib/ndarray.js", "../ext/base/gapxsumkbn2/lib/index.js", "../ext/base/gapxsumors/lib/main.js", "../ext/base/gapxsumors/lib/ndarray.js", "../ext/base/gapxsumors/lib/index.js", "../ext/base/gapxsumpw/lib/ndarray.js", "../ext/base/gapxsumpw/lib/main.js", "../ext/base/gapxsumpw/lib/index.js", "../ext/base/gasumpw/lib/ndarray.js", "../ext/base/gasumpw/lib/main.js", "../ext/base/gasumpw/lib/index.js", "../ext/base/gcusumkbn/lib/main.js", "../ext/base/gcusumkbn/lib/ndarray.js", "../ext/base/gcusumkbn/lib/index.js", "../ext/base/gcusum/lib/main.js", "../ext/base/gcusum/lib/ndarray.js", "../ext/base/gcusum/lib/index.js", "../ext/base/gcusumkbn2/lib/main.js", "../ext/base/gcusumkbn2/lib/ndarray.js", "../ext/base/gcusumkbn2/lib/index.js", "../ext/base/gcusumors/lib/main.js", "../ext/base/gcusumors/lib/ndarray.js", "../ext/base/gcusumors/lib/index.js", "../ext/base/gcusumpw/lib/ndarray.js", "../ext/base/gcusumpw/lib/main.js", "../ext/base/gcusumpw/lib/index.js", "../ext/base/gfill/lib/accessors.js", "../ext/base/gfill/lib/main.js", "../ext/base/gfill/lib/ndarray.js", "../ext/base/gfill/lib/index.js", "../ext/base/gfill-by/lib/accessors.js", "../ext/base/gfill-by/lib/main.js", "../ext/base/gfill-by/lib/ndarray.js", "../ext/base/gfill-by/lib/index.js", "../ext/base/gnannsumkbn/lib/main.js", "../ext/base/gnannsumkbn/lib/ndarray.js", "../ext/base/gnannsumkbn/lib/index.js", "../ext/base/gnansumkbn/lib/main.js", "../ext/base/gnansumkbn/lib/ndarray.js", "../ext/base/gnansumkbn/lib/index.js", "../ext/base/gnansum/lib/main.js", "../ext/base/gnansum/lib/ndarray.js", "../ext/base/gnansum/lib/index.js", "../ext/base/gnansumkbn2/lib/main.js", "../ext/base/gnansumkbn2/lib/ndarray.js", "../ext/base/gnansumkbn2/lib/index.js", "../ext/base/gnansumors/lib/main.js", "../ext/base/gnansumors/lib/ndarray.js", "../ext/base/gnansumors/lib/index.js", "../ext/base/gnansumpw/lib/ndarray.js", "../ext/base/gnansumpw/lib/main.js", "../ext/base/gnansumpw/lib/index.js", "../ext/base/grev/lib/accessors.js", "../ext/base/grev/lib/main.js", "../ext/base/grev/lib/ndarray.js", "../ext/base/grev/lib/index.js", "../ext/base/gsort2hp/lib/main.js", "../ext/base/gsort2hp/lib/ndarray.js", "../ext/base/gsort2hp/lib/index.js", "../ext/base/gsort2ins/lib/main.js", "../ext/base/gsort2ins/lib/ndarray.js", "../ext/base/gsort2ins/lib/index.js", "../ext/base/gsort2sh/lib/gaps.json", "../ext/base/gsort2sh/lib/main.js", "../ext/base/gsort2sh/lib/ndarray.js", "../ext/base/gsort2sh/lib/index.js", "../ext/base/gsorthp/lib/main.js", "../ext/base/gsorthp/lib/ndarray.js", "../ext/base/gsorthp/lib/index.js", "../ext/base/gsortins/lib/main.js", "../ext/base/gsortins/lib/ndarray.js", "../ext/base/gsortins/lib/index.js", "../ext/base/gsortsh/lib/gaps.json", "../ext/base/gsortsh/lib/main.js", "../ext/base/gsortsh/lib/ndarray.js", "../ext/base/gsortsh/lib/index.js", "../ext/base/gsumkbn/lib/main.js", "../ext/base/gsumkbn/lib/ndarray.js", "../ext/base/gsumkbn/lib/index.js", "../ext/base/gsum/lib/main.js", "../ext/base/gsum/lib/ndarray.js", "../ext/base/gsum/lib/index.js", "../ext/base/gsumkbn2/lib/main.js", "../ext/base/gsumkbn2/lib/ndarray.js", "../ext/base/gsumkbn2/lib/index.js", "../ext/base/gsumors/lib/main.js", "../ext/base/gsumors/lib/ndarray.js", "../ext/base/gsumors/lib/index.js", "../ext/base/gsumpw/lib/ndarray.js", "../ext/base/gsumpw/lib/main.js", "../ext/base/gsumpw/lib/index.js", "../ext/base/sapx/lib/sapx.js", "../ext/base/sapx/lib/ndarray.js", "../ext/base/sapx/lib/main.js", "../ext/base/sapx/lib/index.js", "../ext/base/sapxsumkbn/lib/sapxsumkbn.js", "../ext/base/sapxsumkbn/lib/ndarray.js", "../ext/base/sapxsumkbn/lib/main.js", "../ext/base/sapxsumkbn/lib/index.js", "../ext/base/sapxsum/lib/sapxsum.js", "../ext/base/sapxsum/lib/ndarray.js", "../ext/base/sapxsum/lib/main.js", "../ext/base/sapxsum/lib/index.js", "../ext/base/sapxsumkbn2/lib/sapxsumkbn2.js", "../ext/base/sapxsumkbn2/lib/ndarray.js", "../ext/base/sapxsumkbn2/lib/main.js", "../ext/base/sapxsumkbn2/lib/index.js", "../ext/base/sapxsumors/lib/sapxsumors.js", "../ext/base/sapxsumors/lib/ndarray.js", "../ext/base/sapxsumors/lib/main.js", "../ext/base/sapxsumors/lib/index.js", "../ext/base/sapxsumpw/lib/ndarray.js", "../ext/base/sapxsumpw/lib/sapxsumpw.js", "../ext/base/sapxsumpw/lib/main.js", "../ext/base/sapxsumpw/lib/index.js", "../ext/base/sasumpw/lib/ndarray.js", "../ext/base/sasumpw/lib/sasumpw.js", "../ext/base/sasumpw/lib/main.js", "../ext/base/sasumpw/lib/index.js", "../ext/base/scusumkbn/lib/scusumkbn.js", "../ext/base/scusumkbn/lib/ndarray.js", "../ext/base/scusumkbn/lib/main.js", "../ext/base/scusumkbn/lib/index.js", "../ext/base/scusum/lib/scusum.js", "../ext/base/scusum/lib/ndarray.js", "../ext/base/scusum/lib/main.js", "../ext/base/scusum/lib/index.js", "../ext/base/scusumkbn2/lib/scusumkbn2.js", "../ext/base/scusumkbn2/lib/ndarray.js", "../ext/base/scusumkbn2/lib/main.js", "../ext/base/scusumkbn2/lib/index.js", "../ext/base/scusumors/lib/scusumors.js", "../ext/base/scusumors/lib/ndarray.js", "../ext/base/scusumors/lib/main.js", "../ext/base/scusumors/lib/index.js", "../ext/base/scusumpw/lib/ndarray.js", "../ext/base/scusumpw/lib/scusumpw.js", "../ext/base/scusumpw/lib/main.js", "../ext/base/scusumpw/lib/index.js", "../ext/base/sdsapxsumpw/lib/ndarray.js", "../ext/base/sdsapxsumpw/lib/sdsapxsumpw.js", "../ext/base/sdsapxsumpw/lib/main.js", "../ext/base/sdsapxsumpw/lib/index.js", "../ext/base/sdsapxsum/lib/sdsapxsum.js", "../ext/base/sdsapxsum/lib/ndarray.js", "../ext/base/sdsapxsum/lib/main.js", "../ext/base/sdsapxsum/lib/index.js", "../ext/base/sdsnansumpw/lib/ndarray.js", "../ext/base/sdsnansumpw/lib/sdsnansumpw.js", "../ext/base/sdsnansumpw/lib/main.js", "../ext/base/sdsnansumpw/lib/index.js", "../ext/base/sdsnansum/lib/sdsnansum.js", "../ext/base/sdsnansum/lib/ndarray.js", "../ext/base/sdsnansum/lib/main.js", "../ext/base/sdsnansum/lib/index.js", "../ext/base/sdssumpw/lib/ndarray.js", "../ext/base/sdssumpw/lib/sdssumpw.js", "../ext/base/sdssumpw/lib/main.js", "../ext/base/sdssumpw/lib/index.js", "../ext/base/sdssum/lib/sdssum.js", "../ext/base/sdssum/lib/ndarray.js", "../ext/base/sdssum/lib/main.js", "../ext/base/sdssum/lib/index.js", "../ext/base/sfill/lib/sfill.js", "../ext/base/sfill/lib/ndarray.js", "../ext/base/sfill/lib/main.js", "../ext/base/sfill/lib/index.js", "../ext/base/snansumkbn/lib/snansumkbn.js", "../ext/base/snansumkbn/lib/ndarray.js", "../ext/base/snansumkbn/lib/main.js", "../ext/base/snansumkbn/lib/index.js", "../ext/base/snansum/lib/snansum.js", "../ext/base/snansum/lib/ndarray.js", "../ext/base/snansum/lib/main.js", "../ext/base/snansum/lib/index.js", "../ext/base/snansumkbn2/lib/snansumkbn2.js", "../ext/base/snansumkbn2/lib/ndarray.js", "../ext/base/snansumkbn2/lib/main.js", "../ext/base/snansumkbn2/lib/index.js", "../ext/base/snansumors/lib/snansumors.js", "../ext/base/snansumors/lib/ndarray.js", "../ext/base/snansumors/lib/main.js", "../ext/base/snansumors/lib/index.js", "../ext/base/snansumpw/lib/ndarray.js", "../ext/base/snansumpw/lib/snansumpw.js", "../ext/base/snansumpw/lib/main.js", "../ext/base/snansumpw/lib/index.js", "../ext/base/srev/lib/srev.js", "../ext/base/srev/lib/ndarray.js", "../ext/base/srev/lib/main.js", "../ext/base/srev/lib/index.js", "../ext/base/ssort2hp/lib/ssort2hp.js", "../ext/base/ssort2hp/lib/ndarray.js", "../ext/base/ssort2hp/lib/main.js", "../ext/base/ssort2hp/lib/index.js", "../ext/base/ssort2ins/lib/ssort2ins.js", "../ext/base/ssort2ins/lib/ndarray.js", "../ext/base/ssort2ins/lib/main.js", "../ext/base/ssort2ins/lib/index.js", "../ext/base/ssort2sh/lib/gaps.json", "../ext/base/ssort2sh/lib/ssort2sh.js", "../ext/base/ssort2sh/lib/ndarray.js", "../ext/base/ssort2sh/lib/main.js", "../ext/base/ssort2sh/lib/index.js", "../ext/base/ssorthp/lib/ssorthp.js", "../ext/base/ssorthp/lib/ndarray.js", "../ext/base/ssorthp/lib/main.js", "../ext/base/ssorthp/lib/index.js", "../ext/base/ssortins/lib/ssortins.js", "../ext/base/ssortins/lib/ndarray.js", "../ext/base/ssortins/lib/main.js", "../ext/base/ssortins/lib/index.js", "../ext/base/ssortsh/lib/gaps.json", "../ext/base/ssortsh/lib/ssortsh.js", "../ext/base/ssortsh/lib/ndarray.js", "../ext/base/ssortsh/lib/main.js", "../ext/base/ssortsh/lib/index.js", "../ext/base/ssumkbn/lib/ssumkbn.js", "../ext/base/ssumkbn/lib/ndarray.js", "../ext/base/ssumkbn/lib/main.js", "../ext/base/ssumkbn/lib/index.js", "../ext/base/ssum/lib/ssum.js", "../ext/base/ssum/lib/ndarray.js", "../ext/base/ssum/lib/main.js", "../ext/base/ssum/lib/index.js", "../ext/base/ssumkbn2/lib/ssumkbn2.js", "../ext/base/ssumkbn2/lib/ndarray.js", "../ext/base/ssumkbn2/lib/main.js", "../ext/base/ssumkbn2/lib/index.js", "../ext/base/ssumors/lib/ssumors.js", "../ext/base/ssumors/lib/ndarray.js", "../ext/base/ssumors/lib/main.js", "../ext/base/ssumors/lib/index.js", "../ext/base/ssumpw/lib/ndarray.js", "../ext/base/ssumpw/lib/ssumpw.js", "../ext/base/ssumpw/lib/main.js", "../ext/base/ssumpw/lib/index.js", "../ext/base/lib/index.js", "../ext/lib/index.js", "../gdot/lib/main.js", "../gdot/lib/index.js", "../gswap/lib/main.js", "../gswap/lib/index.js", "../sdot/lib/main.js", "../sdot/lib/index.js", "../sswap/lib/main.js", "../sswap/lib/index.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} output array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nfunction ccopy( N, x, strideX, y, strideY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tfor ( i = 0; i < N*2; i += 2 ) {\n\t\t\tviewY[ i ] = viewX[ i ];\n\t\t\tviewY[ i+1 ] = viewX[ i+1 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = 2 * (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = 2 * (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tviewY[ iy ] = viewX[ ix ];\n\t\tviewY[ iy+1 ] = viewX[ ix+1 ];\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Complex64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Complex64Array} output array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nfunction ccopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tix = offsetX * 2;\n\tiy = offsetY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tviewY[ iy ] = viewX[ ix ];\n\t\tviewY[ iy+1 ] = viewX[ ix+1 ];\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ccopy = require( './ccopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ccopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @module @stdlib/blas/base/ccopy\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var ccopy = require( '@stdlib/blas/base/ccopy' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var ccopy = require( '@stdlib/blas/base/ccopy' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ccopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tccopy = main;\n} else {\n\tccopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n\n// exports: { \"ndarray\": \"ccopy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\nfunction cswap( N, x, strideX, y, strideY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar tmp;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\tvar j;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tfor ( i = 0; i < N*2; i += 2 ) {\n\t\t\ttmp = viewX[ i ];\n\t\t\tviewX[ i ] = viewY[ i ];\n\t\t\tviewY[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = viewX[ j ];\n\t\t\tviewX[ j ] = viewY[ j ];\n\t\t\tviewY[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = 2 * (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = 2 * (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = viewX[ ix ];\n\t\tviewX[ ix ] = viewY[ iy ];\n\t\tviewY[ iy ] = tmp;\n\n\t\ttmp = viewX[ ix+1 ];\n\t\tviewX[ ix+1 ] = viewY[ iy+1 ];\n\t\tviewY[ iy+1 ] = tmp;\n\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Complex64Array} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\nfunction cswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar tmp;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tix = offsetX * 2;\n\tiy = offsetY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = viewX[ ix ];\n\t\tviewX[ ix ] = viewY[ iy ];\n\t\tviewY[ iy ] = tmp;\n\n\t\ttmp = viewX[ ix+1 ];\n\t\tviewX[ ix+1 ] = viewY[ iy+1 ];\n\t\tviewY[ iy+1 ] = tmp;\n\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar cswap = require( './cswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( cswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two complex single-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/cswap\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cswap = require( '@stdlib/blas/base/cswap' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cswap = require( '@stdlib/blas/base/cswap' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar cswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tcswap = main;\n} else {\n\tcswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n\n// exports: { \"ndarray\": \"cswap.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {PositiveInteger} stride - `x` stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum( x.length, x, 1 );\n* // returns 15.0\n*/\nfunction dasum( N, x, stride ) {\n\tvar sum;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn sum;\n\t}\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[i] );\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs(x[i]) + abs(x[i+1]) + abs(x[i+2]) + abs(x[i+3]) + abs(x[i+4]) + abs(x[i+5]); // eslint-disable-line max-len\n\t\t}\n\t\treturn sum;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tsum += abs( x[i] );\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - `x` stride length\n* @param {NonNegativeInteger} offset - starting `x` index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum( x.length, x, 1, 0 );\n* // returns 15.0\n*/\nfunction dasum( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tix = offset;\n\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[ix] );\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs( x[ix] ) + abs( x[ix+1] ) + abs( x[ix+2] ) + abs( x[ix+3] ) + abs( x[ix+4] ) + abs( x[ix+5] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += abs( x[ix] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dasum = require( './dasum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dasum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the sum of absolute values.\n*\n* @module @stdlib/blas/base/dasum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dasum = require( '@stdlib/blas/base/dasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum( x.length, x, 1 );\n* // returns 15.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dasum = require( '@stdlib/blas/base/dasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum.ndarray( x.length, x, 1, 0 );\n* // returns 15.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dasum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdasum = main;\n} else {\n\tdasum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n\n// exports: { \"ndarray\": \"dasum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction daxpy( N, alpha, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\ty[ i+1 ] += alpha * x[ i+1 ];\n\t\t\ty[ i+2 ] += alpha * x[ i+2 ];\n\t\t\ty[ i+3 ] += alpha * x[ i+3 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction daxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\ty[ iy+1 ] += alpha * x[ ix+1 ];\n\t\t\ty[ iy+2 ] += alpha * x[ ix+2 ];\n\t\t\ty[ iy+3 ] += alpha * x[ ix+3 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar daxpy = require( './daxpy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( daxpy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a vector `x` and a constant and add the result to `y`.\n*\n* @module @stdlib/blas/base/daxpy\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var daxpy = require( '@stdlib/blas/base/daxpy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var daxpy = require( '@stdlib/blas/base/daxpy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar daxpy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdaxpy = main;\n} else {\n\tdaxpy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n\n// exports: { \"ndarray\": \"daxpy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dcopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcopy = require( './dcopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas/base/dcopy\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcopy = require( '@stdlib/blas/base/dcopy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcopy = require( '@stdlib/blas/base/dcopy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcopy = main;\n} else {\n\tdcopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n\n// exports: { \"ndarray\": \"dcopy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction ddot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ i ] * y[ i ] ) + ( x[ i+1 ] * y[ i+1 ] ) + ( x[ i+2 ] * y[ i+2 ] ) + ( x[ i+3 ] * y[ i+3 ] ) + ( x[ i+4 ] * y[ i+4 ] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {integer} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction ddot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ ix ] * y[ iy ] ) + ( x[ ix+1 ] * y[ iy+1 ] ) + ( x[ ix+2 ] * y[ iy+2 ] ) + ( x[ ix+3 ] * y[ iy+3 ] ) + ( x[ ix+4 ] * y[ iy+4 ] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn dot;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ddot = require( './ddot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ddot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/ddot\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var ddot = require( '@stdlib/blas/base/ddot' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var ddot = require( '@stdlib/blas/base/ddot' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ddot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tddot = main;\n} else {\n\tddot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n\n// exports: { \"ndarray\": \"ddot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a double-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {number} L2-norm\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n*\n* var out = dnrm2( 3, x, 1 );\n* // returns 3.0\n*/\nfunction dnrm2( N, x, stride ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tscale = 0.0;\n\tssq = 1.0;\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tif ( x[ i ] !== 0.0 ) {\n\t\t\tax = abs( x[ i ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a double-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} L2-norm\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var out = dnrm2( 4, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnrm2( N, x, stride, offset ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tscale = 0.0;\n\tssq = 1.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( x[ ix ] !== 0.0 ) {\n\t\t\tax = abs( x[ ix ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t\tix += stride;\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnrm2 = require( './dnrm2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnrm2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the L2-norm of a double-precision floating-point vector.\n*\n* @module @stdlib/blas/base/dnrm2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnrm2 = require( '@stdlib/blas/base/dnrm2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n*\n* var out = dnrm2( 3, x, 1 );\n* // returns 3.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnrm2 = require( '@stdlib/blas/base/dnrm2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var out = dnrm2.ndarray( 4, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnrm2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnrm2 = main;\n} else {\n\tdnrm2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n\n// exports: { \"ndarray\": \"dnrm2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {PositiveInteger} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction dscal( N, alpha, x, stride ) {\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || stride <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] *= alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tx[ i ] *= alpha;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n* var alpha = 5.0;\n*\n* dscal( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction dscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] *= alpha;\n\t\t\tx[ ix+1 ] *= alpha;\n\t\t\tx[ ix+2 ] *= alpha;\n\t\t\tx[ ix+3 ] *= alpha;\n\t\t\tx[ ix+4 ] *= alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dscal = require( './dscal.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dscal, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a double-precision floating-point vector by a constant.\n*\n* @module @stdlib/blas/base/dscal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dscal = require( '@stdlib/blas/base/dscal' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dscal = require( '@stdlib/blas/base/dscal' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dscal;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdscal = main;\n} else {\n\tdscal = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n\n// exports: { \"ndarray\": \"dscal.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y` with extended accumulation and result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction dsdot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[i]*y[i] ) + ( x[i+1]*y[i+1] ) + ( x[i+2]*y[i+2] ) + ( x[i+3]*y[i+3] ) + ( x[i+4]*y[i+4] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y` with extended accumulation and result.\n*\n* @param {integer} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction dsdot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ ix ] * y[ iy ];\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ix]*y[iy] ) + ( x[ix+1]*y[iy+1] ) + ( x[ix+2]*y[iy+2] ) + ( x[ix+3]*y[iy+3] ) + ( x[ix+4]*y[iy+4] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn dot;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsdot = require( './dsdot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsdot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of vectors `x` and `y` with extended accumulation and result.\n*\n* @module @stdlib/blas/base/dsdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsdot = require( '@stdlib/blas/base/dsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot( x.length, x, 1, y, 1 );\n* // returns -12.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsdot = require( '@stdlib/blas/base/dsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -12.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsdot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsdot = main;\n} else {\n\tdsdot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n\n// exports: { \"ndarray\": \"dsdot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two double-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} `y`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dswap( N, x, strideX, y, strideY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tvar j;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ i ];\n\t\t\t\tx[ i ] = y[ i ];\n\t\t\t\ty[ i ] = tmp;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ i ];\n\t\t\tx[ i ] = y[ i ];\n\t\t\ty[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\n\t\t\tj += 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two double-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float64Array} `y`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = y[ iy ];\n\t\t\t\ty[ iy ] = tmp;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = y[ iy ];\n\t\t\ty[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = y[ iy+1 ];\n\t\t\ty[ iy+1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = y[ iy+2 ];\n\t\t\ty[ iy+2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dswap = require( './dswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/dswap\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dswap = require( '@stdlib/blas/base/dswap' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dswap = require( '@stdlib/blas/base/dswap' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdswap = main;\n} else {\n\tdswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n\n// exports: { \"ndarray\": \"dswap.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - `x` stride length\n* @returns {number} sum\n*\n* @example\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1 );\n* // 15.0\n*/\nfunction gasum( N, x, stride ) {\n\tvar sum;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn sum;\n\t}\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[i] );\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs(x[i]) + abs(x[i+1]) + abs(x[i+2]) + abs(x[i+3]) + abs(x[i+4]) + abs(x[i+5]); // eslint-disable-line max-len\n\t\t}\n\t\treturn sum;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tsum += abs( x[i] );\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - `x` stride length\n* @param {NonNegativeInteger} offset - starting `x` index\n* @returns {number} sum\n*\n* @example\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1, 0 );\n* // 15.0\n*/\nfunction gasum( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tix = offset;\n\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[ix] );\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs( x[ix] ) + abs( x[ix+1] ) + abs( x[ix+2] ) + abs( x[ix+3] ) + abs( x[ix+4] ) + abs( x[ix+5] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += abs( x[ix] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the sum of absolute values.\n*\n* @module @stdlib/blas/base/gasum\n*\n* @example\n* var gasum = require( '@stdlib/blas/base/gasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1 );\n* // 15.0\n*\n* @example\n* // Use the `ndarray` interface...\n* var gasum = require( '@stdlib/blas/base/gasum' ).ndarray;\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1, 0 );\n* // 15.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - destination array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction gaxpy( N, alpha, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\ty[ i+1 ] += alpha * x[ i+1 ];\n\t\t\ty[ i+2 ] += alpha * x[ i+2 ];\n\t\t\ty[ i+3 ] += alpha * x[ i+3 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gaxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {NumericArray} y - destination array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {NumericArray} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction gaxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\ty[ iy+1 ] += alpha * x[ ix+1 ];\n\t\t\ty[ iy+2 ] += alpha * x[ ix+2 ];\n\t\t\ty[ iy+3 ] += alpha * x[ ix+3 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gaxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply `x` and a constant and add the result to `y`.\n*\n* @module @stdlib/blas/base/gaxpy\n*\n* @example\n* var gaxpy = require( '@stdlib/blas/base/gaxpy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*\n* @example\n* var gaxpy = require( '@stdlib/blas/base/gaxpy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Object} y - output array object\n* @param {Collection} y.data - output array data\n* @param {Array} y.accessors - array element accessors\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Object} output array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var x = {\n* 'data': new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* var y = {\n* 'data': new Complex64Array( [ 5.0, 6.0, 7.0, 8.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* gcopy( x.data.length, x, 1, 0, y, 1, 0 );\n*\n* var view = reinterpret64( y.data, 0 );\n* // view => [ 1.0, 2.0, 3.0, 4.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( ybuf, iy, get( xbuf, ix ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Collection} y - destination array\n* @param {integer} strideY - `y` stride length\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\tif ( strideX < 0 ) {\n\t\t\tix = (1-N) * strideX;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\tif ( strideY < 0 ) {\n\t\t\tiy = (1-N) * strideY;\n\t\t} else {\n\t\t\tiy = 0;\n\t\t}\n\t\taccessors( N, ox, strideX, ix, oy, strideY, iy );\n\t\treturn oy.data;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Collection} y - destination array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn oy.data;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas/base/gcopy\n*\n* @example\n* var gcopy = require( '@stdlib/blas/base/gcopy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var gcopy = require( '@stdlib/blas/base/gcopy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n\n* var z = gdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction gdot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[i]*y[i] ) + ( x[i+1]*y[i+1] ) + ( x[i+2]*y[i+2] ) + ( x[i+3]*y[i+3] ) + ( x[i+4]*y[i+4] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {integer} N - number of indexed elements\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n\n* var z = gdot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction gdot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ix]*y[iy] ) + ( x[ix+1]*y[iy+1] ) + ( x[ix+2]*y[iy+2] ) + ( x[ix+3]*y[iy+3] ) + ( x[ix+4]*y[iy+4] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn dot;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of vectors `x` and `y`.\n*\n* @module @stdlib/blas/base/gdot\n*\n* @example\n* var gdot = require( '@stdlib/blas/base/gdot' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*\n* @example\n* var gdot = require( '@stdlib/blas/base/gdot' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {number} L2-norm\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var z = gnrm2( x.length, x, 1 );\n* // returns 3.0\n*/\nfunction gnrm2( N, x, stride ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tscale = 0.0;\n\tssq = 1.0;\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tif ( x[ i ] !== 0.0 ) {\n\t\t\tax = abs( x[ i ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} L2-norm\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var z = gnrm2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnrm2( N, x, stride, offset ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tscale = 0.0;\n\tssq = 1.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( x[ ix ] !== 0.0 ) {\n\t\t\tax = abs( x[ ix ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t\tix += stride;\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar gnrm2 = require( './gnrm2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( gnrm2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the L2-norm of a vector.\n*\n* @module @stdlib/blas/base/gnrm2\n*\n* @example\n* var gnrm2 = require( '@stdlib/blas/base/gnrm2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var z = gnrm2( x.length, x, 1 );\n* // returns 3.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnrm2 = require( '@stdlib/blas/base/gnrm2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var z = gnrm2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar gnrm2 = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction gscal( N, alpha, x, stride ) {\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0|| alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i += 1 ) {\n\t\t\t\tx[ i ] *= alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tx[ i ] *= alpha;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gscal( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction gscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply `x` by a constant.\n*\n* @module @stdlib/blas/base/gscal\n*\n* @example\n* var gscal = require( '@stdlib/blas/base/gscal' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* var gscal = require( '@stdlib/blas/base/gscal' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Interchanges vectors `x` and `y`.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - first input array object\n* @param {Collection} x.data - first input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Object} y - second input array object\n* @param {Collection} y.data - second input array array\n* @param {Array} y.accessors - array element accessors\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Object} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var x = {\n* 'data': new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* var y = {\n* 'data': new Complex64Array( [ 5.0, 6.0, 7.0, 8.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* gswap( x.data.length, x, 1, 0, y, 1, 0 );\n*\n* var viewX = reinterpret64( x.data, 0 );\n* // viewX => [ 5.0, 6.0, 7.0, 8.0 ]\n*\n* var viewY = reinterpret64( y.data, 0 );\n* // viewY => [ 1.0, 2.0, 3.0, 4.0 ]\n*/\nfunction gswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = get( xbuf, ix );\n\t\tset( xbuf, ix, get( ybuf, iy ) );\n\t\tset( ybuf, iy, tmp );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges vectors `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Collection} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gswap( N, x, strideX, y, strideY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\tvar j;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\tif ( strideX < 0 ) {\n\t\t\tix = (1-N) * strideX;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\tif ( strideY < 0 ) {\n\t\t\tiy = (1-N) * strideY;\n\t\t} else {\n\t\t\tiy = 0;\n\t\t}\n\t\taccessors( N, ox, strideX, ix, oy, strideY, iy );\n\t\treturn oy.data;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ i ];\n\t\t\t\tx[ i ] = y[ i ];\n\t\t\t\ty[ i ] = tmp;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ i ];\n\t\t\tx[ i ] = y[ i ];\n\t\t\ty[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\n\t\t\tj += 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges vectors `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Collection} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn oy.data;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = y[ iy ];\n\t\t\t\ty[ iy ] = tmp;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = y[ iy ];\n\t\t\ty[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = y[ iy+1 ];\n\t\t\ty[ iy+1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = y[ iy+2 ];\n\t\t\ty[ iy+2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange vectors `x` and `y`.\n*\n* @module @stdlib/blas/base/gswap\n*\n* @example\n* var gswap = require( '@stdlib/blas/base/gswap' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var gswap = require( '@stdlib/blas/base/gswap' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {PositiveInteger} stride - `x` stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum( x.length, x, 1 );\n* // returns 15.0\n*/\nfunction sasum( N, x, stride ) {\n\tvar sum;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn sum;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tsum = float64ToFloat32( sum + abs( x[i] ) );\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - `x` stride length\n* @param {NonNegativeInteger} offset - starting `x` index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum( x.length, x, 1, 0 );\n* // returns 15.0\n*/\nfunction sasum( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + abs( x[ix] ) );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sasum = require( './sasum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sasum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the sum of absolute values.\n*\n* @module @stdlib/blas/base/sasum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sasum = require( '@stdlib/blas/base/sasum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum( x.length, x, 1 );\n* // returns 15.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sasum = require( '@stdlib/blas/base/sasum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum.ndarray( x.length, x, 1, 0 );\n* // returns 15.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sasum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsasum = main;\n} else {\n\tsasum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n\n// exports: { \"ndarray\": \"sasum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction saxpy( N, alpha, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] += float64ToFloat32( alpha * x[ i ] );\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] += float64ToFloat32( alpha * x[ i ] );\n\t\t\ty[ i+1 ] += float64ToFloat32( alpha * x[ i+1 ] );\n\t\t\ty[ i+2 ] += float64ToFloat32( alpha * x[ i+2 ] );\n\t\t\ty[ i+3 ] += float64ToFloat32( alpha * x[ i+3 ] );\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction saxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\t\ty[ iy+1 ] += float64ToFloat32( alpha * x[ ix+1 ] );\n\t\t\ty[ iy+2 ] += float64ToFloat32( alpha * x[ ix+2 ] );\n\t\t\ty[ iy+3 ] += float64ToFloat32( alpha * x[ ix+3 ] );\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar saxpy = require( './saxpy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( saxpy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a vector `x` and a constant and add the result to `y`.\n*\n* @module @stdlib/blas/base/saxpy\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var saxpy = require( '@stdlib/blas/base/saxpy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var saxpy = require( '@stdlib/blas/base/saxpy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar saxpy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsaxpy = main;\n} else {\n\tsaxpy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n\n// exports: { \"ndarray\": \"saxpy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scopy = require( './scopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas/base/scopy\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scopy = require( '@stdlib/blas/base/scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scopy = require( '@stdlib/blas/base/scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscopy = main;\n} else {\n\tscopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n\n// exports: { \"ndarray\": \"scopy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction sdot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot = float64ToFloat32( dot + float64ToFloat32( x[ ix ] * y[ iy ] ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {integer} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction sdot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot = float64ToFloat32( dot + float64ToFloat32( x[ ix ] * y[ iy ] ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdot = require( './sdot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/sdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdot = require( '@stdlib/blas/base/sdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdot = require( '@stdlib/blas/base/sdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdot = main;\n} else {\n\tsdot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n\n// exports: { \"ndarray\": \"sdot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two single-precision floating-point vectors with extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} scalar - scalar constant to add to dot product\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot( x.length, 0.0, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction sdsdot( N, scalar, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = scalar;\n\tif ( N <= 0 ) {\n\t\treturn float64ToFloat32( dot );\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn float64ToFloat32( dot );\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[i]*y[i] ) + ( x[i+1]*y[i+1] ) + ( x[i+2]*y[i+2] ) + ( x[i+3]*y[i+3] ) + ( x[i+4]*y[i+4] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn float64ToFloat32( dot );\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn float64ToFloat32( dot );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two single-precision floating-point vectors with extended accumulation.\n*\n* @param {integer} N - number of indexed elements\n* @param {number} scalar - scalar constant to add to dot product\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot( x.length, 0.0, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction sdsdot( N, scalar, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = scalar;\n\tif ( N <= 0 ) {\n\t\treturn float64ToFloat32( dot );\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ ix ] * y[ iy ];\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn float64ToFloat32( dot );\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ix]*y[iy] ) + ( x[ix+1]*y[iy+1] ) + ( x[ix+2]*y[iy+2] ) + ( x[ix+3]*y[iy+3] ) + ( x[ix+4]*y[iy+4] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn float64ToFloat32( dot );\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn float64ToFloat32( dot );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsdot = require( './sdsdot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsdot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two single-precision floating-point vectors with extended accumulation.\n*\n* @module @stdlib/blas/base/sdsdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsdot = require( '@stdlib/blas/base/sdsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot( x.length, 0.0, x, 1, y, 1 );\n* // returns -12.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsdot = require( '@stdlib/blas/base/sdsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 );\n* // returns -12.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsdot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsdot = main;\n} else {\n\tsdsdot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n\n// exports: { \"ndarray\": \"sdsdot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {number} L2-norm\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = 3;\n*\n* var z = snrm2( N, x, 1 );\n* // returns 3.0\n*/\nfunction snrm2( N, x, stride ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tscale = 0.0;\n\tssq = 1.0;\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tif ( x[ i ] !== 0.0 ) {\n\t\t\tax = abs( x[ i ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = float64ToFloat32( 1.0 + ( ssq * pow( scale/ax, 2 ) ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq = float64ToFloat32( ssq + pow( ax/scale, 2 ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn float64ToFloat32( scale * sqrt( ssq ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} L2-norm\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var z = snrm2( 4, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snrm2( N, x, stride, offset ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tscale = 0.0;\n\tssq = 1.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( x[ ix ] !== 0.0 ) {\n\t\t\tax = abs( x[ ix ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = float64ToFloat32( 1.0 + ( ssq * pow( scale/ax, 2 ) ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq = float64ToFloat32( ssq + pow( ax/scale, 2 ) );\n\t\t\t}\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( scale * sqrt( ssq ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snrm2 = require( './snrm2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snrm2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the L2-norm of a single-precision floating-point vector.\n*\n* @module @stdlib/blas/base/snrm2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snrm2 = require( '@stdlib/blas/base/snrm2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = 3;\n*\n* var z = snrm2( N, x, 1 );\n* // returns 3.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snrm2 = require( '@stdlib/blas/base/snrm2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var z = snrm2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snrm2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnrm2 = main;\n} else {\n\tsnrm2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n\n// exports: { \"ndarray\": \"snrm2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar absf = require( '@stdlib/math/base/special/absf' );\nvar sqrtf = require( '@stdlib/math/base/special/sqrtf' );\nvar abs2f = require( '@stdlib/math/base/special/abs2f' );\nvar copysignf = require( '@stdlib/math/base/special/copysignf' );\n\n\n// MAIN //\n\n/**\n* Constructs a Givens plane rotation.\n*\n* @param {number} a - rotational elimination parameter\n* @param {number} b - rotational elimination parameter\n* @param {Float32Array} out - output array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var out = srotg( 0.0, 2.0, new Float32Array( 4 ), 1, 0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*/\nfunction srotg( a, b, out, stride, offset ) {\n\tvar scale;\n\tvar sign;\n\tvar aa;\n\tvar ab;\n\tvar r;\n\tvar c;\n\tvar s;\n\tvar z;\n\n\taa = absf( a );\n\tab = absf( b );\n\tif ( aa > ab ) {\n\t\tsign = copysignf( 1.0, a );\n\t} else {\n\t\tsign = copysignf( 1.0, b );\n\t}\n\tscale = float64ToFloat32( aa + ab );\n\tif ( scale === 0.0 ) {\n\t\tc = 1.0;\n\t\ts = 0.0;\n\t\tr = 0.0;\n\t\tz = 0.0;\n\t} else {\n\t\tr = float64ToFloat32( scale * sqrtf( float64ToFloat32( abs2f( float64ToFloat32( a/scale ) ) + abs2f( float64ToFloat32( b/scale ) ) ) ) ); // eslint-disable-line max-len\n\t\tr = float64ToFloat32( r * sign );\n\t\tc = float64ToFloat32( a / r );\n\t\ts = float64ToFloat32( b / r );\n\t\tz = 1.0;\n\t\tif ( aa > ab ) {\n\t\t\tz = s;\n\t\t} else if ( c !== 0.0 ) {\n\t\t\tz = float64ToFloat32( 1.0 / c );\n\t\t}\n\t}\n\ta = r;\n\tb = z;\n\tout[ offset ] = a;\n\tout[ offset + stride ] = b;\n\tout[ offset + ( 2 * stride ) ] = c;\n\tout[ offset + ( 3 * stride ) ] = s;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srotg;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Float32Array = require( '@stdlib/array/float32' );\nvar fcn = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Constructs a Givens plane rotation.\n*\n* @param {number} a - rotational elimination parameter\n* @param {number} b - rotational elimination parameter\n* @returns {Float32Array} output array\n*\n* @example\n* var out = srotg( 0.0, 2.0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*/\nfunction srotg( a, b ) {\n\tvar out = new Float32Array( 4 );\n\treturn fcn( a, b, out, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = srotg;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Construct a Givens plane rotation.\n*\n* @module @stdlib/blas/base/srotg\n*\n* @example\n* var srotg = require( '@stdlib/blas/base/srotg' );\n*\n* var out = srotg( 0.0, 2.0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*\n* out = srotg( 6.0, -8.0 );\n* // returns [ 10.0, ~-1.666, -0.6, 0.8 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var srotg = require( '@stdlib/blas/base/srotg' );\n*\n* var out = new Float32Array( 4 );\n*\n* var y = srotg.assign( 0.0, 2.0, out, 1, 0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {PositiveInteger} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction sscal( N, alpha, x, stride ) {\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || stride <= 0|| alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] *= alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tx[ i ] *= alpha;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n* var alpha = 5.0;\n*\n* sscal( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction sscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sscal = require( './sscal.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sscal, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a single-precision floating-point vector by a constant.\n*\n* @module @stdlib/blas/base/sscal\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sscal = require( '@stdlib/blas/base/sscal' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sscal = require( '@stdlib/blas/base/sscal' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sscal;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsscal = main;\n} else {\n\tsscal = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n\n// exports: { \"ndarray\": \"sscal.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction sswap( N, x, strideX, y, strideY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tvar j;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ i ];\n\t\t\t\tx[ i ] = y[ i ];\n\t\t\t\ty[ i ] = tmp;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ i ];\n\t\t\tx[ i ] = y[ i ];\n\t\t\ty[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\n\t\t\tj += 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction sswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = y[ iy ];\n\t\t\t\ty[ iy ] = tmp;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = y[ iy ];\n\t\t\ty[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = y[ iy+1 ];\n\t\t\ty[ iy+1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = y[ iy+2 ];\n\t\t\ty[ iy+2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sswap = require( './sswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/sswap\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sswap = require( '@stdlib/blas/base/sswap' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sswap = require( '@stdlib/blas/base/sswap' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsswap = main;\n} else {\n\tsswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n\n// exports: { \"ndarray\": \"sswap.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace blas\n*/\nvar blas = {};\n\n/**\n* @name ccopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/ccopy}\n*/\nsetReadOnly( blas, 'ccopy', require( './../../base/ccopy' ) );\n\n/**\n* @name cswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/cswap}\n*/\nsetReadOnly( blas, 'cswap', require( './../../base/cswap' ) );\n\n/**\n* @name dasum\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dasum}\n*/\nsetReadOnly( blas, 'dasum', require( './../../base/dasum' ) );\n\n/**\n* @name daxpy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/daxpy}\n*/\nsetReadOnly( blas, 'daxpy', require( './../../base/daxpy' ) );\n\n/**\n* @name dcopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dcopy}\n*/\nsetReadOnly( blas, 'dcopy', require( './../../base/dcopy' ) );\n\n/**\n* @name ddot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/ddot}\n*/\nsetReadOnly( blas, 'ddot', require( './../../base/ddot' ) );\n\n/**\n* @name dnrm2\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dnrm2}\n*/\nsetReadOnly( blas, 'dnrm2', require( './../../base/dnrm2' ) );\n\n/**\n* @name dscal\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dscal}\n*/\nsetReadOnly( blas, 'dscal', require( './../../base/dscal' ) );\n\n/**\n* @name dsdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dsdot}\n*/\nsetReadOnly( blas, 'dsdot', require( './../../base/dsdot' ) );\n\n/**\n* @name dswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dswap}\n*/\nsetReadOnly( blas, 'dswap', require( './../../base/dswap' ) );\n\n/**\n* @name gasum\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gasum}\n*/\nsetReadOnly( blas, 'gasum', require( './../../base/gasum' ) );\n\n/**\n* @name gaxpy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gaxpy}\n*/\nsetReadOnly( blas, 'gaxpy', require( './../../base/gaxpy' ) );\n\n/**\n* @name gcopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gcopy}\n*/\nsetReadOnly( blas, 'gcopy', require( './../../base/gcopy' ) );\n\n/**\n* @name gdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gdot}\n*/\nsetReadOnly( blas, 'gdot', require( './../../base/gdot' ) );\n\n/**\n* @name gnrm2\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gnrm2}\n*/\nsetReadOnly( blas, 'gnrm2', require( './../../base/gnrm2' ) );\n\n/**\n* @name gscal\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gscal}\n*/\nsetReadOnly( blas, 'gscal', require( './../../base/gscal' ) );\n\n/**\n* @name gswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gswap}\n*/\nsetReadOnly( blas, 'gswap', require( './../../base/gswap' ) );\n\n/**\n* @name sasum\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sasum}\n*/\nsetReadOnly( blas, 'sasum', require( './../../base/sasum' ) );\n\n/**\n* @name saxpy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/saxpy}\n*/\nsetReadOnly( blas, 'saxpy', require( './../../base/saxpy' ) );\n\n/**\n* @name scopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/scopy}\n*/\nsetReadOnly( blas, 'scopy', require( './../../base/scopy' ) );\n\n/**\n* @name sdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sdot}\n*/\nsetReadOnly( blas, 'sdot', require( './../../base/sdot' ) );\n\n/**\n* @name sdsdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sdsdot}\n*/\nsetReadOnly( blas, 'sdsdot', require( './../../base/sdsdot' ) );\n\n/**\n* @name snrm2\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/snrm2}\n*/\nsetReadOnly( blas, 'snrm2', require( './../../base/snrm2' ) );\n\n/**\n* @name srotg\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/srotg}\n*/\nsetReadOnly( blas, 'srotg', require( './../../base/srotg' ) );\n\n/**\n* @name sscal\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sscal}\n*/\nsetReadOnly( blas, 'sscal', require( './../../base/sscal' ) );\n\n/**\n* @name sswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sswap}\n*/\nsetReadOnly( blas, 'sswap', require( './../../base/sswap' ) );\n\n\n// EXPORTS //\n\nmodule.exports = blas;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' );\nvar format = require( '@stdlib/string/format' );\nvar dot = require( './../../base/ddot' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two double-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {number} dot product\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = ddot( x, y );\n* // returns -5.0\n*/\nfunction ddot( x, y ) {\n\tif ( !isFloat64VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat64VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/ddot\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n* var ddot = require( '@stdlib/blas/ddot' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = ddot( x, y );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' );\nvar format = require( '@stdlib/string/format' );\nvar swap = require( './../../base/dswap' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Interchanges two double-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {VectorLike} `y`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* dswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction dswap( x, y ) {\n\tif ( !isFloat64VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat64VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/dswap\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n* var dswap = require( '@stdlib/blas/dswap' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* dswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a double-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\nfunction dapx( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] += alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] += alpha;\n\t\t\tx[ i+1 ] += alpha;\n\t\t\tx[ i+2 ] += alpha;\n\t\t\tx[ i+3 ] += alpha;\n\t\t\tx[ i+4 ] += alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a double-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n* var alpha = 5.0;\n*\n* dapx( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]\n*/\nfunction dapx( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] += alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] += alpha;\n\t\t\tx[ ix+1 ] += alpha;\n\t\t\tx[ ix+2 ] += alpha;\n\t\t\tx[ ix+3 ] += alpha;\n\t\t\tx[ ix+4 ] += alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapx = require( './dapx.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapx, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each element in a double-precision floating-point strided array.\n*\n* @module @stdlib/blas/ext/base/dapx\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapx = require( '@stdlib/blas/ext/base/dapx' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapx = require( '@stdlib/blas/ext/base/dapx' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dapx.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapx;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapx = main;\n} else {\n\tdapx = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n\n// exports: { \"ndarray\": \"dapx.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumkbn( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumkbn( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumkbn = require( './dapxsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dapxsumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumkbn = main;\n} else {\n\tdapxsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n\n// exports: { \"ndarray\": \"dapxsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dapxsumkbn = require( './../../../../ext/base/dapxsumkbn' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsum( N, alpha, x, stride ) {\n\treturn dapxsumkbn( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dapxsumkbn = require( './../../../../ext/base/dapxsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsum( N, alpha, x, stride, offset ) {\n\treturn dapxsumkbn( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsum = require( './dapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum.\n*\n* @module @stdlib/blas/ext/base/dapxsum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsum = require( '@stdlib/blas/ext/base/dapxsum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsum = require( '@stdlib/blas/ext/base/dapxsum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsum = main;\n} else {\n\tdapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n\n// exports: { \"ndarray\": \"dapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumkbn2( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn2( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumkbn2( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumkbn2 = require( './dapxsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dapxsumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn2.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumkbn2 = main;\n} else {\n\tdapxsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n\n// exports: { \"ndarray\": \"dapxsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumors( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumors( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumors( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumors = require( './dapxsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dapxsumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumors.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumors = main;\n} else {\n\tdapxsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n\n// exports: { \"ndarray\": \"dapxsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dapxsumpw( n, alpha, x, stride, ix ) + dapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumpw = require( './dapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dapxsumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumpw = main;\n} else {\n\tdapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n\n// exports: { \"ndarray\": \"dapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dasumpw( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction dasumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = abs( x[ ix ] );\n\t\ts1 = abs( x[ ix+stride ] );\n\t\ts2 = abs( x[ ix+(2*stride) ] );\n\t\ts3 = abs( x[ ix+(3*stride) ] );\n\t\ts4 = abs( x[ ix+(4*stride) ] );\n\t\ts5 = abs( x[ ix+(5*stride) ] );\n\t\ts6 = abs( x[ ix+(6*stride) ] );\n\t\ts7 = abs( x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += abs( x[ ix ] );\n\t\t\ts1 += abs( x[ ix+stride ] );\n\t\t\ts2 += abs( x[ ix+(2*stride) ] );\n\t\t\ts3 += abs( x[ ix+(3*stride) ] );\n\t\t\ts4 += abs( x[ ix+(4*stride) ] );\n\t\t\ts5 += abs( x[ ix+(5*stride) ] );\n\t\t\ts6 += abs( x[ ix+(6*stride) ] );\n\t\t\ts7 += abs( x[ ix+(7*stride) ] );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dasumpw( n, x, stride, ix ) + dasumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dasumpw( N, x, 1 );\n* // returns 5.0\n*/\nfunction dasumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dasumpw = require( './dasumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dasumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dasumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dasumpw( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dasumpw.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dasumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdasumpw = main;\n} else {\n\tdasumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n\n// exports: { \"ndarray\": \"dasumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumkbn( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumkbn( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumkbn( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumkbn = require( './dcusumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dcusumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumkbn( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumkbn.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumkbn = main;\n} else {\n\tdcusumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n\n// exports: { \"ndarray\": \"dcusumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dcusumkbn = require( './../../../../ext/base/dcusumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusum( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusum( N, sum, x, strideX, y, strideY ) {\n\treturn dcusumkbn( N, sum, x, strideX, y, strideY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dcusumkbn = require( './../../../../ext/base/dcusumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusum( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusum( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\treturn dcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusum = require( './dcusum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/dcusum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusum = require( '@stdlib/blas/ext/base/dcusum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusum( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusum = require( '@stdlib/blas/ext/base/dcusum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusum.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusum = main;\n} else {\n\tdcusum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n\n// exports: { \"ndarray\": \"dcusum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumkbn2( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumkbn2( N, sum, x, strideX, y, strideY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumkbn2 = require( './dcusumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dcusumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumkbn2( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumkbn2 = main;\n} else {\n\tdcusumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n\n// exports: { \"ndarray\": \"dcusumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumors( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumors( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumors( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumors( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumors = require( './dcusumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dcusumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumors( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumors.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumors = main;\n} else {\n\tdcusumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n\n// exports: { \"ndarray\": \"dcusumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation:\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumpw( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumpw( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tif ( N <= BLOCKSIZE ) {\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\ty[ iy ] = sum + s;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t\treturn y;\n\t}\n\tn = floor( N/2 );\n\tdcusumpw( n, sum, x, strideX, ix, y, strideY, iy );\n\tiy += (n-1) * strideY;\n\tdcusumpw( N-n, y[ iy ], x, strideX, ix+(n*strideX), y, strideY, iy+strideY ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cusum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumpw( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumpw( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\treturn cusum( N, sum, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumpw = require( './dcusumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dcusumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumpw( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumpw.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumpw = main;\n} else {\n\tdcusumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n\n// exports: { \"ndarray\": \"dcusumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a double-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction dfill( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] = alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] = alpha;\n\t\t\tx[ i+1 ] = alpha;\n\t\t\tx[ i+2 ] = alpha;\n\t\t\tx[ i+3 ] = alpha;\n\t\t\tx[ i+4 ] = alpha;\n\t\t\tx[ i+5 ] = alpha;\n\t\t\tx[ i+6 ] = alpha;\n\t\t\tx[ i+7 ] = alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a double-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* dfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction dfill( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dfill = require( './dfill.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dfill, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a double-precision floating-point strided array with a specified scalar constant.\n*\n* @module @stdlib/blas/ext/base/dfill\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dfill = require( '@stdlib/blas/ext/base/dfill' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dfill = require( '@stdlib/blas/ext/base/dfill' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dfill;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdfill = main;\n} else {\n\tdfill = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n\n// exports: { \"ndarray\": \"dfill.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasumors( N, x, 1 );\n* // returns 5.0\n*/\nfunction dnanasumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tsum += abs( v );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasumors( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction dnanasumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tsum += abs( v );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnanasumors = require( './dnanasumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnanasumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dnanasumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasumors( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasumors.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnanasumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnanasumors = main;\n} else {\n\tdnanasumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n\n// exports: { \"ndarray\": \"dnanasumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnanasumors = require( './../../../../ext/base/dnanasumors' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasum( N, x, 1 );\n* // returns 5.0\n*/\nfunction dnanasum( N, x, stride ) {\n\treturn dnanasumors( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnanasumors = require( './../../../../ext/base/dnanasumors' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasum( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction dnanasum( N, x, stride, offset ) {\n\treturn dnanasumors( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnanasum = require( './dnanasum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnanasum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/dnanasum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnanasum = require( '@stdlib/blas/ext/base/dnanasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasum( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnanasum = require( '@stdlib/blas/ext/base/dnanasum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasum.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnanasum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnanasum = main;\n} else {\n\tdnanasum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n\n// exports: { \"ndarray\": \"dnanasum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumkbn( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumkbn = require( './dnannsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnannsumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumkbn = main;\n} else {\n\tdnannsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n\n// exports: { \"ndarray\": \"dnannsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnannsumkbn = require( './../../../../ext/base/dnannsumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsum( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsum( N, x, strideX, out, strideOut ) {\n\treturn dnannsumkbn( N, x, strideX, out, strideOut );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnannsumkbn = require( './../../../../ext/base/dnannsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsum( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsum( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\treturn dnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsum = require( './dnannsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/dnannsum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsum = require( '@stdlib/blas/ext/base/dnannsum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsum( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsum = require( '@stdlib/blas/ext/base/dnannsum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsum.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsum = main;\n} else {\n\tdnannsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n\n// exports: { \"ndarray\": \"dnannsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn2( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumkbn2( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ccs;\n\tvar cs;\n\tvar cc;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + cs + ccs;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn2( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumkbn2( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ccs;\n\tvar cs;\n\tvar cc;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + cs + ccs;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumkbn2 = require( './dnannsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnannsumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn2( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn2.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumkbn2 = main;\n} else {\n\tdnannsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n\n// exports: { \"ndarray\": \"dnannsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumors( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumors( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumors( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumors = require( './dnannsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dnannsumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumors.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumors = main;\n} else {\n\tdnannsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n\n// exports: { \"ndarray\": \"dnannsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of a double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - two-element output array whose first element is the accumulated sum and whose second element is the accumulated number of summed values\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var out = new Float64Array( [ 0.0, 0 ] );\n* var v = sumpw( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction sumpw( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar ix;\n\tvar io;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn out;\n\t}\n\tix = offsetX;\n\tio = offsetOut;\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] += x[ ix ];\n\t\tout[ io+strideOut ] += 1;\n\t\treturn out;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tn = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t}\n\t\tout[ io ] += s;\n\t\tout[ io+strideOut ] += n;\n\t\treturn out;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = 0.0;\n\t\ts1 = 0.0;\n\t\ts2 = 0.0;\n\t\ts3 = 0.0;\n\t\ts4 = 0.0;\n\t\ts5 = 0.0;\n\t\ts6 = 0.0;\n\t\ts7 = 0.0;\n\t\tn = 0;\n\n\t\tM = N % 8;\n\t\tfor ( i = 0; i < N-M; i += 8 ) {\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts0 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts1 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts2 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts3 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts4 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts5 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts6 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts7 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t}\n\t\tout[ io ] += s;\n\t\tout[ io+strideOut ] += n;\n\t\treturn out;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\tsumpw( n, x, strideX, ix, out, strideOut, offsetOut );\n\tsumpw( N-n, x, strideX, ix+(n*strideX), out, strideOut, offsetOut );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sumpw = require( './sumpw.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumpw( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumpw( N, x, strideX, out, strideOut ) {\n\tvar ix;\n\tvar io;\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tout[ io ] = 0.0;\n\tout[ io+strideOut ] = 0;\n\tsumpw( N, x, strideX, ix, out, strideOut, io );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sumpw = require( './sumpw.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumpw( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumpw( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = 0.0;\n\tout[ offsetOut+strideOut ] = 0;\n\tsumpw( N, x, strideX, offsetX, out, strideOut, offsetOut );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumpw = require( './dnannsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dnannsumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumpw( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumpw.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumpw = main;\n} else {\n\tdnannsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n\n// exports: { \"ndarray\": \"dnannsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumkbn = require( './dnansumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnansumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumkbn = main;\n} else {\n\tdnansumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n\n// exports: { \"ndarray\": \"dnansumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnansumkbn = require( './../../../../ext/base/dnansumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansum( N, x, stride ) {\n\treturn dnansumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnansumkbn = require( './../../../../ext/base/dnansumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansum( N, x, stride, offset ) {\n\treturn dnansumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansum = require( './dnansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/dnansum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansum = require( '@stdlib/blas/ext/base/dnansum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansum = require( '@stdlib/blas/ext/base/dnansum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansum = main;\n} else {\n\tdnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n\n// exports: { \"ndarray\": \"dnansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumkbn2 = require( './dnansumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnansumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumkbn2 = main;\n} else {\n\tdnansumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n\n// exports: { \"ndarray\": \"dnansumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumors = require( './dnansumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dnansumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumors = require( '@stdlib/blas/ext/base/dnansumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumors = require( '@stdlib/blas/ext/base/dnansumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumors = main;\n} else {\n\tdnansumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n\n// exports: { \"ndarray\": \"dnansumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dnansumpw( n, x, stride, ix ) + dnansumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumpw = require( './dnansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dnansumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumpw = main;\n} else {\n\tdnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n\n// exports: { \"ndarray\": \"dnansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a double-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* drev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\nfunction drev( N, x, stride ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( ix = 0; ix < m; ix++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tiy -= 1;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( ix = m; ix < n; ix += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a double-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* drev( 3, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]\n*/\nfunction drev( N, x, stride, offset ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = ix + N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tix += stride;\n\t\t\t\tiy -= stride;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < n; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar drev = require( './drev.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( drev, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reverse a double-precision floating-point strided array in-place.\n*\n* @module @stdlib/blas/ext/base/drev\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var drev = require( '@stdlib/blas/ext/base/drev' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* drev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var drev = require( '@stdlib/blas/ext/base/drev' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* drev( x.length, x, 1, 0 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar drev;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdrev = main;\n} else {\n\tdrev = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n\n// exports: { \"ndarray\": \"drev.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dsapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dsapxsumpw( n, alpha, x, stride, ix ) + dsapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dsapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsapxsumpw = require( './dsapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsapxsumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsapxsumpw = main;\n} else {\n\tdsapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n\n// exports: { \"ndarray\": \"dsapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsapxsumpw = require( './../../../../ext/base/dsapxsumpw' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dsapxsum( N, alpha, x, stride ) {\n\treturn dsapxsumpw( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsapxsumpw = require( './../../../../ext/base/dsapxsumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dsapxsum( N, alpha, x, stride, offset ) {\n\treturn dsapxsumpw( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsapxsum = require( './dsapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsapxsum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsapxsum = main;\n} else {\n\tdsapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n\n// exports: { \"ndarray\": \"dsapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dsnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dsnannsumors( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dsnannsumors( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dsnannsumors( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnannsumors = require( './dsnannsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnannsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnannsumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dsnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dsnannsumors.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnannsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnannsumors = main;\n} else {\n\tdsnannsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n\n// exports: { \"ndarray\": \"dsnannsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dsnansumpw( n, x, stride, ix ) + dsnansumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnansumpw = require( './dsnansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnansumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnansumpw = main;\n} else {\n\tdsnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n\n// exports: { \"ndarray\": \"dsnansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsnansumpw = require( './../../../../ext/base/dsnansumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsnansum( N, x, stride ) {\n\treturn dsnansumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsnansumpw = require( './../../../../ext/base/dsnansumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsnansum( N, x, stride, offset ) {\n\treturn dsnansumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnansum = require( './dsnansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnansum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsnansum = require( '@stdlib/blas/ext/base/dsnansum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnansum = require( '@stdlib/blas/ext/base/dsnansum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnansum = main;\n} else {\n\tdsnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n\n// exports: { \"ndarray\": \"dsnansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsnansumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsnansumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnansumors = require( './dsnansumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnansumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnansumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnansumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnansumors = main;\n} else {\n\tdsnansumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n\n// exports: { \"ndarray\": \"dsnansumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2hp( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2hp( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsort2hp = require( './dsort2hp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsort2hp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* @module @stdlib/blas/ext/base/dsort2hp\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsort2hp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsort2hp = main;\n} else {\n\tdsort2hp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n\n// exports: { \"ndarray\": \"dsort2hp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2ins( N, order, x, strideX, y, strideY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideY < 0 ) {\n\t\tfy = (1-N) * strideY;\n\t\tly = 0;\n\t} else {\n\t\tfy = 0;\n\t\tly = (N-1) * strideY;\n\t}\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * strideX; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + strideX;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * strideX; // last index\n\tix = fx + strideX;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfx = offsetX; // first index\n\tlx = fx + ((N-1)*strideX); // last index\n\tix = fx + strideX;\n\n\tfy = offsetY; // first index\n\tly = fy + ((N-1)*strideY); // last index\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsort2ins = require( './dsort2ins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsort2ins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/dsort2ins\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsort2ins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsort2ins = main;\n} else {\n\tdsort2ins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n\n// exports: { \"ndarray\": \"dsort2ins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2sh( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2sh( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsort2sh = require( './dsort2sh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsort2sh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/dsort2sh\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsort2sh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsort2sh = main;\n} else {\n\tdsort2sh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n\n// exports: { \"ndarray\": \"dsort2sh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsorthp( N, order, x, stride ) {\n\tvar offset;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsorthp( N, order, x, stride, offset ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsorthp = require( './dsorthp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsorthp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a double-precision floating-point strided array using heapsort.\n*\n* @module @stdlib/blas/ext/base/dsorthp\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsorthp = require( '@stdlib/blas/ext/base/dsorthp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsorthp = require( '@stdlib/blas/ext/base/dsorthp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsorthp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsorthp = main;\n} else {\n\tdsorthp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n\n// exports: { \"ndarray\": \"dsorthp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortins( N, order, x, stride ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * stride; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + stride;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * stride; // last index\n\tix = fx + stride;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortins( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfx = offset; // first index\n\tlx = fx + ((N-1)*stride); // last index\n\tix = fx + stride;\n\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsortins = require( './dsortins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsortins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a double-precision floating-point strided array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/dsortins\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortins = require( '@stdlib/blas/ext/base/dsortins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortins = require( '@stdlib/blas/ext/base/dsortins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsortins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsortins = main;\n} else {\n\tdsortins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n\n// exports: { \"ndarray\": \"dsortins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortsh( N, order, x, stride ) {\n\tvar offset;\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortsh( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsortsh = require( './dsortsh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsortsh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a double-precision floating-point strided array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/dsortsh\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsortsh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsortsh = main;\n} else {\n\tdsortsh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n\n// exports: { \"ndarray\": \"dsortsh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dssumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dssumpw( n, x, stride, ix ) + dssumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dssumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dssumpw = require( './dssumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dssumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dssumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dssumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdssumpw = main;\n} else {\n\tdssumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n\n// exports: { \"ndarray\": \"dssumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dssumpw = require( './../../../../ext/base/dssumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dssum( N, x, stride ) {\n\treturn dssumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dssumpw = require( './../../../../ext/base/dssumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dssum( N, x, stride, offset ) {\n\treturn dssumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dssum = require( './dssum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dssum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dssum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dssum = require( '@stdlib/blas/ext/base/dssum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dssum = require( '@stdlib/blas/ext/base/dssum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dssum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdssum = main;\n} else {\n\tdssum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n\n// exports: { \"ndarray\": \"dssum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dssumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[i] + x[i+1] + x[i+2] + x[i+3] + x[i+4] + x[i+5];\n\t\t}\n\t\treturn sum;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dssumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ ix ];\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[ix] + x[ix+1] + x[ix+2] + x[ix+3] + x[ix+4] + x[ix+5];\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dssumors = require( './dssumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dssumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dssumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dssumors = require( '@stdlib/blas/ext/base/dssumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dssumors = require( '@stdlib/blas/ext/base/dssumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dssumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdssumors = main;\n} else {\n\tdssumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n\n// exports: { \"ndarray\": \"dssumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumkbn = require( './dsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dsumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumkbn = main;\n} else {\n\tdsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n\n// exports: { \"ndarray\": \"dsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsumkbn = require( './../../../../ext/base/dsumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsum( N, x, stride ) {\n\treturn dsumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsumkbn = require( './../../../../ext/base/dsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsum( N, x, stride, offset ) {\n\treturn dsumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsum = require( './dsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/dsum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsum = require( '@stdlib/blas/ext/base/dsum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsum = require( '@stdlib/blas/ext/base/dsum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsum = main;\n} else {\n\tdsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n\n// exports: { \"ndarray\": \"dsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumkbn2 = require( './dsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dsumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumkbn2 = main;\n} else {\n\tdsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n\n// exports: { \"ndarray\": \"dsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[i] + x[i+1] + x[i+2] + x[i+3] + x[i+4] + x[i+5];\n\t\t}\n\t\treturn sum;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ ix ];\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[ix] + x[ix+1] + x[ix+2] + x[ix+3] + x[ix+4] + x[ix+5];\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumors = require( './dsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dsumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumors = require( '@stdlib/blas/ext/base/dsumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumors = require( '@stdlib/blas/ext/base/dsumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumors = main;\n} else {\n\tdsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n\n// exports: { \"ndarray\": \"dsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dsumpw( n, x, stride, ix ) + dsumpw( N-n, x, stride, ix+(n*stride) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumpw = require( './dsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dsumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumpw = require( '@stdlib/blas/ext/base/dsumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumpw = require( '@stdlib/blas/ext/base/dsumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumpw = main;\n} else {\n\tdsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n\n// exports: { \"ndarray\": \"dsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\nfunction gapx( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] += alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] += alpha;\n\t\t\tx[ i+1 ] += alpha;\n\t\t\tx[ i+2 ] += alpha;\n\t\t\tx[ i+3 ] += alpha;\n\t\t\tx[ i+4 ] += alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n* var alpha = 5.0;\n*\n* gapx( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]\n*/\nfunction gapx( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] += alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] += alpha;\n\t\t\tx[ ix+1 ] += alpha;\n\t\t\tx[ ix+2 ] += alpha;\n\t\t\tx[ ix+3 ] += alpha;\n\t\t\tx[ ix+4 ] += alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each element in a strided array.\n*\n* @module @stdlib/blas/ext/base/gapx\n*\n* @example\n* var gapx = require( '@stdlib/blas/ext/base/gapx' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*\n* @example\n* var gapx = require( '@stdlib/blas/ext/base/gapx' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gapx.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumkbn( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumkbn( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gapxsumkbn\n*\n* @example\n* var gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gapxsumkbn = require( './../../../../ext/base/gapxsumkbn' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsum( N, alpha, x, stride ) {\n\treturn gapxsumkbn( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gapxsumkbn = require( './../../../../ext/base/gapxsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsum( N, alpha, x, stride, offset ) {\n\treturn gapxsumkbn( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum.\n*\n* @module @stdlib/blas/ext/base/gapxsum\n*\n* @example\n* var gapxsum = require( '@stdlib/blas/ext/base/gapxsum' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsum = require( '@stdlib/blas/ext/base/gapxsum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumkbn2( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn2( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumkbn2( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gapxsumkbn2\n*\n* @example\n* var gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn2.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumors( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumors( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumors( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gapxsumors\n*\n* @example\n* var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumors.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gapxsumpw( n, alpha, x, stride, ix ) + gapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gapxsumpw\n*\n* @example\n* var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gasumpw( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction gasumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = abs( x[ ix ] );\n\t\ts1 = abs( x[ ix+stride ] );\n\t\ts2 = abs( x[ ix+(2*stride) ] );\n\t\ts3 = abs( x[ ix+(3*stride) ] );\n\t\ts4 = abs( x[ ix+(4*stride) ] );\n\t\ts5 = abs( x[ ix+(5*stride) ] );\n\t\ts6 = abs( x[ ix+(6*stride) ] );\n\t\ts7 = abs( x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += abs( x[ ix ] );\n\t\t\ts1 += abs( x[ ix+stride ] );\n\t\t\ts2 += abs( x[ ix+(2*stride) ] );\n\t\t\ts3 += abs( x[ ix+(3*stride) ] );\n\t\t\ts4 += abs( x[ ix+(4*stride) ] );\n\t\t\ts5 += abs( x[ ix+(5*stride) ] );\n\t\t\ts6 += abs( x[ ix+(6*stride) ] );\n\t\t\ts7 += abs( x[ ix+(7*stride) ] );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gasumpw( n, x, stride, ix ) + gasumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gasumpw( x.length, x, 1 );\n* // returns 5.0\n*/\nfunction gasumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gasumpw\n*\n* @example\n* var gasumpw = require( '@stdlib/blas/ext/base/gasumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gasumpw( x.length, x, 1 );\n* // returns 5.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gasumpw = require( '@stdlib/blas/ext/base/gasumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gasumpw.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumkbn( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumkbn( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gcusumkbn\n*\n* @example\n* var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumkbn( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gcusumkbn = require( './../../../../ext/base/gcusumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusum( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusum( N, sum, x, strideX, y, strideY ) {\n\treturn gcusumkbn( N, sum, x, strideX, y, strideY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gcusumkbn = require( './../../../../ext/base/gcusumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusum( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusum( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\treturn gcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements.\n*\n* @module @stdlib/blas/ext/base/gcusum\n*\n* @example\n* var gcusum = require( '@stdlib/blas/ext/base/gcusum' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusum( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusum = require( '@stdlib/blas/ext/base/gcusum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusum.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumkbn2( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumkbn2( N, sum, x, strideX, y, strideY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gcusumkbn2\n*\n* @example\n* var gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumkbn2( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumors( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumors( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumors( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumors( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gcusumors\n*\n* @example\n* var gcusumors = require( '@stdlib/blas/ext/base/gcusumors' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumors( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumors = require( '@stdlib/blas/ext/base/gcusumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumors.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation:\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumpw( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumpw( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tif ( N <= BLOCKSIZE ) {\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\ty[ iy ] = sum + s;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t\treturn y;\n\t}\n\tn = floor( N/2 );\n\tgcusumpw( n, sum, x, strideX, ix, y, strideY, iy );\n\tiy += (n-1) * strideY;\n\tgcusumpw( N-n, y[ iy ], x, strideX, ix+(n*strideX), y, strideY, iy+strideY ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cusum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumpw( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumpw( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\treturn cusum( N, sum, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gcusumpw\n*\n* @example\n* var gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumpw( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumpw.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Object} input array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ null, setter ]\n* };\n*\n* var alpha = new Complex64( 5.0, 5.0 );\n*\n* gfill( data.length, alpha, x, 1, 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // view => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, stride, offset ) {\n\tvar xbuf;\n\tvar set;\n\tvar ix;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessor:\n\tset = x.accessors[ 1 ];\n\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( xbuf, ix, alpha );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @returns {Collection} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\tvar o;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\tif ( stride < 0 ) {\n\t\t\tix = (1-N) * stride;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\taccessors( N, alpha, o, stride, ix );\n\t\treturn o.data;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] = alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] = alpha;\n\t\t\tx[ i+1 ] = alpha;\n\t\t\tx[ i+2 ] = alpha;\n\t\t\tx[ i+3 ] = alpha;\n\t\t\tx[ i+4 ] = alpha;\n\t\t\tx[ i+5 ] = alpha;\n\t\t\tx[ i+6 ] = alpha;\n\t\t\tx[ i+7 ] = alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Collection} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, alpha, o, stride, offset );\n\t\treturn o.data;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with a specified scalar constant.\n*\n* @module @stdlib/blas/ext/base/gfill\n*\n* @example\n* var gfill = require( '@stdlib/blas/ext/base/gfill' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var gfill = require( '@stdlib/blas/ext/base/gfill' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Fills a strided array according to a provided callback function.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @param {Callback} clbk - callback\n* @param {*} thisArg - execution context\n* @returns {Object} input array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ getter, setter ]\n* };\n*\n* function clbk() {\n* return new Complex64( 5.0, 5.0 );\n* }\n*\n* gfillBy( data.length, x, 1, 0, clbk, void 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // view => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfillBy( N, x, stride, offset, clbk, thisArg ) {\n\tvar xbuf;\n\tvar set;\n\tvar get;\n\tvar ix;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = x.accessors[ 1 ];\n\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( xbuf, ix, clbk.call( thisArg, get( xbuf, ix ), i, ix, x ) );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfillBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array according to a provided callback function.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @param {Callback} clbk - callback\n* @param {*} [thisArg] - execution context\n* @returns {Collection} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* gfillBy( x.length, x, 1, fill );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfillBy( N, x, stride, clbk, thisArg ) {\n\tvar ix;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, o, stride, ix, clbk, thisArg );\n\t\treturn o.data;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = clbk.call( thisArg, x[ ix ], i, ix, x );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfillBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array according to a provided callback function.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @param {Callback} clbk - callback\n* @param {*} [thisArg] - execution context\n* @returns {Collection} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* gfillBy( 3, x, 1, x.length-3, fill );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfillBy( N, x, stride, offset, clbk, thisArg ) {\n\tvar ix;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, o, stride, offset, clbk, thisArg );\n\t\treturn o.data;\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = clbk.call( thisArg, x[ ix ], i, ix, x );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfillBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array according to a provided callback function.\n*\n* @module @stdlib/blas/ext/base/gfill-by\n*\n* @example\n* var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' );\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfillBy( x.length, x, 1, fill );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' );\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfillBy.ndarray( x.length, x, 1, 0, fill );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var out = [ 0.0, 0 ];\n*\n* var v = gnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction gnannsumkbn( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var out = [ 0.0, 0 ];\n*\n* var N = floor( x.length / 2 );\n*\n* var v = gnannsumkbn( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction gnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gnannsumkbn\n*\n* @example\n* var gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var out = [ 0.0, 0 ];\n*\n* var v = gnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var out = [ 0.0, 0 ];\n*\n* var N = floor( x.length / 2 );\n*\n* var v = gnannsumkbn.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gnansumkbn\n*\n* @example\n* var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gnansumkbn = require( './../../../../ext/base/gnansumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansum( N, x, stride ) {\n\treturn gnansumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gnansumkbn = require( './../../../../ext/base/gnansumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansum( N, x, stride, offset ) {\n\treturn gnansumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/gnansum\n*\n* @example\n* var gnansum = require( '@stdlib/blas/ext/base/gnansum' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansum = require( '@stdlib/blas/ext/base/gnansum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gnansumkbn2\n*\n* @example\n* var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumors( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn s;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\ts += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumors( N, x, stride, offset ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn s;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\ts += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gnansumors\n*\n* @example\n* var gnansumors = require( '@stdlib/blas/ext/base/gnansumors' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumors = require( '@stdlib/blas/ext/base/gnansumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gnansumpw( n, x, stride, ix ) + gnansumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gnansumpw\n*\n* @example\n* var gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Reverses a strided array in-place.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Object} input array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ getter, setter ]\n* };\n*\n* grev( data.length, x, 1, 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // view => [ -1.0, -3.0, 4.0, 0.0, 3.0, -5.0, -2.0, 1.0 ]\n*/\nfunction grev( N, x, stride, offset ) {\n\tvar xbuf;\n\tvar set;\n\tvar get;\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = x.accessors[ 1 ];\n\n\tn = floor( N/2 );\n\tix = offset;\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = get( xbuf, ix );\n\t\tset( xbuf, ix, get( xbuf, iy ) );\n\t\tset( xbuf, iy, tmp );\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = grev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* grev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\nfunction grev( N, x, stride ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar o;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\tif ( stride < 0 ) {\n\t\t\tix = (1-N) * stride;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\taccessors( N, o, stride, ix );\n\t\treturn o.data;\n\t}\n\tn = floor( N/2 );\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( ix = 0; ix < m; ix++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tiy -= 1;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( ix = m; ix < n; ix += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = grev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* grev( 3, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]\n*/\nfunction grev( N, x, stride, offset ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar o;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, o, stride, offset );\n\t\treturn o.data;\n\t}\n\tn = floor( N/2 );\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = ix + N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tix += stride;\n\t\t\t\tiy -= stride;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < n; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = grev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reverse a strided array in-place.\n*\n* @module @stdlib/blas/ext/base/grev\n*\n* @example\n* var grev = require( '@stdlib/blas/ext/base/grev' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* grev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*\n* @example\n* var grev = require( '@stdlib/blas/ext/base/grev' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* grev( x.length, x, 1, 0 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2hp( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2hp( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* @module @stdlib/blas/ext/base/gsort2hp\n*\n* @example\n* var gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2ins( N, order, x, strideX, y, strideY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideY < 0 ) {\n\t\tfy = (1-N) * strideY;\n\t\tly = 0;\n\t} else {\n\t\tfy = 0;\n\t\tly = (N-1) * strideY;\n\t}\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * strideX; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + strideX;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * strideX; // last index\n\tix = fx + strideX;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfx = offsetX; // first index\n\tlx = fx + ((N-1)*strideX); // last index\n\tix = fx + strideX;\n\n\tfy = offsetY; // first index\n\tly = fy + ((N-1)*strideY); // last index\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two strided arrays based on the sort order of the first array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/gsort2ins\n*\n* @example\n* var gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2sh( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform Shellsort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2sh( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform Shellsort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/gsort2sh\n*\n* @example\n* var gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsorthp( N, order, x, stride ) {\n\tvar offset;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsorthp( N, order, x, stride, offset ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a strided array using heapsort.\n*\n* @module @stdlib/blas/ext/base/gsorthp\n*\n* @example\n* var gsorthp = require( '@stdlib/blas/ext/base/gsorthp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var gsorthp = require( '@stdlib/blas/ext/base/gsorthp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortins( N, order, x, stride ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * stride; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + stride;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * stride; // last index\n\tix = fx + stride;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortins( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfx = offset; // first index\n\tlx = fx + ((N-1)*stride); // last index\n\tix = fx + stride;\n\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a strided array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/gsortins\n*\n* @example\n* var gsortins = require( '@stdlib/blas/ext/base/gsortins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var gsortins = require( '@stdlib/blas/ext/base/gsortins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortsh( N, order, x, stride ) {\n\tvar offset;\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortsh( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a strided array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/gsortsh\n*\n* @example\n* var gsortsh = require( '@stdlib/blas/ext/base/gsortsh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var gsortsh = require( '@stdlib/blas/ext/base/gsortsh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gsumkbn\n*\n* @example\n* var gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gsumkbn = require( './../../../../ext/base/gsumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsum( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsum( N, x, stride ) {\n\treturn gsumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gsumkbn = require( './../../../../ext/base/gsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsum( N, x, stride, offset ) {\n\treturn gsumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements.\n*\n* @module @stdlib/blas/ext/base/gsum\n*\n* @example\n* var gsum = require( '@stdlib/blas/ext/base/gsum' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsum = require( '@stdlib/blas/ext/base/gsum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gsumkbn2\n*\n* @example\n* var gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumors( N, x, stride ) {\n\tvar ix;\n\tvar m;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ts += x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn s;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ts += x[i] + x[i+1] + x[i+2] + x[i+3] + x[i+4] + x[i+5];\n\t\t}\n\t\treturn s;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ts += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumors( N, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn s;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ts += x[ix] + x[ix+1] + x[ix+2] + x[ix+3] + x[ix+4] + x[ix+5];\n\t\t\tix += M;\n\t\t}\n\t\treturn s;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ts += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gsumors\n*\n* @example\n* var gsumors = require( '@stdlib/blas/ext/base/gsumors' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumors = require( '@stdlib/blas/ext/base/gsumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gsumpw( n, x, stride, ix ) + gsumpw( N-n, x, stride, ix+(n*stride) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gsumpw\n*\n* @example\n* var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a single-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\nfunction sapx( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] += alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] += alpha;\n\t\t\tx[ i+1 ] += alpha;\n\t\t\tx[ i+2 ] += alpha;\n\t\t\tx[ i+3 ] += alpha;\n\t\t\tx[ i+4 ] += alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a single-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n* var alpha = 5.0;\n*\n* sapx( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]\n*/\nfunction sapx( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] += alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] += alpha;\n\t\t\tx[ ix+1 ] += alpha;\n\t\t\tx[ ix+2 ] += alpha;\n\t\t\tx[ ix+3 ] += alpha;\n\t\t\tx[ ix+4 ] += alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapx = require( './sapx.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapx, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each element in a single-precision floating-point strided array.\n*\n* @module @stdlib/blas/ext/base/sapx\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapx = require( '@stdlib/blas/ext/base/sapx' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapx = require( '@stdlib/blas/ext/base/sapx' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sapx.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapx;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapx = main;\n} else {\n\tsapx = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n\n// exports: { \"ndarray\": \"sapx.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumkbn( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumkbn( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumkbn = require( './sapxsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/sapxsumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumkbn = main;\n} else {\n\tsapxsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n\n// exports: { \"ndarray\": \"sapxsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sapxsumkbn = require( './../../../../ext/base/sapxsumkbn' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsum( N, alpha, x, stride ) {\n\treturn sapxsumkbn( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sapxsumkbn = require( './../../../../ext/base/sapxsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsum( N, alpha, x, stride, offset ) {\n\treturn sapxsumkbn( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsum = require( './sapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum.\n*\n* @module @stdlib/blas/ext/base/sapxsum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsum = require( '@stdlib/blas/ext/base/sapxsum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsum = require( '@stdlib/blas/ext/base/sapxsum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsum = main;\n} else {\n\tsapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n\n// exports: { \"ndarray\": \"sapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumkbn2( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn2( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumkbn2( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumkbn2 = require( './sapxsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/sapxsumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn2.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumkbn2 = main;\n} else {\n\tsapxsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n\n// exports: { \"ndarray\": \"sapxsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumors( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + float64ToFloat32( alpha+x[ ix ] ) );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumors( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumors( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + float64ToFloat32( alpha+x[ ix ] ) );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumors = require( './sapxsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/sapxsumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumors.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumors = main;\n} else {\n\tsapxsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n\n// exports: { \"ndarray\": \"sapxsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = float64ToFloat32( alpha + x[ ix ] );\n\t\ts1 = float64ToFloat32( alpha + x[ ix+stride ] );\n\t\ts2 = float64ToFloat32( alpha + x[ ix+(2*stride) ] );\n\t\ts3 = float64ToFloat32( alpha + x[ ix+(3*stride) ] );\n\t\ts4 = float64ToFloat32( alpha + x[ ix+(4*stride) ] );\n\t\ts5 = float64ToFloat32( alpha + x[ ix+(5*stride) ] );\n\t\ts6 = float64ToFloat32( alpha + x[ ix+(6*stride) ] );\n\t\ts7 = float64ToFloat32( alpha + x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = float64ToFloat32( s0 + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\ts1 = float64ToFloat32( s1 + float64ToFloat32( alpha + x[ ix+stride ] ) );\n\t\t\ts2 = float64ToFloat32( s2 + float64ToFloat32( alpha + x[ ix+(2*stride) ] ) );\n\t\t\ts3 = float64ToFloat32( s3 + float64ToFloat32( alpha + x[ ix+(3*stride) ] ) );\n\t\t\ts4 = float64ToFloat32( s4 + float64ToFloat32( alpha + x[ ix+(4*stride) ] ) );\n\t\t\ts5 = float64ToFloat32( s5 + float64ToFloat32( alpha + x[ ix+(5*stride) ] ) );\n\t\t\ts6 = float64ToFloat32( s6 + float64ToFloat32( alpha + x[ ix+(6*stride) ] ) );\n\t\t\ts7 = float64ToFloat32( s7 + float64ToFloat32( alpha + x[ ix+(7*stride) ] ) );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) );\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sapxsumpw( n, alpha, x, stride, ix ) + sapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumpw = require( './sapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/sapxsumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumpw = main;\n} else {\n\tsapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n\n// exports: { \"ndarray\": \"sapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sasumpw( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction sasumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + abs( x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = abs( x[ ix ] );\n\t\ts1 = abs( x[ ix+stride ] );\n\t\ts2 = abs( x[ ix+(2*stride) ] );\n\t\ts3 = abs( x[ ix+(3*stride) ] );\n\t\ts4 = abs( x[ ix+(4*stride) ] );\n\t\ts5 = abs( x[ ix+(5*stride) ] );\n\t\ts6 = abs( x[ ix+(6*stride) ] );\n\t\ts7 = abs( x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = float64ToFloat32( s0 + abs( x[ ix ] ) );\n\t\t\ts1 = float64ToFloat32( s1 + abs( x[ ix+stride ] ) );\n\t\t\ts2 = float64ToFloat32( s2 + abs( x[ ix+(2*stride) ] ) );\n\t\t\ts3 = float64ToFloat32( s3 + abs( x[ ix+(3*stride) ] ) );\n\t\t\ts4 = float64ToFloat32( s4 + abs( x[ ix+(4*stride) ] ) );\n\t\t\ts5 = float64ToFloat32( s5 + abs( x[ ix+(5*stride) ] ) );\n\t\t\ts6 = float64ToFloat32( s6 + abs( x[ ix+(6*stride) ] ) );\n\t\t\ts7 = float64ToFloat32( s7 + abs( x[ ix+(7*stride) ] ) );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) ); // eslint-disable-line max-len\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + abs( x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sasumpw( n, x, stride, ix ) + sasumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sasumpw( N, x, 1 );\n* // returns 5.0\n*/\nfunction sasumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + abs( x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sasumpw = require( './sasumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sasumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of single-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/sasumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sasumpw = require( '@stdlib/blas/ext/base/sasumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sasumpw( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sasumpw = require( '@stdlib/blas/ext/base/sasumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sasumpw.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sasumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsasumpw = main;\n} else {\n\tsasumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n\n// exports: { \"ndarray\": \"sasumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumkbn( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumkbn( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( s + v );\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( s-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + s ) ); // eslint-disable-line max-len\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = float64ToFloat32( s + c );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumkbn( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( s + v );\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( s-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + s ) ); // eslint-disable-line max-len\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = float64ToFloat32( s + c );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumkbn = require( './scusumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/scusumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumkbn( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumkbn.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumkbn = main;\n} else {\n\tscusumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n\n// exports: { \"ndarray\": \"scusumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar scusumkbn = require( './../../../../ext/base/scusumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusum( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusum( N, sum, x, strideX, y, strideY ) {\n\treturn scusumkbn( N, sum, x, strideX, y, strideY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar scusumkbn = require( './../../../../ext/base/scusumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusum( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusum( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\treturn scusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusum = require( './scusum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/scusum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusum = require( '@stdlib/blas/ext/base/scusum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusum( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusum = require( '@stdlib/blas/ext/base/scusum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusum.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusum = main;\n} else {\n\tscusum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n\n// exports: { \"ndarray\": \"scusum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumkbn2( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumkbn2( N, sum, x, strideX, y, strideY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\n\t\ty[ iy ] = float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\n\t\ty[ iy ] = float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumkbn2 = require( './scusumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/scusumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumkbn2( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumkbn2.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumkbn2 = main;\n} else {\n\tscusumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n\n// exports: { \"ndarray\": \"scusumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumors( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumors( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumors( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumors( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumors = require( './scusumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/scusumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumors = require( '@stdlib/blas/ext/base/scusumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumors( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumors = require( '@stdlib/blas/ext/base/scusumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumors.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumors = main;\n} else {\n\tscusumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n\n// exports: { \"ndarray\": \"scusumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation:\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumpw( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumpw( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tif ( N <= BLOCKSIZE ) {\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\ty[ iy ] = float64ToFloat32( sum + s );\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t\treturn y;\n\t}\n\tn = floor( N/2 );\n\tscusumpw( n, sum, x, strideX, ix, y, strideY, iy );\n\tiy += (n-1) * strideY;\n\tscusumpw( N-n, y[ iy ], x, strideX, ix+(n*strideX), y, strideY, iy+strideY ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cusum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumpw( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumpw( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\treturn cusum( N, sum, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumpw = require( './scusumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/scusumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumpw = require( '@stdlib/blas/ext/base/scusumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumpw( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumpw = require( '@stdlib/blas/ext/base/scusumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumpw.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumpw = main;\n} else {\n\tscusumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n\n// exports: { \"ndarray\": \"scusumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sdsapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sdsapxsumpw( n, alpha, x, stride, ix ) + sdsapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sdsapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsapxsumpw = require( './sdsapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation with extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsapxsumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsapxsumpw = main;\n} else {\n\tsdsapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n\n// exports: { \"ndarray\": \"sdsapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsapxsumpw = require( './../../../../ext/base/sdsapxsumpw' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sdsapxsum( N, alpha, x, stride ) {\n\treturn sdsapxsumpw( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsapxsumpw = require( './../../../../ext/base/sdsapxsumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sdsapxsum( N, alpha, x, stride, offset ) {\n\treturn sdsapxsumpw( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsapxsum = require( './sdsapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsapxsum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsapxsum = main;\n} else {\n\tsdsapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n\n// exports: { \"ndarray\": \"sdsapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdsnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sdsnansumpw( n, x, stride, ix ) + sdsnansumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdsnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsnansumpw = require( './sdsnansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsnansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsnansumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsnansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsnansumpw = main;\n} else {\n\tsdsnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n\n// exports: { \"ndarray\": \"sdsnansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsnansumpw = require( './../../../../ext/base/sdsnansumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdsnansum( N, x, stride ) {\n\treturn sdsnansumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsnansumpw = require( './../../../../ext/base/sdsnansumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdsnansum( N, x, stride, offset ) {\n\treturn sdsnansumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsnansum = require( './sdsnansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsnansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsnansum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsnansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsnansum = main;\n} else {\n\tsdsnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n\n// exports: { \"ndarray\": \"sdsnansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdssumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sdssumpw( n, x, stride, ix ) + sdssumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdssumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdssumpw = require( './sdssumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdssumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdssumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdssumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdssumpw = main;\n} else {\n\tsdssumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n\n// exports: { \"ndarray\": \"sdssumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdssumpw = require( './../../../../ext/base/sdssumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssum( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdssum( N, x, stride ) {\n\treturn sdssumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdssumpw = require( './../../../../ext/base/sdssumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdssum( N, x, stride, offset ) {\n\treturn sdssumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdssum = require( './sdssum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdssum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdssum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdssum = require( '@stdlib/blas/ext/base/sdssum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdssum = require( '@stdlib/blas/ext/base/sdssum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdssum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdssum = main;\n} else {\n\tsdssum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n\n// exports: { \"ndarray\": \"sdssum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a single-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction sfill( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] = alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] = alpha;\n\t\t\tx[ i+1 ] = alpha;\n\t\t\tx[ i+2 ] = alpha;\n\t\t\tx[ i+3 ] = alpha;\n\t\t\tx[ i+4 ] = alpha;\n\t\t\tx[ i+5 ] = alpha;\n\t\t\tx[ i+6 ] = alpha;\n\t\t\tx[ i+7 ] = alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a single-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* sfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction sfill( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sfill = require( './sfill.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sfill, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a single-precision floating-point strided array with a specified scalar constant.\n*\n* @module @stdlib/blas/ext/base/sfill\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sfill = require( '@stdlib/blas/ext/base/sfill' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sfill = require( '@stdlib/blas/ext/base/sfill' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sfill;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsfill = main;\n} else {\n\tsfill = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n\n// exports: { \"ndarray\": \"sfill.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumkbn = require( './snansumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/snansumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumkbn = main;\n} else {\n\tsnansumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n\n// exports: { \"ndarray\": \"snansumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar snansumkbn = require( './../../../../ext/base/snansumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansum( N, x, stride ) {\n\treturn snansumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar snansumkbn = require( './../../../../ext/base/snansumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansum( N, x, stride, offset ) {\n\treturn snansumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansum = require( './snansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/snansum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansum = require( '@stdlib/blas/ext/base/snansum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansum = require( '@stdlib/blas/ext/base/snansum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansum = main;\n} else {\n\tsnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n\n// exports: { \"ndarray\": \"snansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = float64ToFloat32( sum + v );\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = float64ToFloat32( cs + c );\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(cs-t) + c );\n\t\t\t} else {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(c-t) + cs );\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs = float64ToFloat32( ccs + cc );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs + ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = float64ToFloat32( sum + v );\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = float64ToFloat32( cs + c );\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(cs-t) + c );\n\t\t\t} else {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(c-t) + cs );\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs = float64ToFloat32( ccs + cc );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs + ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumkbn2 = require( './snansumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/snansumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumkbn2 = main;\n} else {\n\tsnansumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n\n// exports: { \"ndarray\": \"snansumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumors = require( './snansumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/snansumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumors = require( '@stdlib/blas/ext/base/snansumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumors = require( '@stdlib/blas/ext/base/snansumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumors = main;\n} else {\n\tsnansumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n\n// exports: { \"ndarray\": \"snansumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = ( isnanf( x[ ix ] ) ) ? s0 : float64ToFloat32( s0 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts1 = ( isnanf( x[ ix ] ) ) ? s1 : float64ToFloat32( s1 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts2 = ( isnanf( x[ ix ] ) ) ? s2 : float64ToFloat32( s2 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts3 = ( isnanf( x[ ix ] ) ) ? s3 : float64ToFloat32( s3 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts4 = ( isnanf( x[ ix ] ) ) ? s4 : float64ToFloat32( s4 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts5 = ( isnanf( x[ ix ] ) ) ? s5 : float64ToFloat32( s5 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts6 = ( isnanf( x[ ix ] ) ) ? s6 : float64ToFloat32( s6 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts7 = ( isnanf( x[ ix ] ) ) ? s7 : float64ToFloat32( s7 + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) ); // eslint-disable-line max-len\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( snansumpw( n, x, stride, ix ) + snansumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumpw = require( './snansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/snansumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumpw = require( '@stdlib/blas/ext/base/snansumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumpw = require( '@stdlib/blas/ext/base/snansumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumpw = main;\n} else {\n\tsnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n\n// exports: { \"ndarray\": \"snansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a single-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\nfunction srev( N, x, stride ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( ix = 0; ix < m; ix++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tiy -= 1;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( ix = m; ix < n; ix += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a single-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* srev( 3, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]\n*/\nfunction srev( N, x, stride, offset ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = ix + N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tix += stride;\n\t\t\t\tiy -= stride;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < n; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar srev = require( './srev.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( srev, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reverse a single-precision floating-point strided array in-place.\n*\n* @module @stdlib/blas/ext/base/srev\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var srev = require( '@stdlib/blas/ext/base/srev' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var srev = require( '@stdlib/blas/ext/base/srev' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1, 0 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar srev;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsrev = main;\n} else {\n\tsrev = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n\n// exports: { \"ndarray\": \"srev.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2hp( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnanf( v1 ) || ( v1 === tx && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2hp( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnanf( v1 ) || ( v1 === tx && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssort2hp = require( './ssort2hp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssort2hp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* @module @stdlib/blas/ext/base/ssort2hp\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssort2hp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssort2hp = main;\n} else {\n\tssort2hp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n\n// exports: { \"ndarray\": \"ssort2hp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2ins( N, order, x, strideX, y, strideY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideY < 0 ) {\n\t\tfy = (1-N) * strideY;\n\t\tly = 0;\n\t} else {\n\t\tfy = 0;\n\t\tly = (N-1) * strideY;\n\t}\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * strideX; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + strideX;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * strideX; // last index\n\tix = fx + strideX;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfx = offsetX; // first index\n\tlx = fx + ((N-1)*strideX); // last index\n\tix = fx + strideX;\n\n\tfy = offsetY; // first index\n\tly = fy + ((N-1)*strideY); // last index\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssort2ins = require( './ssort2ins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssort2ins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/ssort2ins\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssort2ins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssort2ins = main;\n} else {\n\tssort2ins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n\n// exports: { \"ndarray\": \"ssort2ins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2sh( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2sh( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssort2sh = require( './ssort2sh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssort2sh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/ssort2sh\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssort2sh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssort2sh = main;\n} else {\n\tssort2sh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n\n// exports: { \"ndarray\": \"ssort2sh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssorthp( N, order, x, stride ) {\n\tvar offset;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnanf( v1 ) || ( v1 === t && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssorthp( N, order, x, stride, offset ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnanf( v1 ) || ( v1 === t && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssorthp = require( './ssorthp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssorthp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a single-precision floating-point strided array using heapsort.\n*\n* @module @stdlib/blas/ext/base/ssorthp\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssorthp = require( '@stdlib/blas/ext/base/ssorthp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssorthp = require( '@stdlib/blas/ext/base/ssorthp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssorthp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssorthp = main;\n} else {\n\tssorthp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n\n// exports: { \"ndarray\": \"ssorthp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortins( N, order, x, stride ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * stride; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + stride;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * stride; // last index\n\tix = fx + stride;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortins( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfx = offset; // first index\n\tlx = fx + ((N-1)*stride); // last index\n\tix = fx + stride;\n\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssortins = require( './ssortins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssortins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a single-precision floating-point strided array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/ssortins\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortins = require( '@stdlib/blas/ext/base/ssortins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortins = require( '@stdlib/blas/ext/base/ssortins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssortins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssortins = main;\n} else {\n\tssortins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n\n// exports: { \"ndarray\": \"ssortins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortsh( N, order, x, stride ) {\n\tvar offset;\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortsh( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssortsh = require( './ssortsh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssortsh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a single-precision floating-point strided array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/ssortsh\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortsh = require( '@stdlib/blas/ext/base/ssortsh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortsh = require( '@stdlib/blas/ext/base/ssortsh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssortsh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssortsh = main;\n} else {\n\tssortsh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n\n// exports: { \"ndarray\": \"ssortsh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumkbn = require( './ssumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/ssumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumkbn = main;\n} else {\n\tssumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n\n// exports: { \"ndarray\": \"ssumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ssumkbn = require( './../../../../ext/base/ssumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssum( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssum( N, x, stride ) {\n\treturn ssumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ssumkbn = require( './../../../../ext/base/ssumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssum( N, x, stride, offset ) {\n\treturn ssumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssum = require( './ssum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/ssum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssum = require( '@stdlib/blas/ext/base/ssum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssum = require( '@stdlib/blas/ext/base/ssum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssum = main;\n} else {\n\tssum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n\n// exports: { \"ndarray\": \"ssum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumkbn2 = require( './ssumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/ssumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumkbn2 = main;\n} else {\n\tssumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n\n// exports: { \"ndarray\": \"ssumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumors = require( './ssumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/ssumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumors = require( '@stdlib/blas/ext/base/ssumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumors = require( '@stdlib/blas/ext/base/ssumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumors = main;\n} else {\n\tssumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n\n// exports: { \"ndarray\": \"ssumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = float64ToFloat32( s0 + x[ ix ] );\n\t\t\ts1 = float64ToFloat32( s1 + x[ ix+stride ] );\n\t\t\ts2 = float64ToFloat32( s2 + x[ ix+(2*stride) ] );\n\t\t\ts3 = float64ToFloat32( s3 + x[ ix+(3*stride) ] );\n\t\t\ts4 = float64ToFloat32( s4 + x[ ix+(4*stride) ] );\n\t\t\ts5 = float64ToFloat32( s5 + x[ ix+(5*stride) ] );\n\t\t\ts6 = float64ToFloat32( s6 + x[ ix+(6*stride) ] );\n\t\t\ts7 = float64ToFloat32( s7 + x[ ix+(7*stride) ] );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) ); // eslint-disable-line max-len\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( ssumpw( n, x, stride, ix ) + ssumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumpw = require( './ssumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/ssumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumpw = require( '@stdlib/blas/ext/base/ssumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumpw = require( '@stdlib/blas/ext/base/ssumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumpw = main;\n} else {\n\tssumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n\n// exports: { \"ndarray\": \"ssumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name dapx\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapx}\n*/\nsetReadOnly( ns, 'dapx', require( './../../../ext/base/dapx' ) );\n\n/**\n* @name dapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsum}\n*/\nsetReadOnly( ns, 'dapxsum', require( './../../../ext/base/dapxsum' ) );\n\n/**\n* @name dapxsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumkbn}\n*/\nsetReadOnly( ns, 'dapxsumkbn', require( './../../../ext/base/dapxsumkbn' ) );\n\n/**\n* @name dapxsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumkbn2}\n*/\nsetReadOnly( ns, 'dapxsumkbn2', require( './../../../ext/base/dapxsumkbn2' ) );\n\n/**\n* @name dapxsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumors}\n*/\nsetReadOnly( ns, 'dapxsumors', require( './../../../ext/base/dapxsumors' ) );\n\n/**\n* @name dapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumpw}\n*/\nsetReadOnly( ns, 'dapxsumpw', require( './../../../ext/base/dapxsumpw' ) );\n\n/**\n* @name dasumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dasumpw}\n*/\nsetReadOnly( ns, 'dasumpw', require( './../../../ext/base/dasumpw' ) );\n\n/**\n* @name dcusum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusum}\n*/\nsetReadOnly( ns, 'dcusum', require( './../../../ext/base/dcusum' ) );\n\n/**\n* @name dcusumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumkbn}\n*/\nsetReadOnly( ns, 'dcusumkbn', require( './../../../ext/base/dcusumkbn' ) );\n\n/**\n* @name dcusumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumkbn2}\n*/\nsetReadOnly( ns, 'dcusumkbn2', require( './../../../ext/base/dcusumkbn2' ) );\n\n/**\n* @name dcusumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumors}\n*/\nsetReadOnly( ns, 'dcusumors', require( './../../../ext/base/dcusumors' ) );\n\n/**\n* @name dcusumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumpw}\n*/\nsetReadOnly( ns, 'dcusumpw', require( './../../../ext/base/dcusumpw' ) );\n\n/**\n* @name dfill\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dfill}\n*/\nsetReadOnly( ns, 'dfill', require( './../../../ext/base/dfill' ) );\n\n/**\n* @name dnanasum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnanasum}\n*/\nsetReadOnly( ns, 'dnanasum', require( './../../../ext/base/dnanasum' ) );\n\n/**\n* @name dnanasumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnanasumors}\n*/\nsetReadOnly( ns, 'dnanasumors', require( './../../../ext/base/dnanasumors' ) );\n\n/**\n* @name dnannsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsum}\n*/\nsetReadOnly( ns, 'dnannsum', require( './../../../ext/base/dnannsum' ) );\n\n/**\n* @name dnannsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumkbn}\n*/\nsetReadOnly( ns, 'dnannsumkbn', require( './../../../ext/base/dnannsumkbn' ) );\n\n/**\n* @name dnannsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumkbn2}\n*/\nsetReadOnly( ns, 'dnannsumkbn2', require( './../../../ext/base/dnannsumkbn2' ) );\n\n/**\n* @name dnannsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumors}\n*/\nsetReadOnly( ns, 'dnannsumors', require( './../../../ext/base/dnannsumors' ) );\n\n/**\n* @name dnannsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumpw}\n*/\nsetReadOnly( ns, 'dnannsumpw', require( './../../../ext/base/dnannsumpw' ) );\n\n/**\n* @name dnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansum}\n*/\nsetReadOnly( ns, 'dnansum', require( './../../../ext/base/dnansum' ) );\n\n/**\n* @name dnansumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumkbn}\n*/\nsetReadOnly( ns, 'dnansumkbn', require( './../../../ext/base/dnansumkbn' ) );\n\n/**\n* @name dnansumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumkbn2}\n*/\nsetReadOnly( ns, 'dnansumkbn2', require( './../../../ext/base/dnansumkbn2' ) );\n\n/**\n* @name dnansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumors}\n*/\nsetReadOnly( ns, 'dnansumors', require( './../../../ext/base/dnansumors' ) );\n\n/**\n* @name dnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumpw}\n*/\nsetReadOnly( ns, 'dnansumpw', require( './../../../ext/base/dnansumpw' ) );\n\n/**\n* @name drev\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/drev}\n*/\nsetReadOnly( ns, 'drev', require( './../../../ext/base/drev' ) );\n\n/**\n* @name dsapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsapxsum}\n*/\nsetReadOnly( ns, 'dsapxsum', require( './../../../ext/base/dsapxsum' ) );\n\n/**\n* @name dsapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsapxsumpw}\n*/\nsetReadOnly( ns, 'dsapxsumpw', require( './../../../ext/base/dsapxsumpw' ) );\n\n/**\n* @name dsnannsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnannsumors}\n*/\nsetReadOnly( ns, 'dsnannsumors', require( './../../../ext/base/dsnannsumors' ) );\n\n/**\n* @name dsnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnansum}\n*/\nsetReadOnly( ns, 'dsnansum', require( './../../../ext/base/dsnansum' ) );\n\n/**\n* @name dsnansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnansumors}\n*/\nsetReadOnly( ns, 'dsnansumors', require( './../../../ext/base/dsnansumors' ) );\n\n/**\n* @name dsnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnansumpw}\n*/\nsetReadOnly( ns, 'dsnansumpw', require( './../../../ext/base/dsnansumpw' ) );\n\n/**\n* @name dsort2hp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsort2hp}\n*/\nsetReadOnly( ns, 'dsort2hp', require( './../../../ext/base/dsort2hp' ) );\n\n/**\n* @name dsort2ins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsort2ins}\n*/\nsetReadOnly( ns, 'dsort2ins', require( './../../../ext/base/dsort2ins' ) );\n\n/**\n* @name dsort2sh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsort2sh}\n*/\nsetReadOnly( ns, 'dsort2sh', require( './../../../ext/base/dsort2sh' ) );\n\n/**\n* @name dsorthp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsorthp}\n*/\nsetReadOnly( ns, 'dsorthp', require( './../../../ext/base/dsorthp' ) );\n\n/**\n* @name dsortins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsortins}\n*/\nsetReadOnly( ns, 'dsortins', require( './../../../ext/base/dsortins' ) );\n\n/**\n* @name dsortsh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsortsh}\n*/\nsetReadOnly( ns, 'dsortsh', require( './../../../ext/base/dsortsh' ) );\n\n/**\n* @name dssum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dssum}\n*/\nsetReadOnly( ns, 'dssum', require( './../../../ext/base/dssum' ) );\n\n/**\n* @name dssumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dssumors}\n*/\nsetReadOnly( ns, 'dssumors', require( './../../../ext/base/dssumors' ) );\n\n/**\n* @name dssumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dssumpw}\n*/\nsetReadOnly( ns, 'dssumpw', require( './../../../ext/base/dssumpw' ) );\n\n/**\n* @name dsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsum}\n*/\nsetReadOnly( ns, 'dsum', require( './../../../ext/base/dsum' ) );\n\n/**\n* @name dsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumkbn}\n*/\nsetReadOnly( ns, 'dsumkbn', require( './../../../ext/base/dsumkbn' ) );\n\n/**\n* @name dsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumkbn2}\n*/\nsetReadOnly( ns, 'dsumkbn2', require( './../../../ext/base/dsumkbn2' ) );\n\n/**\n* @name dsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumors}\n*/\nsetReadOnly( ns, 'dsumors', require( './../../../ext/base/dsumors' ) );\n\n/**\n* @name dsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumpw}\n*/\nsetReadOnly( ns, 'dsumpw', require( './../../../ext/base/dsumpw' ) );\n\n/**\n* @name gapx\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapx}\n*/\nsetReadOnly( ns, 'gapx', require( './../../../ext/base/gapx' ) );\n\n/**\n* @name gapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsum}\n*/\nsetReadOnly( ns, 'gapxsum', require( './../../../ext/base/gapxsum' ) );\n\n/**\n* @name gapxsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumkbn}\n*/\nsetReadOnly( ns, 'gapxsumkbn', require( './../../../ext/base/gapxsumkbn' ) );\n\n/**\n* @name gapxsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumkbn2}\n*/\nsetReadOnly( ns, 'gapxsumkbn2', require( './../../../ext/base/gapxsumkbn2' ) );\n\n/**\n* @name gapxsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumors}\n*/\nsetReadOnly( ns, 'gapxsumors', require( './../../../ext/base/gapxsumors' ) );\n\n/**\n* @name gapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumpw}\n*/\nsetReadOnly( ns, 'gapxsumpw', require( './../../../ext/base/gapxsumpw' ) );\n\n/**\n* @name gasumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gasumpw}\n*/\nsetReadOnly( ns, 'gasumpw', require( './../../../ext/base/gasumpw' ) );\n\n/**\n* @name gcusum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusum}\n*/\nsetReadOnly( ns, 'gcusum', require( './../../../ext/base/gcusum' ) );\n\n/**\n* @name gcusumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumkbn}\n*/\nsetReadOnly( ns, 'gcusumkbn', require( './../../../ext/base/gcusumkbn' ) );\n\n/**\n* @name gcusumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumkbn2}\n*/\nsetReadOnly( ns, 'gcusumkbn2', require( './../../../ext/base/gcusumkbn2' ) );\n\n/**\n* @name gcusumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumors}\n*/\nsetReadOnly( ns, 'gcusumors', require( './../../../ext/base/gcusumors' ) );\n\n/**\n* @name gcusumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumpw}\n*/\nsetReadOnly( ns, 'gcusumpw', require( './../../../ext/base/gcusumpw' ) );\n\n/**\n* @name gfill\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gfill}\n*/\nsetReadOnly( ns, 'gfill', require( './../../../ext/base/gfill' ) );\n\n/**\n* @name gfillBy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gfill-by}\n*/\nsetReadOnly( ns, 'gfillBy', require( './../../../ext/base/gfill-by' ) );\n\n/**\n* @name gnannsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnannsumkbn}\n*/\nsetReadOnly( ns, 'gnannsumkbn', require( './../../../ext/base/gnannsumkbn' ) );\n\n/**\n* @name gnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansum}\n*/\nsetReadOnly( ns, 'gnansum', require( './../../../ext/base/gnansum' ) );\n\n/**\n* @name gnansumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumkbn}\n*/\nsetReadOnly( ns, 'gnansumkbn', require( './../../../ext/base/gnansumkbn' ) );\n\n/**\n* @name gnansumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumkbn2}\n*/\nsetReadOnly( ns, 'gnansumkbn2', require( './../../../ext/base/gnansumkbn2' ) );\n\n/**\n* @name gnansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumors}\n*/\nsetReadOnly( ns, 'gnansumors', require( './../../../ext/base/gnansumors' ) );\n\n/**\n* @name gnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumpw}\n*/\nsetReadOnly( ns, 'gnansumpw', require( './../../../ext/base/gnansumpw' ) );\n\n/**\n* @name grev\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/grev}\n*/\nsetReadOnly( ns, 'grev', require( './../../../ext/base/grev' ) );\n\n/**\n* @name gsort2hp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsort2hp}\n*/\nsetReadOnly( ns, 'gsort2hp', require( './../../../ext/base/gsort2hp' ) );\n\n/**\n* @name gsort2ins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsort2ins}\n*/\nsetReadOnly( ns, 'gsort2ins', require( './../../../ext/base/gsort2ins' ) );\n\n/**\n* @name gsort2sh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsort2sh}\n*/\nsetReadOnly( ns, 'gsort2sh', require( './../../../ext/base/gsort2sh' ) );\n\n/**\n* @name gsorthp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsorthp}\n*/\nsetReadOnly( ns, 'gsorthp', require( './../../../ext/base/gsorthp' ) );\n\n/**\n* @name gsortins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsortins}\n*/\nsetReadOnly( ns, 'gsortins', require( './../../../ext/base/gsortins' ) );\n\n/**\n* @name gsortsh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsortsh}\n*/\nsetReadOnly( ns, 'gsortsh', require( './../../../ext/base/gsortsh' ) );\n\n/**\n* @name gsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsum}\n*/\nsetReadOnly( ns, 'gsum', require( './../../../ext/base/gsum' ) );\n\n/**\n* @name gsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumkbn}\n*/\nsetReadOnly( ns, 'gsumkbn', require( './../../../ext/base/gsumkbn' ) );\n\n/**\n* @name gsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumkbn2}\n*/\nsetReadOnly( ns, 'gsumkbn2', require( './../../../ext/base/gsumkbn2' ) );\n\n/**\n* @name gsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumors}\n*/\nsetReadOnly( ns, 'gsumors', require( './../../../ext/base/gsumors' ) );\n\n/**\n* @name gsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumpw}\n*/\nsetReadOnly( ns, 'gsumpw', require( './../../../ext/base/gsumpw' ) );\n\n/**\n* @name sapx\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapx}\n*/\nsetReadOnly( ns, 'sapx', require( './../../../ext/base/sapx' ) );\n\n/**\n* @name sapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsum}\n*/\nsetReadOnly( ns, 'sapxsum', require( './../../../ext/base/sapxsum' ) );\n\n/**\n* @name sapxsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumkbn}\n*/\nsetReadOnly( ns, 'sapxsumkbn', require( './../../../ext/base/sapxsumkbn' ) );\n\n/**\n* @name sapxsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumkbn2}\n*/\nsetReadOnly( ns, 'sapxsumkbn2', require( './../../../ext/base/sapxsumkbn2' ) );\n\n/**\n* @name sapxsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumors}\n*/\nsetReadOnly( ns, 'sapxsumors', require( './../../../ext/base/sapxsumors' ) );\n\n/**\n* @name sapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumpw}\n*/\nsetReadOnly( ns, 'sapxsumpw', require( './../../../ext/base/sapxsumpw' ) );\n\n/**\n* @name sasumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sasumpw}\n*/\nsetReadOnly( ns, 'sasumpw', require( './../../../ext/base/sasumpw' ) );\n\n/**\n* @name scusum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusum}\n*/\nsetReadOnly( ns, 'scusum', require( './../../../ext/base/scusum' ) );\n\n/**\n* @name scusumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumkbn}\n*/\nsetReadOnly( ns, 'scusumkbn', require( './../../../ext/base/scusumkbn' ) );\n\n/**\n* @name scusumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumkbn2}\n*/\nsetReadOnly( ns, 'scusumkbn2', require( './../../../ext/base/scusumkbn2' ) );\n\n/**\n* @name scusumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumors}\n*/\nsetReadOnly( ns, 'scusumors', require( './../../../ext/base/scusumors' ) );\n\n/**\n* @name scusumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumpw}\n*/\nsetReadOnly( ns, 'scusumpw', require( './../../../ext/base/scusumpw' ) );\n\n/**\n* @name sdsapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsapxsum}\n*/\nsetReadOnly( ns, 'sdsapxsum', require( './../../../ext/base/sdsapxsum' ) );\n\n/**\n* @name sdsapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsapxsumpw}\n*/\nsetReadOnly( ns, 'sdsapxsumpw', require( './../../../ext/base/sdsapxsumpw' ) );\n\n/**\n* @name sdsnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsnansum}\n*/\nsetReadOnly( ns, 'sdsnansum', require( './../../../ext/base/sdsnansum' ) );\n\n/**\n* @name sdsnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsnansumpw}\n*/\nsetReadOnly( ns, 'sdsnansumpw', require( './../../../ext/base/sdsnansumpw' ) );\n\n/**\n* @name sdssum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdssum}\n*/\nsetReadOnly( ns, 'sdssum', require( './../../../ext/base/sdssum' ) );\n\n/**\n* @name sdssumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdssumpw}\n*/\nsetReadOnly( ns, 'sdssumpw', require( './../../../ext/base/sdssumpw' ) );\n\n/**\n* @name sfill\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sfill}\n*/\nsetReadOnly( ns, 'sfill', require( './../../../ext/base/sfill' ) );\n\n/**\n* @name snansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansum}\n*/\nsetReadOnly( ns, 'snansum', require( './../../../ext/base/snansum' ) );\n\n/**\n* @name snansumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumkbn}\n*/\nsetReadOnly( ns, 'snansumkbn', require( './../../../ext/base/snansumkbn' ) );\n\n/**\n* @name snansumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumkbn2}\n*/\nsetReadOnly( ns, 'snansumkbn2', require( './../../../ext/base/snansumkbn2' ) );\n\n/**\n* @name snansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumors}\n*/\nsetReadOnly( ns, 'snansumors', require( './../../../ext/base/snansumors' ) );\n\n/**\n* @name snansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumpw}\n*/\nsetReadOnly( ns, 'snansumpw', require( './../../../ext/base/snansumpw' ) );\n\n/**\n* @name srev\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/srev}\n*/\nsetReadOnly( ns, 'srev', require( './../../../ext/base/srev' ) );\n\n/**\n* @name ssort2hp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssort2hp}\n*/\nsetReadOnly( ns, 'ssort2hp', require( './../../../ext/base/ssort2hp' ) );\n\n/**\n* @name ssort2ins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssort2ins}\n*/\nsetReadOnly( ns, 'ssort2ins', require( './../../../ext/base/ssort2ins' ) );\n\n/**\n* @name ssort2sh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssort2sh}\n*/\nsetReadOnly( ns, 'ssort2sh', require( './../../../ext/base/ssort2sh' ) );\n\n/**\n* @name ssorthp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssorthp}\n*/\nsetReadOnly( ns, 'ssorthp', require( './../../../ext/base/ssorthp' ) );\n\n/**\n* @name ssortins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssortins}\n*/\nsetReadOnly( ns, 'ssortins', require( './../../../ext/base/ssortins' ) );\n\n/**\n* @name ssortsh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssortsh}\n*/\nsetReadOnly( ns, 'ssortsh', require( './../../../ext/base/ssortsh' ) );\n\n/**\n* @name ssum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssum}\n*/\nsetReadOnly( ns, 'ssum', require( './../../../ext/base/ssum' ) );\n\n/**\n* @name ssumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumkbn}\n*/\nsetReadOnly( ns, 'ssumkbn', require( './../../../ext/base/ssumkbn' ) );\n\n/**\n* @name ssumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumkbn2}\n*/\nsetReadOnly( ns, 'ssumkbn2', require( './../../../ext/base/ssumkbn2' ) );\n\n/**\n* @name ssumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumors}\n*/\nsetReadOnly( ns, 'ssumors', require( './../../../ext/base/ssumors' ) );\n\n/**\n* @name ssumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumpw}\n*/\nsetReadOnly( ns, 'ssumpw', require( './../../../ext/base/ssumpw' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/blas/ext/base}\n*/\nsetReadOnly( ns, 'base', require( './../../ext/base' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFloat64Array = require( '@stdlib/assert/is-float64array' );\nvar isFloat32Array = require( '@stdlib/assert/is-float32array' );\nvar format = require( '@stdlib/string/format' );\nvar ddot = require( './../../base/ddot' ).ndarray;\nvar sdot = require( './../../base/sdot' ).ndarray;\nvar dot = require( './../../base/gdot' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of vectors `x` and `y`.\n*\n* ## Notes\n*\n* - In general, for best performance, especially for large vectors, provide 1-dimensional `ndarrays` whose underlying data type is either `float64` or `float32`.\n*\n* @param {(Collection|VectorLike)} x - first input array\n* @param {(Collection|VectorLike)} y - second input array\n* @throws {TypeError} first argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {TypeError} second argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {RangeError} input arrays must be the same length\n* @returns {number} dot product\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot( x, y );\n* // returns -5.0\n*/\nfunction gdot( x, y ) {\n\tvar isxf64;\n\tvar isxf32;\n\tvar isyf64;\n\tvar isyf32;\n\tvar isxa;\n\tvar isxv;\n\tvar isya;\n\tvar isyv;\n\n\tisxa = isndarrayLike( x );\n\tisya = isndarrayLike( y );\n\tisxv = isxa && x.ndims === 1 && x.strides.length === 1; // is ndarray-like vector?\n\tisyv = isya && y.ndims === 1 && y.strides.length === 1; // is ndarray-like vector?\n\tif ( isxv ) {\n\t\tisxf64 = isFloat64Array( x.data );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x.data );\n\t} else if ( isxa === false && isCollection( x ) ) {\n\t\tisxf64 = isFloat64Array( x );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', x ) );\n\t}\n\tif ( isyv ) {\n\t\tisyf64 = isFloat64Array( y.data );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y.data );\n\t} else if ( isya === false && isCollection( y ) ) {\n\t\tisyf64 = isFloat64Array( y );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tif ( isxv && isyv ) {\n\t\tif ( isxf64 && isyf64 ) {\n\t\t\treturn ddot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t}\n\t\tif ( isxf32 && isyf32 ) {\n\t\t\treturn sdot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t}\n\tif ( isxv ) {\n\t\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y, 1, 0 );\n\t}\n\tif ( isyv ) {\n\t\treturn dot( x.length, x, 1, 0, y.data, y.strides[ 0 ], y.offset );\n\t}\n\treturn dot( x.length, x, 1, 0, y, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two vectors.\n*\n* @module @stdlib/blas/gdot\n*\n* @example\n* var gdot = require( '@stdlib/blas/gdot' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot( x, y );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFloat64Array = require( '@stdlib/assert/is-float64array' );\nvar isFloat32Array = require( '@stdlib/assert/is-float32array' );\nvar format = require( '@stdlib/string/format' );\nvar dswap = require( './../../base/dswap' ).ndarray;\nvar sswap = require( './../../base/sswap' ).ndarray;\nvar swap = require( './../../base/gswap' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Interchanges two vectors.\n*\n* ## Notes\n*\n* - In general, for best performance, especially for large vectors, provide 1-dimensional `ndarrays` whose underlying data type is either `float64` or `float32`.\n*\n* @param {(Collection|VectorLike)} x - first input array\n* @param {(Collection|VectorLike)} y - second input array\n* @throws {TypeError} first argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {TypeError} second argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {RangeError} input arrays must be the same length\n* @returns {(Collection|VectorLike)} `y`\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* gswap( x, y );\n* // x => [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n* // y => [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction gswap( x, y ) {\n\tvar isxf64;\n\tvar isxf32;\n\tvar isyf64;\n\tvar isyf32;\n\tvar isxa;\n\tvar isxv;\n\tvar isya;\n\tvar isyv;\n\n\tisxa = isndarrayLike( x );\n\tisya = isndarrayLike( y );\n\tisxv = isxa && x.ndims === 1 && x.strides.length === 1; // is ndarray-like vector?\n\tisyv = isya && y.ndims === 1 && y.strides.length === 1; // is ndarray-like vector?\n\tif ( isxv ) {\n\t\tisxf64 = isFloat64Array( x.data );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x.data );\n\t} else if ( isxa === false && isCollection( x ) ) {\n\t\tisxf64 = isFloat64Array( x );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', x ) );\n\t}\n\tif ( isyv ) {\n\t\tisyf64 = isFloat64Array( y.data );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y.data );\n\t} else if ( isya === false && isCollection( y ) ) {\n\t\tisyf64 = isFloat64Array( y );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tif ( isxv && isyv ) {\n\t\tif ( isxf64 && isyf64 ) {\n\t\t\tdswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t\treturn y;\n\t\t}\n\t\tif ( isxf32 && isyf32 ) {\n\t\t\tsswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t\treturn y;\n\t\t}\n\t\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\treturn y;\n\t}\n\tif ( isxv ) {\n\t\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y, 1, 0 );\n\t\treturn y;\n\t}\n\tif ( isyv ) {\n\t\tswap( x.length, x, 1, 0, y.data, y.strides[ 0 ], y.offset );\n\t\treturn y;\n\t}\n\tswap( x.length, x, 1, 0, y, 1, 0 );\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two vectors.\n*\n* @module @stdlib/blas/gswap\n*\n* @example\n* var gswap = require( '@stdlib/blas/gswap' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* gswap( x, y );\n* // x => [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n* // y => [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' );\nvar dot = require( './../../base/sdot' ).ndarray;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two single-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = sdot( x, y );\n* // returns -5.0\n*/\nfunction sdot( x, y ) {\n\tif ( !isFloat32VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat32VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/sdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n* var sdot = require( '@stdlib/blas/sdot' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = sdot( x, y );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' );\nvar format = require( '@stdlib/string/format' );\nvar swap = require( './../../base/sswap' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Interchanges two single-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {VectorLike} `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* sswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction sswap( x, y ) {\n\tif ( !isFloat32VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat32VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/sswap\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n* var sswap = require( '@stdlib/blas/sswap' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* sswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/blas/base}\n*/\nsetReadOnly( ns, 'base', require( './../base' ) );\n\n/**\n* @name ddot\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ddot}\n*/\nsetReadOnly( ns, 'ddot', require( './../ddot' ) );\n\n/**\n* @name dswap\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/dswap}\n*/\nsetReadOnly( ns, 'dswap', require( './../dswap' ) );\n\n/**\n* @name ext\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/blas/ext}\n*/\nsetReadOnly( ns, 'ext', require( './../ext' ) );\n\n/**\n* @name gdot\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/gdot}\n*/\nsetReadOnly( ns, 'gdot', require( './../gdot' ) );\n\n/**\n* @name gswap\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/gswap}\n*/\nsetReadOnly( ns, 'gswap', require( './../gswap' ) );\n\n/**\n* @name sdot\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/sdot}\n*/\nsetReadOnly( ns, 'sdot', require( './../sdot' ) );\n\n/**\n* @name sswap\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/sswap}\n*/\nsetReadOnly( ns, 'sswap', require( './../sswap' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"], - "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,GAAAC,GAAA,cAsBA,IAAIC,GAAc,QAAS,4CAA6C,EAkCxE,SAASC,GAAOC,EAAGC,EAAGC,EAASC,EAAGC,EAAU,CAC3C,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,GAAKX,GAAK,EACT,OAAOG,EAIR,GAFAE,EAAQP,GAAaG,EAAG,CAAE,EAC1BK,EAAQR,GAAaK,EAAG,CAAE,EACrBD,IAAY,GAAKE,IAAY,EAAI,CACrC,IAAMO,EAAI,EAAGA,EAAIX,EAAE,EAAGW,GAAK,EAC1BL,EAAOK,CAAE,EAAIN,EAAOM,CAAE,EACtBL,EAAOK,EAAE,CAAE,EAAIN,EAAOM,EAAE,CAAE,EAE3B,OAAOR,CACR,CAaA,IAZKD,EAAU,EACdO,EAAK,GAAK,EAAET,GAAKE,EAEjBO,EAAK,EAEDL,EAAU,EACdM,EAAK,GAAK,EAAEV,GAAKI,EAEjBM,EAAK,EAENH,EAAKL,EAAU,EACfM,EAAKJ,EAAU,EACTO,EAAI,EAAGA,EAAIX,EAAGW,IACnBL,EAAOI,CAAG,EAAIL,EAAOI,CAAG,EACxBH,EAAOI,EAAG,CAAE,EAAIL,EAAOI,EAAG,CAAE,EAC5BA,GAAMF,EACNG,GAAMF,EAEP,OAAOL,CACR,CAKAN,GAAO,QAAUE,K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cesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} output array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nfunction ccopy( N, x, strideX, y, strideY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tfor ( i = 0; i < N*2; i += 2 ) {\n\t\t\tviewY[ i ] = viewX[ i ];\n\t\t\tviewY[ i+1 ] = viewX[ i+1 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = 2 * (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = 2 * (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tviewY[ iy ] = viewX[ ix ];\n\t\tviewY[ iy+1 ] = viewX[ ix+1 ];\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Copies values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Complex64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Complex64Array} output array\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nfunction ccopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tix = offsetX * 2;\n\tiy = offsetY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tviewY[ iy ] = viewX[ ix ];\n\t\tviewY[ iy+1 ] = viewX[ ix+1 ];\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ccopy = require( './ccopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ccopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.\n*\n* @module @stdlib/blas/base/ccopy\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var ccopy = require( '@stdlib/blas/base/ccopy' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var ccopy = require( '@stdlib/blas/base/ccopy' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ccopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tccopy = main;\n} else {\n\tccopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ccopy;\n\n// exports: { \"ndarray\": \"ccopy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Complex64Array} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\nfunction cswap( N, x, strideX, y, strideY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar tmp;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\tvar j;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tfor ( i = 0; i < N*2; i += 2 ) {\n\t\t\ttmp = viewX[ i ];\n\t\t\tviewX[ i ] = viewY[ i ];\n\t\t\tviewY[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = viewX[ j ];\n\t\t\tviewX[ j ] = viewY[ j ];\n\t\t\tviewY[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = 2 * (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = 2 * (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = viewX[ ix ];\n\t\tviewX[ ix ] = viewY[ iy ];\n\t\tviewY[ iy ] = tmp;\n\n\t\ttmp = viewX[ ix+1 ];\n\t\tviewX[ ix+1 ] = viewY[ iy+1 ];\n\t\tviewY[ iy+1 ] = tmp;\n\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar reinterpret = require( '@stdlib/strided/base/reinterpret-complex64' );\n\n\n// MAIN //\n\n/**\n* Interchanges two complex single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Complex64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Complex64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Complex64Array} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\nfunction cswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar viewX;\n\tvar viewY;\n\tvar tmp;\n\tvar sx;\n\tvar sy;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tviewX = reinterpret( x, 0 );\n\tviewY = reinterpret( y, 0 );\n\tsx = strideX * 2;\n\tsy = strideY * 2;\n\tix = offsetX * 2;\n\tiy = offsetY * 2;\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = viewX[ ix ];\n\t\tviewX[ ix ] = viewY[ iy ];\n\t\tviewY[ iy ] = tmp;\n\n\t\ttmp = viewX[ ix+1 ];\n\t\tviewX[ ix+1 ] = viewY[ iy+1 ];\n\t\tviewY[ iy+1 ] = tmp;\n\n\t\tix += sx;\n\t\tiy += sy;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar cswap = require( './cswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( cswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two complex single-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/cswap\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cswap = require( '@stdlib/blas/base/cswap' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap( x.length, x, 1, y, 1 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var realf = require( '@stdlib/complex/realf' );\n* var imagf = require( '@stdlib/complex/imagf' );\n* var cswap = require( '@stdlib/blas/base/cswap' );\n*\n* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n* var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* cswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n*\n* var z = y.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*\n* z = x.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 7.0\n*\n* im = imagf( z );\n* // returns 8.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar cswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tcswap = main;\n} else {\n\tcswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cswap;\n\n// exports: { \"ndarray\": \"cswap.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {PositiveInteger} stride - `x` stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum( x.length, x, 1 );\n* // returns 15.0\n*/\nfunction dasum( N, x, stride ) {\n\tvar sum;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn sum;\n\t}\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[i] );\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs(x[i]) + abs(x[i+1]) + abs(x[i+2]) + abs(x[i+3]) + abs(x[i+4]) + abs(x[i+5]); // eslint-disable-line max-len\n\t\t}\n\t\treturn sum;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tsum += abs( x[i] );\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - `x` stride length\n* @param {NonNegativeInteger} offset - starting `x` index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum( x.length, x, 1, 0 );\n* // returns 15.0\n*/\nfunction dasum( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tix = offset;\n\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[ix] );\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs( x[ix] ) + abs( x[ix+1] ) + abs( x[ix+2] ) + abs( x[ix+3] ) + abs( x[ix+4] ) + abs( x[ix+5] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += abs( x[ix] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dasum = require( './dasum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dasum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the sum of absolute values.\n*\n* @module @stdlib/blas/base/dasum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dasum = require( '@stdlib/blas/base/dasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum( x.length, x, 1 );\n* // returns 15.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dasum = require( '@stdlib/blas/base/dasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = dasum.ndarray( x.length, x, 1, 0 );\n* // returns 15.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dasum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdasum = main;\n} else {\n\tdasum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasum;\n\n// exports: { \"ndarray\": \"dasum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction daxpy( N, alpha, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\ty[ i+1 ] += alpha * x[ i+1 ];\n\t\t\ty[ i+2 ] += alpha * x[ i+2 ];\n\t\t\ty[ i+3 ] += alpha * x[ i+3 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction daxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\ty[ iy+1 ] += alpha * x[ ix+1 ];\n\t\t\ty[ iy+2 ] += alpha * x[ ix+2 ];\n\t\t\ty[ iy+3 ] += alpha * x[ ix+3 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar daxpy = require( './daxpy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( daxpy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a vector `x` and a constant and add the result to `y`.\n*\n* @module @stdlib/blas/base/daxpy\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var daxpy = require( '@stdlib/blas/base/daxpy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var daxpy = require( '@stdlib/blas/base/daxpy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* daxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar daxpy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdaxpy = main;\n} else {\n\tdaxpy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = daxpy;\n\n// exports: { \"ndarray\": \"daxpy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dcopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcopy = require( './dcopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas/base/dcopy\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcopy = require( '@stdlib/blas/base/dcopy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcopy = require( '@stdlib/blas/base/dcopy' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcopy = main;\n} else {\n\tdcopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcopy;\n\n// exports: { \"ndarray\": \"dcopy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction ddot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ i ] * y[ i ] ) + ( x[ i+1 ] * y[ i+1 ] ) + ( x[ i+2 ] * y[ i+2 ] ) + ( x[ i+3 ] * y[ i+3 ] ) + ( x[ i+4 ] * y[ i+4 ] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {integer} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction ddot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ ix ] * y[ iy ] ) + ( x[ ix+1 ] * y[ iy+1 ] ) + ( x[ ix+2 ] * y[ iy+2 ] ) + ( x[ ix+3 ] * y[ iy+3 ] ) + ( x[ ix+4 ] * y[ iy+4 ] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn dot;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ddot = require( './ddot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ddot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/ddot\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var ddot = require( '@stdlib/blas/base/ddot' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var ddot = require( '@stdlib/blas/base/ddot' );\n*\n* var x = new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = ddot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ddot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tddot = main;\n} else {\n\tddot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n\n// exports: { \"ndarray\": \"ddot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a double-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {number} L2-norm\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n*\n* var out = dnrm2( 3, x, 1 );\n* // returns 3.0\n*/\nfunction dnrm2( N, x, stride ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tscale = 0.0;\n\tssq = 1.0;\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tif ( x[ i ] !== 0.0 ) {\n\t\t\tax = abs( x[ i ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a double-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} L2-norm\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var out = dnrm2( 4, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnrm2( N, x, stride, offset ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tscale = 0.0;\n\tssq = 1.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( x[ ix ] !== 0.0 ) {\n\t\t\tax = abs( x[ ix ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t\tix += stride;\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnrm2 = require( './dnrm2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnrm2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the L2-norm of a double-precision floating-point vector.\n*\n* @module @stdlib/blas/base/dnrm2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnrm2 = require( '@stdlib/blas/base/dnrm2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n*\n* var out = dnrm2( 3, x, 1 );\n* // returns 3.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnrm2 = require( '@stdlib/blas/base/dnrm2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var out = dnrm2.ndarray( 4, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnrm2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnrm2 = main;\n} else {\n\tdnrm2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnrm2;\n\n// exports: { \"ndarray\": \"dnrm2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {PositiveInteger} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction dscal( N, alpha, x, stride ) {\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || stride <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] *= alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tx[ i ] *= alpha;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* dscal( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction dscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] *= alpha;\n\t\t\tx[ ix+1 ] *= alpha;\n\t\t\tx[ ix+2 ] *= alpha;\n\t\t\tx[ ix+3 ] *= alpha;\n\t\t\tx[ ix+4 ] *= alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dscal = require( './dscal.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dscal, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a double-precision floating-point vector by a constant.\n*\n* @module @stdlib/blas/base/dscal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dscal = require( '@stdlib/blas/base/dscal' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dscal = require( '@stdlib/blas/base/dscal' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dscal;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdscal = main;\n} else {\n\tdscal = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dscal;\n\n// exports: { \"ndarray\": \"dscal.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y` with extended accumulation and result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction dsdot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[i]*y[i] ) + ( x[i+1]*y[i+1] ) + ( x[i+2]*y[i+2] ) + ( x[i+3]*y[i+3] ) + ( x[i+4]*y[i+4] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y` with extended accumulation and result.\n*\n* @param {integer} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction dsdot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ ix ] * y[ iy ];\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ix]*y[iy] ) + ( x[ix+1]*y[iy+1] ) + ( x[ix+2]*y[iy+2] ) + ( x[ix+3]*y[iy+3] ) + ( x[ix+4]*y[iy+4] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn dot;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsdot = require( './dsdot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsdot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of vectors `x` and `y` with extended accumulation and result.\n*\n* @module @stdlib/blas/base/dsdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsdot = require( '@stdlib/blas/base/dsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot( x.length, x, 1, y, 1 );\n* // returns -12.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsdot = require( '@stdlib/blas/base/dsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = dsdot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -12.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsdot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsdot = main;\n} else {\n\tdsdot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsdot;\n\n// exports: { \"ndarray\": \"dsdot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two double-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} `y`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dswap( N, x, strideX, y, strideY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tvar j;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ i ];\n\t\t\t\tx[ i ] = y[ i ];\n\t\t\t\ty[ i ] = tmp;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ i ];\n\t\t\tx[ i ] = y[ i ];\n\t\t\ty[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\n\t\t\tj += 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two double-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float64Array} `y`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = y[ iy ];\n\t\t\t\ty[ iy ] = tmp;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = y[ iy ];\n\t\t\ty[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = y[ iy+1 ];\n\t\t\ty[ iy+1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = y[ iy+2 ];\n\t\t\ty[ iy+2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dswap = require( './dswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/dswap\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dswap = require( '@stdlib/blas/base/dswap' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dswap = require( '@stdlib/blas/base/dswap' );\n*\n* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* dswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdswap = main;\n} else {\n\tdswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n\n// exports: { \"ndarray\": \"dswap.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - `x` stride length\n* @returns {number} sum\n*\n* @example\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1 );\n* // 15.0\n*/\nfunction gasum( N, x, stride ) {\n\tvar sum;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn sum;\n\t}\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[i] );\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs(x[i]) + abs(x[i+1]) + abs(x[i+2]) + abs(x[i+3]) + abs(x[i+4]) + abs(x[i+5]); // eslint-disable-line max-len\n\t\t}\n\t\treturn sum;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tsum += abs( x[i] );\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - `x` stride length\n* @param {NonNegativeInteger} offset - starting `x` index\n* @returns {number} sum\n*\n* @example\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1, 0 );\n* // 15.0\n*/\nfunction gasum( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tix = offset;\n\n\t// Use unrolled loops if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += abs( x[ix] );\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += abs( x[ix] ) + abs( x[ix+1] ) + abs( x[ix+2] ) + abs( x[ix+3] ) + abs( x[ix+4] ) + abs( x[ix+5] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += abs( x[ix] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the sum of absolute values.\n*\n* @module @stdlib/blas/base/gasum\n*\n* @example\n* var gasum = require( '@stdlib/blas/base/gasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1 );\n* // 15.0\n*\n* @example\n* // Use the `ndarray` interface...\n* var gasum = require( '@stdlib/blas/base/gasum' ).ndarray;\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = gasum( x.length, x, 1, 0 );\n* // 15.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - destination array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction gaxpy( N, alpha, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] += alpha * x[ i ];\n\t\t\ty[ i+1 ] += alpha * x[ i+1 ];\n\t\t\ty[ i+2 ] += alpha * x[ i+2 ];\n\t\t\ty[ i+3 ] += alpha * x[ i+3 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gaxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {NumericArray} y - destination array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {NumericArray} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction gaxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] += alpha * x[ ix ];\n\t\t\ty[ iy+1 ] += alpha * x[ ix+1 ];\n\t\t\ty[ iy+2 ] += alpha * x[ ix+2 ];\n\t\t\ty[ iy+3 ] += alpha * x[ ix+3 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += alpha * x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gaxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply `x` and a constant and add the result to `y`.\n*\n* @module @stdlib/blas/base/gaxpy\n*\n* @example\n* var gaxpy = require( '@stdlib/blas/base/gaxpy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*\n* @example\n* var gaxpy = require( '@stdlib/blas/base/gaxpy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n* var alpha = 5.0;\n*\n* gaxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Object} y - output array object\n* @param {Collection} y.data - output array data\n* @param {Array} y.accessors - array element accessors\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Object} output array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var x = {\n* 'data': new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* var y = {\n* 'data': new Complex64Array( [ 5.0, 6.0, 7.0, 8.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* gcopy( x.data.length, x, 1, 0, y, 1, 0 );\n*\n* var view = reinterpret64( y.data, 0 );\n* // view => [ 1.0, 2.0, 3.0, 4.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( ybuf, iy, get( xbuf, ix ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Collection} y - destination array\n* @param {integer} strideY - `y` stride length\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\tif ( strideX < 0 ) {\n\t\t\tix = (1-N) * strideX;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\tif ( strideY < 0 ) {\n\t\t\tiy = (1-N) * strideY;\n\t\t} else {\n\t\t\tiy = 0;\n\t\t}\n\t\taccessors( N, ox, strideX, ix, oy, strideY, iy );\n\t\treturn oy.data;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Collection} y - destination array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn oy.data;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas/base/gcopy\n*\n* @example\n* var gcopy = require( '@stdlib/blas/base/gcopy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var gcopy = require( '@stdlib/blas/base/gcopy' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n\n* var z = gdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction gdot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[i]*y[i] ) + ( x[i+1]*y[i+1] ) + ( x[i+2]*y[i+2] ) + ( x[i+3]*y[i+3] ) + ( x[i+4]*y[i+4] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {integer} N - number of indexed elements\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product of `x` and `y`\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n\n* var z = gdot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction gdot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += ( x[ ix ] * y[ iy ] );\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn dot;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ix]*y[iy] ) + ( x[ix+1]*y[iy+1] ) + ( x[ix+2]*y[iy+2] ) + ( x[ix+3]*y[iy+3] ) + ( x[ix+4]*y[iy+4] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn dot;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of vectors `x` and `y`.\n*\n* @module @stdlib/blas/base/gdot\n*\n* @example\n* var gdot = require( '@stdlib/blas/base/gdot' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*\n* @example\n* var gdot = require( '@stdlib/blas/base/gdot' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {number} L2-norm\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var z = gnrm2( x.length, x, 1 );\n* // returns 3.0\n*/\nfunction gnrm2( N, x, stride ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tscale = 0.0;\n\tssq = 1.0;\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tif ( x[ i ] !== 0.0 ) {\n\t\t\tax = abs( x[ i ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} L2-norm\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var z = gnrm2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnrm2( N, x, stride, offset ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tscale = 0.0;\n\tssq = 1.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( x[ ix ] !== 0.0 ) {\n\t\t\tax = abs( x[ ix ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = 1.0 + ( ssq * pow( scale/ax, 2 ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq += pow( ax/scale, 2 );\n\t\t\t}\n\t\t}\n\t\tix += stride;\n\t}\n\treturn scale * sqrt( ssq );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar gnrm2 = require( './gnrm2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( gnrm2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the L2-norm of a vector.\n*\n* @module @stdlib/blas/base/gnrm2\n*\n* @example\n* var gnrm2 = require( '@stdlib/blas/base/gnrm2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var z = gnrm2( x.length, x, 1 );\n* // returns 3.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnrm2 = require( '@stdlib/blas/base/gnrm2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var z = gnrm2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar gnrm2 = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = gnrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction gscal( N, alpha, x, stride ) {\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0|| alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i += 1 ) {\n\t\t\t\tx[ i ] *= alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tx[ i ] *= alpha;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gscal( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction gscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply `x` by a constant.\n*\n* @module @stdlib/blas/base/gscal\n*\n* @example\n* var gscal = require( '@stdlib/blas/base/gscal' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* var gscal = require( '@stdlib/blas/base/gscal' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Interchanges vectors `x` and `y`.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - first input array object\n* @param {Collection} x.data - first input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Object} y - second input array object\n* @param {Collection} y.data - second input array array\n* @param {Array} y.accessors - array element accessors\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Object} `y`\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var x = {\n* 'data': new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* var y = {\n* 'data': new Complex64Array( [ 5.0, 6.0, 7.0, 8.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* gswap( x.data.length, x, 1, 0, y, 1, 0 );\n*\n* var viewX = reinterpret64( x.data, 0 );\n* // viewX => [ 5.0, 6.0, 7.0, 8.0 ]\n*\n* var viewY = reinterpret64( y.data, 0 );\n* // viewY => [ 1.0, 2.0, 3.0, 4.0 ]\n*/\nfunction gswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = get( xbuf, ix );\n\t\tset( xbuf, ix, get( ybuf, iy ) );\n\t\tset( ybuf, iy, tmp );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges vectors `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Collection} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gswap( N, x, strideX, y, strideY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\tvar j;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\tif ( strideX < 0 ) {\n\t\t\tix = (1-N) * strideX;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\tif ( strideY < 0 ) {\n\t\t\tiy = (1-N) * strideY;\n\t\t} else {\n\t\t\tiy = 0;\n\t\t}\n\t\taccessors( N, ox, strideX, ix, oy, strideY, iy );\n\t\treturn oy.data;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ i ];\n\t\t\t\tx[ i ] = y[ i ];\n\t\t\t\ty[ i ] = tmp;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ i ];\n\t\t\tx[ i ] = y[ i ];\n\t\t\ty[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\n\t\t\tj += 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges vectors `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Collection} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Collection} `y`\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn oy.data;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = y[ iy ];\n\t\t\t\ty[ iy ] = tmp;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = y[ iy ];\n\t\t\ty[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = y[ iy+1 ];\n\t\t\ty[ iy+1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = y[ iy+2 ];\n\t\t\ty[ iy+2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange vectors `x` and `y`.\n*\n* @module @stdlib/blas/base/gswap\n*\n* @example\n* var gswap = require( '@stdlib/blas/base/gswap' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var gswap = require( '@stdlib/blas/base/gswap' );\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {PositiveInteger} stride - `x` stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum( x.length, x, 1 );\n* // returns 15.0\n*/\nfunction sasum( N, x, stride ) {\n\tvar sum;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn sum;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tsum = float64ToFloat32( sum + abs( x[i] ) );\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - `x` stride length\n* @param {NonNegativeInteger} offset - starting `x` index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum( x.length, x, 1, 0 );\n* // returns 15.0\n*/\nfunction sasum( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + abs( x[ix] ) );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sasum = require( './sasum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sasum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the sum of absolute values.\n*\n* @module @stdlib/blas/base/sasum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sasum = require( '@stdlib/blas/base/sasum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum( x.length, x, 1 );\n* // returns 15.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sasum = require( '@stdlib/blas/base/sasum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n*\n* var s = sasum.ndarray( x.length, x, 1, 0 );\n* // returns 15.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sasum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsasum = main;\n} else {\n\tsasum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasum;\n\n// exports: { \"ndarray\": \"sasum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction saxpy( N, alpha, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] += float64ToFloat32( alpha * x[ i ] );\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] += float64ToFloat32( alpha * x[ i ] );\n\t\t\ty[ i+1 ] += float64ToFloat32( alpha * x[ i+1 ] );\n\t\t\ty[ i+2 ] += float64ToFloat32( alpha * x[ i+2 ] );\n\t\t\ty[ i+3 ] += float64ToFloat32( alpha * x[ i+3 ] );\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 4;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a constant and adds the result to `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\nfunction saxpy( N, alpha, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\t\ty[ iy+1 ] += float64ToFloat32( alpha * x[ ix+1 ] );\n\t\t\ty[ iy+2 ] += float64ToFloat32( alpha * x[ ix+2 ] );\n\t\t\ty[ iy+3 ] += float64ToFloat32( alpha * x[ ix+3 ] );\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] += float64ToFloat32( alpha * x[ ix ] );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar saxpy = require( './saxpy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( saxpy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a vector `x` and a constant and add the result to `y`.\n*\n* @module @stdlib/blas/base/saxpy\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var saxpy = require( '@stdlib/blas/base/saxpy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy( x.length, alpha, x, 1, y, 1 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var saxpy = require( '@stdlib/blas/base/saxpy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n* var alpha = 5.0;\n*\n* saxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 );\n* // y => [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar saxpy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsaxpy = main;\n} else {\n\tsaxpy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = saxpy;\n\n// exports: { \"ndarray\": \"saxpy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scopy = require( './scopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas/base/scopy\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scopy = require( '@stdlib/blas/base/scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scopy = require( '@stdlib/blas/base/scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscopy = main;\n} else {\n\tscopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n\n// exports: { \"ndarray\": \"scopy.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction sdot( N, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot = float64ToFloat32( dot + float64ToFloat32( x[ ix ] * y[ iy ] ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the dot product of `x` and `y`.\n*\n* @param {integer} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction sdot( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tdot = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn dot;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot = float64ToFloat32( dot + float64ToFloat32( x[ ix ] * y[ iy ] ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn dot;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdot = require( './sdot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/sdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdot = require( '@stdlib/blas/base/sdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot( x.length, x, 1, y, 1 );\n* // returns -5.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdot = require( '@stdlib/blas/base/sdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdot.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdot = main;\n} else {\n\tsdot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n\n// exports: { \"ndarray\": \"sdot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two single-precision floating-point vectors with extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} scalar - scalar constant to add to dot product\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot( x.length, 0.0, x, 1, y, 1 );\n* // returns -5.0\n*/\nfunction sdsdot( N, scalar, x, strideX, y, strideY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = scalar;\n\tif ( N <= 0 ) {\n\t\treturn float64ToFloat32( dot );\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ i ] * y[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn float64ToFloat32( dot );\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[i]*y[i] ) + ( x[i+1]*y[i+1] ) + ( x[i+2]*y[i+2] ) + ( x[i+3]*y[i+3] ) + ( x[i+4]*y[i+4] ); // eslint-disable-line max-len\n\t\t}\n\t\treturn float64ToFloat32( dot );\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = ( 1-N ) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = ( 1-N ) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn float64ToFloat32( dot );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two single-precision floating-point vectors with extended accumulation.\n*\n* @param {integer} N - number of indexed elements\n* @param {number} scalar - scalar constant to add to dot product\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot( x.length, 0.0, x, 1, 0, y, 1, 0 );\n* // returns -5.0\n*/\nfunction sdsdot( N, scalar, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar dot;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\n\tdot = scalar;\n\tif ( N <= 0 ) {\n\t\treturn float64ToFloat32( dot );\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tdot += x[ ix ] * y[ iy ];\n\t\t\t\tix += 1;\n\t\t\t\tiy += 1;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn float64ToFloat32( dot );\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tdot += ( x[ix]*y[iy] ) + ( x[ix+1]*y[iy+1] ) + ( x[ix+2]*y[iy+2] ) + ( x[ix+3]*y[iy+3] ) + ( x[ix+4]*y[iy+4] ); // eslint-disable-line max-len\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn float64ToFloat32( dot );\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tdot += x[ ix ] * y[ iy ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn float64ToFloat32( dot );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsdot = require( './sdsdot.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsdot, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two single-precision floating-point vectors with extended accumulation.\n*\n* @module @stdlib/blas/base/sdsdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsdot = require( '@stdlib/blas/base/sdsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot( x.length, 0.0, x, 1, y, 1 );\n* // returns -12.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsdot = require( '@stdlib/blas/base/sdsdot' );\n*\n* var x = new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] );\n* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );\n*\n* var z = sdsdot.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 );\n* // returns -12.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsdot;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsdot = main;\n} else {\n\tsdsdot = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsdot;\n\n// exports: { \"ndarray\": \"sdsdot.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {number} L2-norm\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = 3;\n*\n* var z = snrm2( N, x, 1 );\n* // returns 3.0\n*/\nfunction snrm2( N, x, stride ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar i;\n\n\tif ( N <= 0 || stride <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tscale = 0.0;\n\tssq = 1.0;\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tif ( x[ i ] !== 0.0 ) {\n\t\t\tax = abs( x[ i ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = float64ToFloat32( 1.0 + ( ssq * pow( scale/ax, 2 ) ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq = float64ToFloat32( ssq + pow( ax/scale, 2 ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn float64ToFloat32( scale * sqrt( ssq ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the L2-norm of a single-precision floating-point vector.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} L2-norm\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n*\n* var z = snrm2( 4, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snrm2( N, x, stride, offset ) {\n\tvar scale;\n\tvar ssq;\n\tvar ax;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tscale = 0.0;\n\tssq = 1.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( x[ ix ] !== 0.0 ) {\n\t\t\tax = abs( x[ ix ] );\n\t\t\tif ( scale < ax ) {\n\t\t\t\tssq = float64ToFloat32( 1.0 + ( ssq * pow( scale/ax, 2 ) ) );\n\t\t\t\tscale = ax;\n\t\t\t} else {\n\t\t\t\tssq = float64ToFloat32( ssq + pow( ax/scale, 2 ) );\n\t\t\t}\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( scale * sqrt( ssq ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snrm2 = require( './snrm2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snrm2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the L2-norm of a single-precision floating-point vector.\n*\n* @module @stdlib/blas/base/snrm2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snrm2 = require( '@stdlib/blas/base/snrm2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = 3;\n*\n* var z = snrm2( N, x, 1 );\n* // returns 3.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snrm2 = require( '@stdlib/blas/base/snrm2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var z = snrm2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snrm2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnrm2 = main;\n} else {\n\tsnrm2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snrm2;\n\n// exports: { \"ndarray\": \"snrm2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar absf = require( '@stdlib/math/base/special/absf' );\nvar sqrtf = require( '@stdlib/math/base/special/sqrtf' );\nvar abs2f = require( '@stdlib/math/base/special/abs2f' );\nvar copysignf = require( '@stdlib/math/base/special/copysignf' );\n\n\n// MAIN //\n\n/**\n* Constructs a Givens plane rotation.\n*\n* @param {number} a - rotational elimination parameter\n* @param {number} b - rotational elimination parameter\n* @param {Float32Array} out - output array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var out = srotg( 0.0, 2.0, new Float32Array( 4 ), 1, 0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*/\nfunction srotg( a, b, out, stride, offset ) {\n\tvar scale;\n\tvar sign;\n\tvar aa;\n\tvar ab;\n\tvar r;\n\tvar c;\n\tvar s;\n\tvar z;\n\n\taa = absf( a );\n\tab = absf( b );\n\tif ( aa > ab ) {\n\t\tsign = copysignf( 1.0, a );\n\t} else {\n\t\tsign = copysignf( 1.0, b );\n\t}\n\tscale = float64ToFloat32( aa + ab );\n\tif ( scale === 0.0 ) {\n\t\tc = 1.0;\n\t\ts = 0.0;\n\t\tr = 0.0;\n\t\tz = 0.0;\n\t} else {\n\t\tr = float64ToFloat32( scale * sqrtf( float64ToFloat32( abs2f( float64ToFloat32( a/scale ) ) + abs2f( float64ToFloat32( b/scale ) ) ) ) ); // eslint-disable-line max-len\n\t\tr = float64ToFloat32( r * sign );\n\t\tc = float64ToFloat32( a / r );\n\t\ts = float64ToFloat32( b / r );\n\t\tz = 1.0;\n\t\tif ( aa > ab ) {\n\t\t\tz = s;\n\t\t} else if ( c !== 0.0 ) {\n\t\t\tz = float64ToFloat32( 1.0 / c );\n\t\t}\n\t}\n\ta = r;\n\tb = z;\n\tout[ offset ] = a;\n\tout[ offset + stride ] = b;\n\tout[ offset + ( 2 * stride ) ] = c;\n\tout[ offset + ( 3 * stride ) ] = s;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srotg;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Float32Array = require( '@stdlib/array/float32' );\nvar fcn = require( './assign.js' );\n\n\n// MAIN //\n\n/**\n* Constructs a Givens plane rotation.\n*\n* @param {number} a - rotational elimination parameter\n* @param {number} b - rotational elimination parameter\n* @returns {Float32Array} output array\n*\n* @example\n* var out = srotg( 0.0, 2.0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*/\nfunction srotg( a, b ) {\n\tvar out = new Float32Array( 4 );\n\treturn fcn( a, b, out, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = srotg;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Construct a Givens plane rotation.\n*\n* @module @stdlib/blas/base/srotg\n*\n* @example\n* var srotg = require( '@stdlib/blas/base/srotg' );\n*\n* var out = srotg( 0.0, 2.0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*\n* out = srotg( 6.0, -8.0 );\n* // returns [ 10.0, ~-1.666, -0.6, 0.8 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var srotg = require( '@stdlib/blas/base/srotg' );\n*\n* var out = new Float32Array( 4 );\n*\n* var y = srotg.assign( 0.0, 2.0, out, 1, 0 );\n* // returns [ 2.0, 1.0, 0.0, 1.0 ]\n*\n* var bool = ( y === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar assign = require( './assign.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {PositiveInteger} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction sscal( N, alpha, x, stride ) {\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || stride <= 0|| alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] *= alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tN *= stride;\n\tfor ( i = 0; i < N; i += stride ) {\n\t\tx[ i ] *= alpha;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n* var alpha = 5.0;\n*\n* sscal( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction sscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] *= alpha;\n\t\t\tx[ i+1 ] *= alpha;\n\t\t\tx[ i+2 ] *= alpha;\n\t\t\tx[ i+3 ] *= alpha;\n\t\t\tx[ i+4 ] *= alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sscal = require( './sscal.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sscal, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to multiply a single-precision floating-point vector by a constant.\n*\n* @module @stdlib/blas/base/sscal\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sscal = require( '@stdlib/blas/base/sscal' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sscal = require( '@stdlib/blas/base/sscal' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sscal;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsscal = main;\n} else {\n\tsscal = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sscal;\n\n// exports: { \"ndarray\": \"sscal.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction sswap( N, x, strideX, y, strideY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tvar j;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ i ];\n\t\t\t\tx[ i ] = y[ i ];\n\t\t\t\ty[ i ] = tmp;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ i ];\n\t\t\tx[ i ] = y[ i ];\n\t\t\ty[ i ] = tmp;\n\n\t\t\tj = i + 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\n\t\t\tj += 1;\n\t\t\ttmp = x[ j ];\n\t\t\tx[ j ] = y[ j ];\n\t\t\ty[ j ] = tmp;\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Interchanges two single-precision floating-point vectors.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction sswap( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = y[ iy ];\n\t\t\t\ty[ iy ] = tmp;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = y[ iy ];\n\t\t\ty[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = y[ iy+1 ];\n\t\t\ty[ iy+1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = y[ iy+2 ];\n\t\t\ty[ iy+2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = y[ iy ];\n\t\ty[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sswap = require( './sswap.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sswap, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/base/sswap\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sswap = require( '@stdlib/blas/base/sswap' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap( x.length, x, 1, y, 1 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sswap = require( '@stdlib/blas/base/sswap' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* sswap.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // x => [ 6.0, 7.0, 8.0, 9.0, 10.0 ]\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sswap;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsswap = main;\n} else {\n\tsswap = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n\n// exports: { \"ndarray\": \"sswap.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace blas\n*/\nvar blas = {};\n\n/**\n* @name ccopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/ccopy}\n*/\nsetReadOnly( blas, 'ccopy', require( './../../base/ccopy' ) );\n\n/**\n* @name cswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/cswap}\n*/\nsetReadOnly( blas, 'cswap', require( './../../base/cswap' ) );\n\n/**\n* @name dasum\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dasum}\n*/\nsetReadOnly( blas, 'dasum', require( './../../base/dasum' ) );\n\n/**\n* @name daxpy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/daxpy}\n*/\nsetReadOnly( blas, 'daxpy', require( './../../base/daxpy' ) );\n\n/**\n* @name dcopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dcopy}\n*/\nsetReadOnly( blas, 'dcopy', require( './../../base/dcopy' ) );\n\n/**\n* @name ddot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/ddot}\n*/\nsetReadOnly( blas, 'ddot', require( './../../base/ddot' ) );\n\n/**\n* @name dnrm2\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dnrm2}\n*/\nsetReadOnly( blas, 'dnrm2', require( './../../base/dnrm2' ) );\n\n/**\n* @name dscal\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dscal}\n*/\nsetReadOnly( blas, 'dscal', require( './../../base/dscal' ) );\n\n/**\n* @name dsdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dsdot}\n*/\nsetReadOnly( blas, 'dsdot', require( './../../base/dsdot' ) );\n\n/**\n* @name dswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/dswap}\n*/\nsetReadOnly( blas, 'dswap', require( './../../base/dswap' ) );\n\n/**\n* @name gasum\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gasum}\n*/\nsetReadOnly( blas, 'gasum', require( './../../base/gasum' ) );\n\n/**\n* @name gaxpy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gaxpy}\n*/\nsetReadOnly( blas, 'gaxpy', require( './../../base/gaxpy' ) );\n\n/**\n* @name gcopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gcopy}\n*/\nsetReadOnly( blas, 'gcopy', require( './../../base/gcopy' ) );\n\n/**\n* @name gdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gdot}\n*/\nsetReadOnly( blas, 'gdot', require( './../../base/gdot' ) );\n\n/**\n* @name gnrm2\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gnrm2}\n*/\nsetReadOnly( blas, 'gnrm2', require( './../../base/gnrm2' ) );\n\n/**\n* @name gscal\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gscal}\n*/\nsetReadOnly( blas, 'gscal', require( './../../base/gscal' ) );\n\n/**\n* @name gswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/gswap}\n*/\nsetReadOnly( blas, 'gswap', require( './../../base/gswap' ) );\n\n/**\n* @name sasum\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sasum}\n*/\nsetReadOnly( blas, 'sasum', require( './../../base/sasum' ) );\n\n/**\n* @name saxpy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/saxpy}\n*/\nsetReadOnly( blas, 'saxpy', require( './../../base/saxpy' ) );\n\n/**\n* @name scopy\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/scopy}\n*/\nsetReadOnly( blas, 'scopy', require( './../../base/scopy' ) );\n\n/**\n* @name sdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sdot}\n*/\nsetReadOnly( blas, 'sdot', require( './../../base/sdot' ) );\n\n/**\n* @name sdsdot\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sdsdot}\n*/\nsetReadOnly( blas, 'sdsdot', require( './../../base/sdsdot' ) );\n\n/**\n* @name snrm2\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/snrm2}\n*/\nsetReadOnly( blas, 'snrm2', require( './../../base/snrm2' ) );\n\n/**\n* @name srotg\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/srotg}\n*/\nsetReadOnly( blas, 'srotg', require( './../../base/srotg' ) );\n\n/**\n* @name sscal\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sscal}\n*/\nsetReadOnly( blas, 'sscal', require( './../../base/sscal' ) );\n\n/**\n* @name sswap\n* @memberof blas\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/base/sswap}\n*/\nsetReadOnly( blas, 'sswap', require( './../../base/sswap' ) );\n\n\n// EXPORTS //\n\nmodule.exports = blas;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' );\nvar format = require( '@stdlib/string/format' );\nvar dot = require( './../../base/ddot' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two double-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {number} dot product\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = ddot( x, y );\n* // returns -5.0\n*/\nfunction ddot( x, y ) {\n\tif ( !isFloat64VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat64VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = ddot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/ddot\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n* var ddot = require( '@stdlib/blas/ddot' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = ddot( x, y );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat64VectorLike = require( '@stdlib/assert/is-float64vector-like' );\nvar format = require( '@stdlib/string/format' );\nvar swap = require( './../../base/dswap' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Interchanges two double-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing double-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {VectorLike} `y`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* dswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction dswap( x, y ) {\n\tif ( !isFloat64VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat64VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing double-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float64Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two double-precision floating-point vectors.\n*\n* @module @stdlib/blas/dswap\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var array = require( '@stdlib/ndarray/array' );\n* var dswap = require( '@stdlib/blas/dswap' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* dswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a double-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\nfunction dapx( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] += alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] += alpha;\n\t\t\tx[ i+1 ] += alpha;\n\t\t\tx[ i+2 ] += alpha;\n\t\t\tx[ i+3 ] += alpha;\n\t\t\tx[ i+4 ] += alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a double-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n* var alpha = 5.0;\n*\n* dapx( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]\n*/\nfunction dapx( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] += alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] += alpha;\n\t\t\tx[ ix+1 ] += alpha;\n\t\t\tx[ ix+2 ] += alpha;\n\t\t\tx[ ix+3 ] += alpha;\n\t\t\tx[ ix+4 ] += alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapx = require( './dapx.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapx, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each element in a double-precision floating-point strided array.\n*\n* @module @stdlib/blas/ext/base/dapx\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapx = require( '@stdlib/blas/ext/base/dapx' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapx = require( '@stdlib/blas/ext/base/dapx' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dapx.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapx;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapx = main;\n} else {\n\tdapx = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapx;\n\n// exports: { \"ndarray\": \"dapx.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumkbn( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumkbn( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumkbn = require( './dapxsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dapxsumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumkbn = require( '@stdlib/blas/ext/base/dapxsumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumkbn = main;\n} else {\n\tdapxsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn;\n\n// exports: { \"ndarray\": \"dapxsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dapxsumkbn = require( './../../../../ext/base/dapxsumkbn' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsum( N, alpha, x, stride ) {\n\treturn dapxsumkbn( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dapxsumkbn = require( './../../../../ext/base/dapxsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsum( N, alpha, x, stride, offset ) {\n\treturn dapxsumkbn( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsum = require( './dapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum.\n*\n* @module @stdlib/blas/ext/base/dapxsum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsum = require( '@stdlib/blas/ext/base/dapxsum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsum = require( '@stdlib/blas/ext/base/dapxsum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsum = main;\n} else {\n\tdapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsum;\n\n// exports: { \"ndarray\": \"dapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumkbn2( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn2( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumkbn2( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumkbn2 = require( './dapxsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dapxsumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumkbn2 = require( '@stdlib/blas/ext/base/dapxsumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumkbn2.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumkbn2 = main;\n} else {\n\tdapxsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumkbn2;\n\n// exports: { \"ndarray\": \"dapxsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumors( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumors( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumors( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumors = require( './dapxsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dapxsumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumors = require( '@stdlib/blas/ext/base/dapxsumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumors.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumors = main;\n} else {\n\tdapxsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumors;\n\n// exports: { \"ndarray\": \"dapxsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dapxsumpw( n, alpha, x, stride, ix ) + dapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each double-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dapxsumpw = require( './dapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each double-precision floating-point strided array element and compute the sum using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dapxsumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dapxsumpw = require( '@stdlib/blas/ext/base/dapxsumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdapxsumpw = main;\n} else {\n\tdapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dapxsumpw;\n\n// exports: { \"ndarray\": \"dapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dasumpw( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction dasumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = abs( x[ ix ] );\n\t\ts1 = abs( x[ ix+stride ] );\n\t\ts2 = abs( x[ ix+(2*stride) ] );\n\t\ts3 = abs( x[ ix+(3*stride) ] );\n\t\ts4 = abs( x[ ix+(4*stride) ] );\n\t\ts5 = abs( x[ ix+(5*stride) ] );\n\t\ts6 = abs( x[ ix+(6*stride) ] );\n\t\ts7 = abs( x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += abs( x[ ix ] );\n\t\t\ts1 += abs( x[ ix+stride ] );\n\t\t\ts2 += abs( x[ ix+(2*stride) ] );\n\t\t\ts3 += abs( x[ ix+(3*stride) ] );\n\t\t\ts4 += abs( x[ ix+(4*stride) ] );\n\t\t\ts5 += abs( x[ ix+(5*stride) ] );\n\t\t\ts6 += abs( x[ ix+(6*stride) ] );\n\t\t\ts7 += abs( x[ ix+(7*stride) ] );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dasumpw( n, x, stride, ix ) + dasumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dasumpw( N, x, 1 );\n* // returns 5.0\n*/\nfunction dasumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dasumpw = require( './dasumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dasumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dasumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dasumpw( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dasumpw.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dasumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdasumpw = main;\n} else {\n\tdasumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dasumpw;\n\n// exports: { \"ndarray\": \"dasumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumkbn( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumkbn( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumkbn( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumkbn = require( './dcusumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dcusumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumkbn( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumkbn = require( '@stdlib/blas/ext/base/dcusumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumkbn.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumkbn = main;\n} else {\n\tdcusumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn;\n\n// exports: { \"ndarray\": \"dcusumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dcusumkbn = require( './../../../../ext/base/dcusumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusum( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusum( N, sum, x, strideX, y, strideY ) {\n\treturn dcusumkbn( N, sum, x, strideX, y, strideY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dcusumkbn = require( './../../../../ext/base/dcusumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusum( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusum( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\treturn dcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusum = require( './dcusum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/dcusum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusum = require( '@stdlib/blas/ext/base/dcusum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusum( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusum = require( '@stdlib/blas/ext/base/dcusum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusum.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusum = main;\n} else {\n\tdcusum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusum;\n\n// exports: { \"ndarray\": \"dcusum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumkbn2( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumkbn2( N, sum, x, strideX, y, strideY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumkbn2 = require( './dcusumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dcusumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumkbn2( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumkbn2 = require( '@stdlib/blas/ext/base/dcusumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumkbn2 = main;\n} else {\n\tdcusumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumkbn2;\n\n// exports: { \"ndarray\": \"dcusumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumors( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumors( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumors( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumors( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumors = require( './dcusumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dcusumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumors( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumors.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumors = main;\n} else {\n\tdcusumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumors;\n\n// exports: { \"ndarray\": \"dcusumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation:\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = dcusumpw( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction dcusumpw( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tif ( N <= BLOCKSIZE ) {\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\ty[ iy ] = sum + s;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t\treturn y;\n\t}\n\tn = floor( N/2 );\n\tdcusumpw( n, sum, x, strideX, ix, y, strideY, iy );\n\tiy += (n-1) * strideY;\n\tdcusumpw( N-n, y[ iy ], x, strideX, ix+(n*strideX), y, strideY, iy+strideY ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cusum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* var v = dcusumpw( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction dcusumpw( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\treturn cusum( N, sum, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dcusumpw = require( './dcusumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dcusumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dcusumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float64Array( x.length );\n* var N = x.length;\n*\n* dcusumpw( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dcusumpw = require( '@stdlib/blas/ext/base/dcusumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float64Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* dcusumpw.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dcusumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdcusumpw = main;\n} else {\n\tdcusumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dcusumpw;\n\n// exports: { \"ndarray\": \"dcusumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a double-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction dfill( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] = alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] = alpha;\n\t\t\tx[ i+1 ] = alpha;\n\t\t\tx[ i+2 ] = alpha;\n\t\t\tx[ i+3 ] = alpha;\n\t\t\tx[ i+4 ] = alpha;\n\t\t\tx[ i+5 ] = alpha;\n\t\t\tx[ i+6 ] = alpha;\n\t\t\tx[ i+7 ] = alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a double-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* dfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction dfill( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dfill = require( './dfill.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dfill, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a double-precision floating-point strided array with a specified scalar constant.\n*\n* @module @stdlib/blas/ext/base/dfill\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dfill = require( '@stdlib/blas/ext/base/dfill' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dfill = require( '@stdlib/blas/ext/base/dfill' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* dfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dfill;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdfill = main;\n} else {\n\tdfill = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dfill;\n\n// exports: { \"ndarray\": \"dfill.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasumors( N, x, 1 );\n* // returns 5.0\n*/\nfunction dnanasumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tsum += abs( v );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasumors( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction dnanasumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tsum += abs( v );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnanasumors = require( './dnanasumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnanasumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dnanasumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasumors( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnanasumors = require( '@stdlib/blas/ext/base/dnanasumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasumors.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnanasumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnanasumors = main;\n} else {\n\tdnanasumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasumors;\n\n// exports: { \"ndarray\": \"dnanasumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnanasumors = require( './../../../../ext/base/dnanasumors' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasum( N, x, 1 );\n* // returns 5.0\n*/\nfunction dnanasum( N, x, stride ) {\n\treturn dnanasumors( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnanasumors = require( './../../../../ext/base/dnanasumors' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasum( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction dnanasum( N, x, stride, offset ) {\n\treturn dnanasumors( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnanasum = require( './dnanasum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnanasum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/dnanasum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnanasum = require( '@stdlib/blas/ext/base/dnanasum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnanasum( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnanasum = require( '@stdlib/blas/ext/base/dnanasum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnanasum.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnanasum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnanasum = main;\n} else {\n\tdnanasum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnanasum;\n\n// exports: { \"ndarray\": \"dnanasum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumkbn( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumkbn = require( './dnannsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnannsumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumkbn = require( '@stdlib/blas/ext/base/dnannsumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumkbn = main;\n} else {\n\tdnannsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn;\n\n// exports: { \"ndarray\": \"dnannsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnannsumkbn = require( './../../../../ext/base/dnannsumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsum( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsum( N, x, strideX, out, strideOut ) {\n\treturn dnannsumkbn( N, x, strideX, out, strideOut );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnannsumkbn = require( './../../../../ext/base/dnannsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsum( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsum( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\treturn dnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsum = require( './dnannsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/dnannsum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsum = require( '@stdlib/blas/ext/base/dnannsum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsum( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsum = require( '@stdlib/blas/ext/base/dnannsum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsum.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsum = main;\n} else {\n\tdnannsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsum;\n\n// exports: { \"ndarray\": \"dnannsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn2( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumkbn2( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ccs;\n\tvar cs;\n\tvar cc;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + cs + ccs;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn2( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumkbn2( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ccs;\n\tvar cs;\n\tvar cc;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + cs + ccs;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumkbn2 = require( './dnannsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnannsumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumkbn2( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumkbn2 = require( '@stdlib/blas/ext/base/dnannsumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumkbn2.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumkbn2 = main;\n} else {\n\tdnannsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumkbn2;\n\n// exports: { \"ndarray\": \"dnannsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumors( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumors( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumors( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumors = require( './dnannsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dnannsumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumors = require( '@stdlib/blas/ext/base/dnannsumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumors.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumors = main;\n} else {\n\tdnannsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumors;\n\n// exports: { \"ndarray\": \"dnannsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of a double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - two-element output array whose first element is the accumulated sum and whose second element is the accumulated number of summed values\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var out = new Float64Array( [ 0.0, 0 ] );\n* var v = sumpw( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction sumpw( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar ix;\n\tvar io;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn out;\n\t}\n\tix = offsetX;\n\tio = offsetOut;\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] += x[ ix ];\n\t\tout[ io+strideOut ] += 1;\n\t\treturn out;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tn = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t}\n\t\tout[ io ] += s;\n\t\tout[ io+strideOut ] += n;\n\t\treturn out;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = 0.0;\n\t\ts1 = 0.0;\n\t\ts2 = 0.0;\n\t\ts3 = 0.0;\n\t\ts4 = 0.0;\n\t\ts5 = 0.0;\n\t\ts6 = 0.0;\n\t\ts7 = 0.0;\n\t\tn = 0;\n\n\t\tM = N % 8;\n\t\tfor ( i = 0; i < N-M; i += 8 ) {\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts0 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts1 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts2 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts3 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts4 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts5 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts6 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts7 += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\t\t\tif ( v === v ) {\n\t\t\t\ts += v;\n\t\t\t\tn += 1;\n\t\t\t}\n\t\t\tix += strideX;\n\t\t}\n\t\tout[ io ] += s;\n\t\tout[ io+strideOut ] += n;\n\t\treturn out;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\tsumpw( n, x, strideX, ix, out, strideOut, offsetOut );\n\tsumpw( N-n, x, strideX, ix+(n*strideX), out, strideOut, offsetOut );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sumpw = require( './sumpw.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumpw( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dnannsumpw( N, x, strideX, out, strideOut ) {\n\tvar ix;\n\tvar io;\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tout[ io ] = 0.0;\n\tout[ io+strideOut ] = 0;\n\tsumpw( N, x, strideX, ix, out, strideOut, io );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sumpw = require( './sumpw.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumpw( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dnannsumpw( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tout[ offsetOut ] = 0.0;\n\tout[ offsetOut+strideOut ] = 0;\n\tsumpw( N, x, strideX, offsetX, out, strideOut, offsetOut );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnannsumpw = require( './dnannsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnannsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dnannsumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dnannsumpw( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnannsumpw = require( '@stdlib/blas/ext/base/dnannsumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dnannsumpw.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnannsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnannsumpw = main;\n} else {\n\tdnannsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnannsumpw;\n\n// exports: { \"ndarray\": \"dnannsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumkbn = require( './dnansumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnansumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumkbn = require( '@stdlib/blas/ext/base/dnansumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumkbn = main;\n} else {\n\tdnansumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn;\n\n// exports: { \"ndarray\": \"dnansumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnansumkbn = require( './../../../../ext/base/dnansumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansum( N, x, stride ) {\n\treturn dnansumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dnansumkbn = require( './../../../../ext/base/dnansumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansum( N, x, stride, offset ) {\n\treturn dnansumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansum = require( './dnansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/dnansum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansum = require( '@stdlib/blas/ext/base/dnansum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansum = require( '@stdlib/blas/ext/base/dnansum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansum = main;\n} else {\n\tdnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansum;\n\n// exports: { \"ndarray\": \"dnansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumkbn2 = require( './dnansumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dnansumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumkbn2 = require( '@stdlib/blas/ext/base/dnansumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumkbn2 = main;\n} else {\n\tdnansumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumkbn2;\n\n// exports: { \"ndarray\": \"dnansumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumors = require( './dnansumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dnansumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumors = require( '@stdlib/blas/ext/base/dnansumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumors = require( '@stdlib/blas/ext/base/dnansumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumors = main;\n} else {\n\tdnansumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumors;\n\n// exports: { \"ndarray\": \"dnansumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dnansumpw( n, x, stride, ix ) + dnansumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dnansumpw = require( './dnansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dnansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dnansumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dnansumpw = require( '@stdlib/blas/ext/base/dnansumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dnansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdnansumpw = main;\n} else {\n\tdnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dnansumpw;\n\n// exports: { \"ndarray\": \"dnansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a double-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* drev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\nfunction drev( N, x, stride ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( ix = 0; ix < m; ix++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tiy -= 1;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( ix = m; ix < n; ix += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a double-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* drev( 3, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]\n*/\nfunction drev( N, x, stride, offset ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = ix + N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tix += stride;\n\t\t\t\tiy -= stride;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < n; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar drev = require( './drev.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( drev, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reverse a double-precision floating-point strided array in-place.\n*\n* @module @stdlib/blas/ext/base/drev\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var drev = require( '@stdlib/blas/ext/base/drev' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* drev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var drev = require( '@stdlib/blas/ext/base/drev' );\n*\n* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* drev( x.length, x, 1, 0 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar drev;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdrev = main;\n} else {\n\tdrev = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = drev;\n\n// exports: { \"ndarray\": \"drev.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dsapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dsapxsumpw( n, alpha, x, stride, ix ) + dsapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dsapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsapxsumpw = require( './dsapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsapxsumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsapxsumpw = require( '@stdlib/blas/ext/base/dsapxsumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsapxsumpw = main;\n} else {\n\tdsapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsumpw;\n\n// exports: { \"ndarray\": \"dsapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsapxsumpw = require( './../../../../ext/base/dsapxsumpw' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction dsapxsum( N, alpha, x, stride ) {\n\treturn dsapxsumpw( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsapxsumpw = require( './../../../../ext/base/dsapxsumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction dsapxsum( N, alpha, x, stride, offset ) {\n\treturn dsapxsumpw( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsapxsum = require( './dsapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsapxsum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsapxsum = require( '@stdlib/blas/ext/base/dsapxsum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsapxsum = main;\n} else {\n\tdsapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsapxsum;\n\n// exports: { \"ndarray\": \"dsapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {Float64Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dsnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction dsnannsumors( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {Float64Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dsnannsumors( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction dsnannsumors( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnannsumors = require( './dsnannsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnannsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnannsumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var out = new Float64Array( 2 );\n*\n* var v = dsnannsumors( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnannsumors = require( '@stdlib/blas/ext/base/dsnannsumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var out = new Float64Array( 2 );\n*\n* var N = floor( x.length / 2 );\n*\n* var v = dsnannsumors.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnannsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnannsumors = main;\n} else {\n\tdsnannsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnannsumors;\n\n// exports: { \"ndarray\": \"dsnannsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dsnansumpw( n, x, stride, ix ) + dsnansumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnansumpw = require( './dsnansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using pairwise summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnansumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnansumpw = require( '@stdlib/blas/ext/base/dsnansumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnansumpw = main;\n} else {\n\tdsnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumpw;\n\n// exports: { \"ndarray\": \"dsnansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsnansumpw = require( './../../../../ext/base/dsnansumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsnansum( N, x, stride ) {\n\treturn dsnansumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsnansumpw = require( './../../../../ext/base/dsnansumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsnansum( N, x, stride, offset ) {\n\treturn dsnansumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnansum = require( './dsnansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnansum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsnansum = require( '@stdlib/blas/ext/base/dsnansum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnansum = require( '@stdlib/blas/ext/base/dsnansum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnansum = main;\n} else {\n\tdsnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansum;\n\n// exports: { \"ndarray\": \"dsnansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsnansumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsnansumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\tsum += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsnansumors = require( './dsnansumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsnansumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values, using ordinary recursive summation with extended accumulation, and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dsnansumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsnansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsnansumors = require( '@stdlib/blas/ext/base/dsnansumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsnansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsnansumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsnansumors = main;\n} else {\n\tdsnansumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsnansumors;\n\n// exports: { \"ndarray\": \"dsnansumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2hp( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2hp( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsort2hp = require( './dsort2hp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsort2hp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* @module @stdlib/blas/ext/base/dsort2hp\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2hp = require( '@stdlib/blas/ext/base/dsort2hp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsort2hp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsort2hp = main;\n} else {\n\tdsort2hp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2hp;\n\n// exports: { \"ndarray\": \"dsort2hp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2ins( N, order, x, strideX, y, strideY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideY < 0 ) {\n\t\tfy = (1-N) * strideY;\n\t\tly = 0;\n\t} else {\n\t\tfy = 0;\n\t\tly = (N-1) * strideY;\n\t}\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * strideX; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + strideX;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * strideX; // last index\n\tix = fx + strideX;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfx = offsetX; // first index\n\tlx = fx + ((N-1)*strideX); // last index\n\tix = fx + strideX;\n\n\tfy = offsetY; // first index\n\tly = fy + ((N-1)*strideY); // last index\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsort2ins = require( './dsort2ins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsort2ins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/dsort2ins\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2ins = require( '@stdlib/blas/ext/base/dsort2ins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsort2ins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsort2ins = main;\n} else {\n\tdsort2ins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2ins;\n\n// exports: { \"ndarray\": \"dsort2ins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2sh( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float64Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float64Array} `x`\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction dsort2sh( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsort2sh = require( './dsort2sh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsort2sh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/dsort2sh\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsort2sh = require( '@stdlib/blas/ext/base/dsort2sh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* dsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsort2sh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsort2sh = main;\n} else {\n\tdsort2sh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsort2sh;\n\n// exports: { \"ndarray\": \"dsort2sh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsorthp( N, order, x, stride ) {\n\tvar offset;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsorthp( N, order, x, stride, offset ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsorthp = require( './dsorthp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsorthp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a double-precision floating-point strided array using heapsort.\n*\n* @module @stdlib/blas/ext/base/dsorthp\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsorthp = require( '@stdlib/blas/ext/base/dsorthp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsorthp = require( '@stdlib/blas/ext/base/dsorthp' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsorthp.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsorthp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsorthp = main;\n} else {\n\tdsorthp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsorthp;\n\n// exports: { \"ndarray\": \"dsorthp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortins( N, order, x, stride ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * stride; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + stride;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * stride; // last index\n\tix = fx + stride;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortins( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfx = offset; // first index\n\tlx = fx + ((N-1)*stride); // last index\n\tix = fx + stride;\n\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsortins = require( './dsortins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsortins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a double-precision floating-point strided array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/dsortins\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortins = require( '@stdlib/blas/ext/base/dsortins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortins = require( '@stdlib/blas/ext/base/dsortins' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortins.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsortins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsortins = main;\n} else {\n\tdsortins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortins;\n\n// exports: { \"ndarray\": \"dsortins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortsh( N, order, x, stride ) {\n\tvar offset;\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a double-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float64Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} input array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction dsortsh( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsortsh = require( './dsortsh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsortsh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a double-precision floating-point strided array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/dsortsh\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsortsh = require( '@stdlib/blas/ext/base/dsortsh' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* dsortsh.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsortsh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsortsh = main;\n} else {\n\tdsortsh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsortsh;\n\n// exports: { \"ndarray\": \"dsortsh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dssumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dssumpw( n, x, stride, ix ) + dssumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dssumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dssumpw = require( './dssumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dssumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dssumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dssumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdssumpw = main;\n} else {\n\tdssumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumpw;\n\n// exports: { \"ndarray\": \"dssumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dssumpw = require( './../../../../ext/base/dssumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dssum( N, x, stride ) {\n\treturn dssumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dssumpw = require( './../../../../ext/base/dssumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dssum( N, x, stride, offset ) {\n\treturn dssumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dssum = require( './dssum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dssum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dssum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dssum = require( '@stdlib/blas/ext/base/dssum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dssum = require( '@stdlib/blas/ext/base/dssum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dssum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdssum = main;\n} else {\n\tdssum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssum;\n\n// exports: { \"ndarray\": \"dssum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dssumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[i] + x[i+1] + x[i+2] + x[i+3] + x[i+4] + x[i+5];\n\t\t}\n\t\treturn sum;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dssumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ ix ];\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[ix] + x[ix+1] + x[ix+2] + x[ix+3] + x[ix+4] + x[ix+5];\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dssumors = require( './dssumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dssumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using ordinary recursive summation with extended accumulation and returning an extended precision result.\n*\n* @module @stdlib/blas/ext/base/dssumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var dssumors = require( '@stdlib/blas/ext/base/dssumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dssumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dssumors = require( '@stdlib/blas/ext/base/dssumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dssumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dssumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdssumors = main;\n} else {\n\tdssumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dssumors;\n\n// exports: { \"ndarray\": \"dssumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumkbn = require( './dsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dsumkbn\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumkbn = require( '@stdlib/blas/ext/base/dsumkbn' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumkbn = main;\n} else {\n\tdsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn;\n\n// exports: { \"ndarray\": \"dsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsumkbn = require( './../../../../ext/base/dsumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsum( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsum( N, x, stride ) {\n\treturn dsumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dsumkbn = require( './../../../../ext/base/dsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsum( N, x, stride, offset ) {\n\treturn dsumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsum = require( './dsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/dsum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsum = require( '@stdlib/blas/ext/base/dsum' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsum = require( '@stdlib/blas/ext/base/dsum' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsum = main;\n} else {\n\tdsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsum;\n\n// exports: { \"ndarray\": \"dsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumkbn2 = require( './dsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/dsumkbn2\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumkbn2 = require( '@stdlib/blas/ext/base/dsumkbn2' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumkbn2 = main;\n} else {\n\tdsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumkbn2;\n\n// exports: { \"ndarray\": \"dsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[i] + x[i+1] + x[i+2] + x[i+3] + x[i+4] + x[i+5];\n\t\t}\n\t\treturn sum;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tsum += x[ ix ];\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn sum;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tsum += x[ix] + x[ix+1] + x[ix+2] + x[ix+3] + x[ix+4] + x[ix+5];\n\t\t\tix += M;\n\t\t}\n\t\treturn sum;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumors = require( './dsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/dsumors\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumors = require( '@stdlib/blas/ext/base/dsumors' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumors = require( '@stdlib/blas/ext/base/dsumors' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumors = main;\n} else {\n\tdsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumors;\n\n// exports: { \"ndarray\": \"dsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction dsumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn dsumpw( n, x, stride, ix ) + dsumpw( N-n, x, stride, ix+(n*stride) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float64Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction dsumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar dsumpw = require( './dsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( dsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of double-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/dsumpw\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var dsumpw = require( '@stdlib/blas/ext/base/dsumpw' );\n*\n* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = dsumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var dsumpw = require( '@stdlib/blas/ext/base/dsumpw' );\n*\n* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = dsumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar dsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tdsumpw = main;\n} else {\n\tdsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dsumpw;\n\n// exports: { \"ndarray\": \"dsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\nfunction gapx( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] += alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] += alpha;\n\t\t\tx[ i+1 ] += alpha;\n\t\t\tx[ i+2 ] += alpha;\n\t\t\tx[ i+3 ] += alpha;\n\t\t\tx[ i+4 ] += alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n* var alpha = 5.0;\n*\n* gapx( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]\n*/\nfunction gapx( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] += alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] += alpha;\n\t\t\tx[ ix+1 ] += alpha;\n\t\t\tx[ ix+2 ] += alpha;\n\t\t\tx[ ix+3 ] += alpha;\n\t\t\tx[ ix+4 ] += alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each element in a strided array.\n*\n* @module @stdlib/blas/ext/base/gapx\n*\n* @example\n* var gapx = require( '@stdlib/blas/ext/base/gapx' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*\n* @example\n* var gapx = require( '@stdlib/blas/ext/base/gapx' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gapx.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumkbn( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumkbn( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gapxsumkbn\n*\n* @example\n* var gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumkbn = require( '@stdlib/blas/ext/base/gapxsumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gapxsumkbn = require( './../../../../ext/base/gapxsumkbn' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsum( N, alpha, x, stride ) {\n\treturn gapxsumkbn( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gapxsumkbn = require( './../../../../ext/base/gapxsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsum( N, alpha, x, stride, offset ) {\n\treturn gapxsumkbn( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum.\n*\n* @module @stdlib/blas/ext/base/gapxsum\n*\n* @example\n* var gapxsum = require( '@stdlib/blas/ext/base/gapxsum' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsum = require( '@stdlib/blas/ext/base/gapxsum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumkbn2( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn2( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumkbn2( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = alpha + x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gapxsumkbn2\n*\n* @example\n* var gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumkbn2 = require( '@stdlib/blas/ext/base/gapxsumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumkbn2.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumors( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumors( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumors( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += alpha + x[ ix ];\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gapxsumors\n*\n* @example\n* var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumors = require( '@stdlib/blas/ext/base/gapxsumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumors.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction gapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gapxsumpw( n, alpha, x, stride, ix ) + gapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction gapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn alpha + x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each strided array element and compute the sum using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gapxsumpw\n*\n* @example\n* var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gasumpw( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction gasumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = abs( x[ ix ] );\n\t\ts1 = abs( x[ ix+stride ] );\n\t\ts2 = abs( x[ ix+(2*stride) ] );\n\t\ts3 = abs( x[ ix+(3*stride) ] );\n\t\ts4 = abs( x[ ix+(4*stride) ] );\n\t\ts5 = abs( x[ ix+(5*stride) ] );\n\t\ts6 = abs( x[ ix+(6*stride) ] );\n\t\ts7 = abs( x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += abs( x[ ix ] );\n\t\t\ts1 += abs( x[ ix+stride ] );\n\t\t\ts2 += abs( x[ ix+(2*stride) ] );\n\t\t\ts3 += abs( x[ ix+(3*stride) ] );\n\t\t\ts4 += abs( x[ ix+(4*stride) ] );\n\t\t\ts5 += abs( x[ ix+(5*stride) ] );\n\t\t\ts6 += abs( x[ ix+(6*stride) ] );\n\t\t\ts7 += abs( x[ ix+(7*stride) ] );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gasumpw( n, x, stride, ix ) + gasumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gasumpw( x.length, x, 1 );\n* // returns 5.0\n*/\nfunction gasumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += abs( x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gasumpw\n*\n* @example\n* var gasumpw = require( '@stdlib/blas/ext/base/gasumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n*\n* var v = gasumpw( x.length, x, 1 );\n* // returns 5.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gasumpw = require( '@stdlib/blas/ext/base/gasumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gasumpw.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumkbn( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumkbn( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = s + v;\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc += (s-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + s;\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = s + c;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gcusumkbn\n*\n* @example\n* var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumkbn( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gcusumkbn = require( './../../../../ext/base/gcusumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusum( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusum( N, sum, x, strideX, y, strideY ) {\n\treturn gcusumkbn( N, sum, x, strideX, y, strideY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gcusumkbn = require( './../../../../ext/base/gcusumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusum( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusum( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\treturn gcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements.\n*\n* @module @stdlib/blas/ext/base/gcusum\n*\n* @example\n* var gcusum = require( '@stdlib/blas/ext/base/gcusum' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusum( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusum = require( '@stdlib/blas/ext/base/gcusum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusum.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumkbn2( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumkbn2( N, sum, x, strideX, y, strideY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\n\t\ty[ iy ] = sum + cs + ccs;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gcusumkbn2\n*\n* @example\n* var gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumkbn2( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumkbn2 = require( '@stdlib/blas/ext/base/gcusumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumkbn2.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumors( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumors( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumors( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumors( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum += x[ ix ];\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gcusumors\n*\n* @example\n* var gcusumors = require( '@stdlib/blas/ext/base/gcusumors' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumors( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumors = require( '@stdlib/blas/ext/base/gcusumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumors.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation:\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumpw( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction gcusumpw( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tif ( N <= BLOCKSIZE ) {\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\ty[ iy ] = sum + s;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t\treturn y;\n\t}\n\tn = floor( N/2 );\n\tgcusumpw( n, sum, x, strideX, ix, y, strideY, iy );\n\tiy += (n-1) * strideY;\n\tgcusumpw( N-n, y[ iy ], x, strideX, ix+(n*strideX), y, strideY, iy+strideY ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cusum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* var v = gcusumpw( x.length, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction gcusumpw( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\treturn cusum( N, sum, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gcusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gcusumpw\n*\n* @example\n* var gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var y = [ 0.0, 0.0, 0.0 ];\n*\n* gcusumpw( x.length, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gcusumpw = require( '@stdlib/blas/ext/base/gcusumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];\n* var N = floor( x.length / 2 );\n*\n* gcusumpw.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Object} input array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ null, setter ]\n* };\n*\n* var alpha = new Complex64( 5.0, 5.0 );\n*\n* gfill( data.length, alpha, x, 1, 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // view => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, stride, offset ) {\n\tvar xbuf;\n\tvar set;\n\tvar ix;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessor:\n\tset = x.accessors[ 1 ];\n\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( xbuf, ix, alpha );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @returns {Collection} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\tvar o;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\tif ( stride < 0 ) {\n\t\t\tix = (1-N) * stride;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\taccessors( N, alpha, o, stride, ix );\n\t\treturn o.data;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] = alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] = alpha;\n\t\t\tx[ i+1 ] = alpha;\n\t\t\tx[ i+2 ] = alpha;\n\t\t\tx[ i+3 ] = alpha;\n\t\t\tx[ i+4 ] = alpha;\n\t\t\tx[ i+5 ] = alpha;\n\t\t\tx[ i+6 ] = alpha;\n\t\t\tx[ i+7 ] = alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Collection} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, alpha, o, stride, offset );\n\t\treturn o.data;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with a specified scalar constant.\n*\n* @module @stdlib/blas/ext/base/gfill\n*\n* @example\n* var gfill = require( '@stdlib/blas/ext/base/gfill' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var gfill = require( '@stdlib/blas/ext/base/gfill' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Fills a strided array according to a provided callback function.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @param {Callback} clbk - callback\n* @param {*} thisArg - execution context\n* @returns {Object} input array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ getter, setter ]\n* };\n*\n* function clbk() {\n* return new Complex64( 5.0, 5.0 );\n* }\n*\n* gfillBy( data.length, x, 1, 0, clbk, void 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // view => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfillBy( N, x, stride, offset, clbk, thisArg ) {\n\tvar xbuf;\n\tvar set;\n\tvar get;\n\tvar ix;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = x.accessors[ 1 ];\n\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( xbuf, ix, clbk.call( thisArg, get( xbuf, ix ), i, ix, x ) );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfillBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array according to a provided callback function.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @param {Callback} clbk - callback\n* @param {*} [thisArg] - execution context\n* @returns {Collection} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* gfillBy( x.length, x, 1, fill );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfillBy( N, x, stride, clbk, thisArg ) {\n\tvar ix;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, o, stride, ix, clbk, thisArg );\n\t\treturn o.data;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = clbk.call( thisArg, x[ ix ], i, ix, x );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfillBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array according to a provided callback function.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @param {Callback} clbk - callback\n* @param {*} [thisArg] - execution context\n* @returns {Collection} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* gfillBy( 3, x, 1, x.length-3, fill );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfillBy( N, x, stride, offset, clbk, thisArg ) {\n\tvar ix;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, o, stride, offset, clbk, thisArg );\n\t\treturn o.data;\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = clbk.call( thisArg, x[ ix ], i, ix, x );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gfillBy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array according to a provided callback function.\n*\n* @module @stdlib/blas/ext/base/gfill-by\n*\n* @example\n* var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' );\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfillBy( x.length, x, 1, fill );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var gfillBy = require( '@stdlib/blas/ext/base/gfill-by' );\n*\n* function fill() {\n* return 5.0;\n* }\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfillBy.ndarray( x.length, x, 1, 0, fill );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NumericArray} out - output array\n* @param {integer} strideOut - `out` stride length\n* @returns {NumericArray} output array\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var out = [ 0.0, 0 ];\n*\n* var v = gnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*/\nfunction gnannsumkbn( N, x, strideX, out, strideOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideOut < 0 ) {\n\t\tio = -strideOut;\n\t} else {\n\t\tio = 0;\n\t}\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} out - output array\n* @param {integer} strideOut - `out` stride length\n* @param {NonNegativeInteger} offsetOut - `out` starting index\n* @returns {NumericArray} output array\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var out = [ 0.0, 0 ];\n*\n* var N = floor( x.length / 2 );\n*\n* var v = gnannsumkbn( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\nfunction gnannsumkbn( N, x, strideX, offsetX, out, strideOut, offsetOut ) {\n\tvar sum;\n\tvar ix;\n\tvar io;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar n;\n\tvar i;\n\n\tix = offsetX;\n\tio = offsetOut;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\tout[ io ] = sum;\n\t\tout[ io+strideOut ] = 0;\n\t\treturn out;\n\t}\n\tif ( N === 1 || strideX === 0 ) {\n\t\tif ( isnan( x[ ix ] ) ) {\n\t\t\tout[ io ] = sum;\n\t\t\tout[ io+strideOut ] = 0;\n\t\t\treturn out;\n\t\t}\n\t\tout[ io ] = x[ ix ];\n\t\tout[ io+strideOut ] = 1;\n\t\treturn out;\n\t}\n\tc = 0.0;\n\tn = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tn += 1;\n\t\t}\n\t\tix += strideX;\n\t}\n\tout[ io ] = sum + c;\n\tout[ io+strideOut ] = n;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnannsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gnannsumkbn\n*\n* @example\n* var gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var out = [ 0.0, 0 ];\n*\n* var v = gnannsumkbn( x.length, x, 1, out, 1 );\n* // returns [ 1.0, 3 ]\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnannsumkbn = require( '@stdlib/blas/ext/base/gnannsumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var out = [ 0.0, 0 ];\n*\n* var N = floor( x.length / 2 );\n*\n* var v = gnannsumkbn.ndarray( N, x, 2, 1, out, 1, 0 );\n* // returns [ 5.0, 4 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc += (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc += (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gnansumkbn\n*\n* @example\n* var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumkbn = require( '@stdlib/blas/ext/base/gnansumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gnansumkbn = require( './../../../../ext/base/gnansumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansum( N, x, stride ) {\n\treturn gnansumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gnansumkbn = require( './../../../../ext/base/gnansumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansum( N, x, stride, offset ) {\n\treturn gnansumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/gnansum\n*\n* @example\n* var gnansum = require( '@stdlib/blas/ext/base/gnansum' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansum = require( '@stdlib/blas/ext/base/gnansum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnan( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = (sum-t) + v;\n\t\t\t} else {\n\t\t\t\tc = (v-t) + sum;\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = cs + c;\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = (cs-t) + c;\n\t\t\t} else {\n\t\t\t\tcc = (c-t) + cs;\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs += cc;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gnansumkbn2\n*\n* @example\n* var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumkbn2 = require( '@stdlib/blas/ext/base/gnansumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumors( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn s;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\ts += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumors( N, x, stride, offset ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn s;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\ts += x[ ix ];\n\t\t}\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gnansumors\n*\n* @example\n* var gnansumors = require( '@stdlib/blas/ext/base/gnansumors' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumors = require( '@stdlib/blas/ext/base/gnansumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnan( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gnansumpw( n, x, stride, ix ) + gnansumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction gnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnan( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnan( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gnansumpw\n*\n* @example\n* var gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' );\n*\n* var x = [ 1.0, -2.0, NaN, 2.0 ];\n* var N = x.length;\n*\n* var v = gnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gnansumpw = require( '@stdlib/blas/ext/base/gnansumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];\n* var N = floor( x.length / 2 );\n*\n* var v = gnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Reverses a strided array in-place.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Object} input array object\n*\n* @example\n* var Complex64Array = require( '@stdlib/array/complex64' );\n* var Complex64 = require( '@stdlib/complex/float32' );\n* var reinterpret64 = require( '@stdlib/strided/base/reinterpret-complex64' );\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ getter, setter ]\n* };\n*\n* grev( data.length, x, 1, 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // view => [ -1.0, -3.0, 4.0, 0.0, 3.0, -5.0, -2.0, 1.0 ]\n*/\nfunction grev( N, x, stride, offset ) {\n\tvar xbuf;\n\tvar set;\n\tvar get;\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = x.accessors[ 1 ];\n\n\tn = floor( N/2 );\n\tix = offset;\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = get( xbuf, ix );\n\t\tset( xbuf, ix, get( xbuf, iy ) );\n\t\tset( xbuf, iy, tmp );\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = grev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* grev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\nfunction grev( N, x, stride ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar o;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\tif ( stride < 0 ) {\n\t\t\tix = (1-N) * stride;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\taccessors( N, o, stride, ix );\n\t\treturn o.data;\n\t}\n\tn = floor( N/2 );\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( ix = 0; ix < m; ix++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tiy -= 1;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( ix = m; ix < n; ix += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = grev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar arraylike2object = require( '@stdlib/array/base/arraylike2object' );\nvar accessors = require( './accessors.js' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* grev( 3, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]\n*/\nfunction grev( N, x, stride, offset ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar o;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, o, stride, offset );\n\t\treturn o.data;\n\t}\n\tn = floor( N/2 );\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = ix + N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tix += stride;\n\t\t\t\tiy -= stride;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < n; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = grev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reverse a strided array in-place.\n*\n* @module @stdlib/blas/ext/base/grev\n*\n* @example\n* var grev = require( '@stdlib/blas/ext/base/grev' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* grev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*\n* @example\n* var grev = require( '@stdlib/blas/ext/base/grev' );\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* grev( x.length, x, 1, 0 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2hp( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2hp( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnan( v1 ) || ( v1 === tx && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* @module @stdlib/blas/ext/base/gsort2hp\n*\n* @example\n* var gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var gsort2hp = require( '@stdlib/blas/ext/base/gsort2hp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2ins( N, order, x, strideX, y, strideY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideY < 0 ) {\n\t\tfy = (1-N) * strideY;\n\t\tly = 0;\n\t} else {\n\t\tfy = 0;\n\t\tly = (N-1) * strideY;\n\t}\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * strideX; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + strideX;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * strideX; // last index\n\tix = fx + strideX;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfx = offsetX; // first index\n\tlx = fx + ((N-1)*strideX); // last index\n\tix = fx + strideX;\n\n\tfy = offsetY; // first index\n\tly = fy + ((N-1)*strideY); // last index\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZero( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two strided arrays based on the sort order of the first array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/gsort2ins\n*\n* @example\n* var gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var gsort2ins = require( '@stdlib/blas/ext/base/gsort2ins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2sh( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform Shellsort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {NumericArray} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {NumericArray} `x`\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction gsort2sh( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform Shellsort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two double-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/gsort2sh\n*\n* @example\n* var gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var gsort2sh = require( '@stdlib/blas/ext/base/gsort2sh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n* var y = [ 0.0, 1.0, 2.0, 3.0 ];\n*\n* gsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsorthp( N, order, x, stride ) {\n\tvar offset;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsorthp( N, order, x, stride, offset ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnan( v1 ) || (v1 === v2 && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnan( v1 ) || ( v1 === t && isPositiveZero( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a strided array using heapsort.\n*\n* @module @stdlib/blas/ext/base/gsorthp\n*\n* @example\n* var gsorthp = require( '@stdlib/blas/ext/base/gsorthp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var gsorthp = require( '@stdlib/blas/ext/base/gsorthp' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsorthp.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortins( N, order, x, stride ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * stride; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + stride;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * stride; // last index\n\tix = fx + stride;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortins( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfx = offset; // first index\n\tlx = fx + ((N-1)*stride); // last index\n\tix = fx + stride;\n\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZero( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnan( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZero( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZero( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a strided array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/gsortins\n*\n* @example\n* var gsortins = require( '@stdlib/blas/ext/base/gsortins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var gsortins = require( '@stdlib/blas/ext/base/gsortins' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortins.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortsh( N, order, x, stride ) {\n\tvar offset;\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {NumericArray} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction gsortsh( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnan( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZero( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a strided array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/gsortsh\n*\n* @example\n* var gsortsh = require( '@stdlib/blas/ext/base/gsortsh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var gsortsh = require( '@stdlib/blas/ext/base/gsortsh' );\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0 ];\n*\n* gsortsh.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc += (sum-t) + v;\n\t\t} else {\n\t\t\tc += (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn sum + c;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gsumkbn\n*\n* @example\n* var gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumkbn = require( '@stdlib/blas/ext/base/gsumkbn' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gsumkbn = require( './../../../../ext/base/gsumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsum( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsum( N, x, stride ) {\n\treturn gsumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar gsumkbn = require( './../../../../ext/base/gsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsum( N, x, stride, offset ) {\n\treturn gsumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements.\n*\n* @module @stdlib/blas/ext/base/gsum\n*\n* @example\n* var gsum = require( '@stdlib/blas/ext/base/gsum' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsum = require( '@stdlib/blas/ext/base/gsum' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = sum + v;\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = (sum-t) + v;\n\t\t} else {\n\t\t\tc = (v-t) + sum;\n\t\t}\n\t\tsum = t;\n\t\tt = cs + c;\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = (cs-t) + c;\n\t\t} else {\n\t\t\tcc = (c-t) + cs;\n\t\t}\n\t\tcs = t;\n\t\tccs += cc;\n\t\tix += stride;\n\t}\n\treturn sum + cs + ccs;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/gsumkbn2\n*\n* @example\n* var gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumkbn2 = require( '@stdlib/blas/ext/base/gsumkbn2' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumors( N, x, stride ) {\n\tvar ix;\n\tvar m;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ts += x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn s;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ts += x[i] + x[i+1] + x[i+2] + x[i+3] + x[i+4] + x[i+5];\n\t\t}\n\t\treturn s;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ts += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 6;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumors( N, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar s;\n\tvar i;\n\n\ts = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn s;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\n\t// If the stride is equal to `1`, use unrolled loops...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn s;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ts += x[ix] + x[ix+1] + x[ix+2] + x[ix+3] + x[ix+4] + x[ix+5];\n\t\t\tix += M;\n\t\t}\n\t\treturn s;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ts += x[ ix ];\n\t\tix += stride;\n\t}\n\treturn s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/gsumors\n*\n* @example\n* var gsumors = require( '@stdlib/blas/ext/base/gsumors' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumors = require( '@stdlib/blas/ext/base/gsumors' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction gsumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn gsumpw( n, x, stride, ix ) + gsumpw( N-n, x, stride, ix+(n*stride) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction gsumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/gsumpw\n*\n* @example\n* var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' );\n*\n* var x = [ 1.0, -2.0, 2.0 ];\n* var N = x.length;\n*\n* var v = gsumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' );\n*\n* var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];\n* var N = floor( x.length / 2 );\n*\n* var v = gsumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a single-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\nfunction sapx( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] += alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] += alpha;\n\t\t\tx[ i+1 ] += alpha;\n\t\t\tx[ i+2 ] += alpha;\n\t\t\tx[ i+3 ] += alpha;\n\t\t\tx[ i+4 ] += alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each element in a single-precision floating-point strided array.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n* var alpha = 5.0;\n*\n* sapx( 3, alpha, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 1.0, 10.0, -1.0 ]\n*/\nfunction sapx( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 0.0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] += alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] += alpha;\n\t\t\tx[ ix+1 ] += alpha;\n\t\t\tx[ ix+2 ] += alpha;\n\t\t\tx[ ix+3 ] += alpha;\n\t\t\tx[ ix+4 ] += alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] += alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapx = require( './sapx.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapx, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each element in a single-precision floating-point strided array.\n*\n* @module @stdlib/blas/ext/base/sapx\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapx = require( '@stdlib/blas/ext/base/sapx' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sapx( x.length, 5.0, x, 1 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapx = require( '@stdlib/blas/ext/base/sapx' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sapx.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 3.0, 6.0, 8.0, 0.0, 9.0, 5.0, 4.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapx;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapx = main;\n} else {\n\tsapx = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapx;\n\n// exports: { \"ndarray\": \"sapx.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumkbn( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumkbn( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumkbn = require( './sapxsumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/sapxsumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumkbn = require( '@stdlib/blas/ext/base/sapxsumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumkbn = main;\n} else {\n\tsapxsumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn;\n\n// exports: { \"ndarray\": \"sapxsumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sapxsumkbn = require( './../../../../ext/base/sapxsumkbn' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsum( N, alpha, x, stride ) {\n\treturn sapxsumkbn( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sapxsumkbn = require( './../../../../ext/base/sapxsumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsum( N, alpha, x, stride, offset ) {\n\treturn sapxsumkbn( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsum = require( './sapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum.\n*\n* @module @stdlib/blas/ext/base/sapxsum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsum = require( '@stdlib/blas/ext/base/sapxsum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsum = require( '@stdlib/blas/ext/base/sapxsum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsum = main;\n} else {\n\tsapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsum;\n\n// exports: { \"ndarray\": \"sapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumkbn2( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn2( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumkbn2( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = float64ToFloat32( alpha + x[ ix ] );\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumkbn2 = require( './sapxsumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/sapxsumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumkbn2( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumkbn2 = require( '@stdlib/blas/ext/base/sapxsumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumkbn2.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumkbn2 = main;\n} else {\n\tsapxsumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumkbn2;\n\n// exports: { \"ndarray\": \"sapxsumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumors( N, alpha, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + float64ToFloat32( alpha+x[ ix ] ) );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumors( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumors( N, alpha, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + float64ToFloat32( alpha+x[ ix ] ) );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumors = require( './sapxsumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/sapxsumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumors( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumors.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumors = main;\n} else {\n\tsapxsumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumors;\n\n// exports: { \"ndarray\": \"sapxsumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = float64ToFloat32( alpha + x[ ix ] );\n\t\ts1 = float64ToFloat32( alpha + x[ ix+stride ] );\n\t\ts2 = float64ToFloat32( alpha + x[ ix+(2*stride) ] );\n\t\ts3 = float64ToFloat32( alpha + x[ ix+(3*stride) ] );\n\t\ts4 = float64ToFloat32( alpha + x[ ix+(4*stride) ] );\n\t\ts5 = float64ToFloat32( alpha + x[ ix+(5*stride) ] );\n\t\ts6 = float64ToFloat32( alpha + x[ ix+(6*stride) ] );\n\t\ts7 = float64ToFloat32( alpha + x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = float64ToFloat32( s0 + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\ts1 = float64ToFloat32( s1 + float64ToFloat32( alpha + x[ ix+stride ] ) );\n\t\t\ts2 = float64ToFloat32( s2 + float64ToFloat32( alpha + x[ ix+(2*stride) ] ) );\n\t\t\ts3 = float64ToFloat32( s3 + float64ToFloat32( alpha + x[ ix+(3*stride) ] ) );\n\t\t\ts4 = float64ToFloat32( s4 + float64ToFloat32( alpha + x[ ix+(4*stride) ] ) );\n\t\t\ts5 = float64ToFloat32( s5 + float64ToFloat32( alpha + x[ ix+(5*stride) ] ) );\n\t\t\ts6 = float64ToFloat32( s6 + float64ToFloat32( alpha + x[ ix+(6*stride) ] ) );\n\t\t\ts7 = float64ToFloat32( s7 + float64ToFloat32( alpha + x[ ix+(7*stride) ] ) );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) );\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sapxsumpw( n, alpha, x, stride, ix ) + sapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + float64ToFloat32( alpha + x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sapxsumpw = require( './sapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/sapxsumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sapxsumpw = require( '@stdlib/blas/ext/base/sapxsumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsapxsumpw = main;\n} else {\n\tsapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sapxsumpw;\n\n// exports: { \"ndarray\": \"sapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sasumpw( N, x, 2, 1 );\n* // returns 9.0\n*/\nfunction sasumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + abs( x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = abs( x[ ix ] );\n\t\ts1 = abs( x[ ix+stride ] );\n\t\ts2 = abs( x[ ix+(2*stride) ] );\n\t\ts3 = abs( x[ ix+(3*stride) ] );\n\t\ts4 = abs( x[ ix+(4*stride) ] );\n\t\ts5 = abs( x[ ix+(5*stride) ] );\n\t\ts6 = abs( x[ ix+(6*stride) ] );\n\t\ts7 = abs( x[ ix+(7*stride) ] );\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = float64ToFloat32( s0 + abs( x[ ix ] ) );\n\t\t\ts1 = float64ToFloat32( s1 + abs( x[ ix+stride ] ) );\n\t\t\ts2 = float64ToFloat32( s2 + abs( x[ ix+(2*stride) ] ) );\n\t\t\ts3 = float64ToFloat32( s3 + abs( x[ ix+(3*stride) ] ) );\n\t\t\ts4 = float64ToFloat32( s4 + abs( x[ ix+(4*stride) ] ) );\n\t\t\ts5 = float64ToFloat32( s5 + abs( x[ ix+(5*stride) ] ) );\n\t\t\ts6 = float64ToFloat32( s6 + abs( x[ ix+(6*stride) ] ) );\n\t\t\ts7 = float64ToFloat32( s7 + abs( x[ ix+(7*stride) ] ) );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) ); // eslint-disable-line max-len\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + abs( x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sasumpw( n, x, stride, ix ) + sasumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of absolute values (L1 norm) of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sasumpw( N, x, 1 );\n* // returns 5.0\n*/\nfunction sasumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn abs( x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + abs( x[ ix ] ) );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sasumpw = require( './sasumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sasumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of absolute values (L1 norm) of single-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/sasumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sasumpw = require( '@stdlib/blas/ext/base/sasumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sasumpw( N, x, 1 );\n* // returns 5.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sasumpw = require( '@stdlib/blas/ext/base/sasumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sasumpw.ndarray( N, x, 2, 1 );\n* // returns 9.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sasumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsasumpw = main;\n} else {\n\tsasumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sasumpw;\n\n// exports: { \"ndarray\": \"sasumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumkbn( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumkbn( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( s + v );\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( s-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + s ) ); // eslint-disable-line max-len\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = float64ToFloat32( s + c );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumkbn( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\ts = sum;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( s + v );\n\t\tif ( abs( s ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( s-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + s ) ); // eslint-disable-line max-len\n\t\t}\n\t\ts = t;\n\t\ty[ iy ] = float64ToFloat32( s + c );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumkbn = require( './scusumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/scusumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumkbn( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumkbn = require( '@stdlib/blas/ext/base/scusumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumkbn.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumkbn = main;\n} else {\n\tscusumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn;\n\n// exports: { \"ndarray\": \"scusumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar scusumkbn = require( './../../../../ext/base/scusumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusum( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusum( N, sum, x, strideX, y, strideY ) {\n\treturn scusumkbn( N, sum, x, strideX, y, strideY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar scusumkbn = require( './../../../../ext/base/scusumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusum( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusum( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\treturn scusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY );\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusum = require( './scusum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/scusum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusum = require( '@stdlib/blas/ext/base/scusum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusum( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusum = require( '@stdlib/blas/ext/base/scusum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusum.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusum = main;\n} else {\n\tscusum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusum;\n\n// exports: { \"ndarray\": \"scusum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumkbn2( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumkbn2( N, sum, x, strideX, y, strideY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\n\t\ty[ iy ] = float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumkbn2( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumkbn2( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ccs;\n\tvar ix;\n\tvar iy;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\n\t\ty[ iy ] = float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumkbn2 = require( './scusumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/scusumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumkbn2( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumkbn2 = require( '@stdlib/blas/ext/base/scusumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumkbn2.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumkbn2 = main;\n} else {\n\tscusumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumkbn2;\n\n// exports: { \"ndarray\": \"scusumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumors( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumors( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumors( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumors( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\ty[ iy ] = sum;\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumors = require( './scusumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/scusumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumors = require( '@stdlib/blas/ext/base/scusumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumors( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumors = require( '@stdlib/blas/ext/base/scusumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumors.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumors = main;\n} else {\n\tscusumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumors;\n\n// exports: { \"ndarray\": \"scusumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation:\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting index for `x`\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting index for `y`\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* var v = scusumpw( N, 0.0, x, 2, 1, y, 1, 0 );\n* // returns [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\nfunction scusumpw( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\tif ( N <= BLOCKSIZE ) {\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\ty[ iy ] = float64ToFloat32( sum + s );\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t\treturn y;\n\t}\n\tn = floor( N/2 );\n\tscusumpw( n, sum, x, strideX, ix, y, strideY, iy );\n\tiy += (n-1) * strideY;\n\tscusumpw( N-n, y[ iy ], x, strideX, ix+(n*strideX), y, strideY, iy+strideY ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar cusum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the cumulative sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} sum - initial sum\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* var v = scusumpw( N, 0.0, x, 1, y, 1 );\n* // returns [ 1.0, -1.0, 1.0 ]\n*/\nfunction scusumpw( N, sum, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\treturn cusum( N, sum, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar scusumpw = require( './scusumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scusumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the cumulative sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/scusumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var scusumpw = require( '@stdlib/blas/ext/base/scusumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var y = new Float32Array( x.length );\n* var N = x.length;\n*\n* scusumpw( N, 0.0, x, 1, y, 1 );\n* // y => [ 1.0, -1.0, 1.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var scusumpw = require( '@stdlib/blas/ext/base/scusumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var y = new Float32Array( x.length );\n* var N = floor( x.length / 2 );\n*\n* scusumpw.ndarray( N, 0.0, x, 2, 1, y, 1, 0 );\n* // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scusumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscusumpw = main;\n} else {\n\tscusumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scusumpw;\n\n// exports: { \"ndarray\": \"scusumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsumpw( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sdsapxsumpw( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ offset ] );\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = alpha + x[ ix ];\n\t\ts1 = alpha + x[ ix+stride ];\n\t\ts2 = alpha + x[ ix+(2*stride) ];\n\t\ts3 = alpha + x[ ix+(3*stride) ];\n\t\ts4 = alpha + x[ ix+(4*stride) ];\n\t\ts5 = alpha + x[ ix+(5*stride) ];\n\t\ts6 = alpha + x[ ix+(6*stride) ];\n\t\ts7 = alpha + x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += alpha + x[ ix ];\n\t\t\ts1 += alpha + x[ ix+stride ];\n\t\t\ts2 += alpha + x[ ix+(2*stride) ];\n\t\t\ts3 += alpha + x[ ix+(3*stride) ];\n\t\t\ts4 += alpha + x[ ix+(4*stride) ];\n\t\t\ts5 += alpha + x[ ix+(5*stride) ];\n\t\t\ts6 += alpha + x[ ix+(6*stride) ];\n\t\t\ts7 += alpha + x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sdsapxsumpw( n, alpha, x, stride, ix ) + sdsapxsumpw( N-n, alpha, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sdsapxsumpw( N, alpha, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn float64ToFloat32( alpha + x[ 0 ] );\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += alpha + x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\treturn sum( N, alpha, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsapxsumpw = require( './sdsapxsumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsapxsumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation with extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsapxsumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsumpw( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsapxsumpw = require( '@stdlib/blas/ext/base/sdsapxsumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsumpw.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsapxsumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsapxsumpw = main;\n} else {\n\tsdsapxsumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsumpw;\n\n// exports: { \"ndarray\": \"sdsapxsumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsapxsumpw = require( './../../../../ext/base/sdsapxsumpw' );\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*/\nfunction sdsapxsum( N, alpha, x, stride ) {\n\treturn sdsapxsumpw( N, alpha, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsapxsumpw = require( './../../../../ext/base/sdsapxsumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Adds a constant to each single-precision floating-point strided array element and computes the sum using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - constant\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsum( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\nfunction sdsapxsum( N, alpha, x, stride, offset ) {\n\treturn sdsapxsumpw( N, alpha, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsapxsum = require( './sdsapxsum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsapxsum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Add a constant to each single-precision floating-point strided array element and compute the sum using extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsapxsum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsapxsum( N, 5.0, x, 1 );\n* // returns 16.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsapxsum = require( '@stdlib/blas/ext/base/sdsapxsum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsapxsum.ndarray( N, 5.0, x, 2, 1 );\n* // returns 25.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsapxsum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsapxsum = main;\n} else {\n\tsdsapxsum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsapxsum;\n\n// exports: { \"ndarray\": \"sdsapxsum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdsnansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts1 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts2 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts3 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts4 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts5 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts6 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t\ts7 += ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sdsnansumpw( n, x, stride, ix ) + sdsnansumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdsnansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts += x[ ix ];\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsnansumpw = require( './sdsnansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsnansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation with extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsnansumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsnansumpw = require( '@stdlib/blas/ext/base/sdsnansumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsnansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsnansumpw = main;\n} else {\n\tsdsnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansumpw;\n\n// exports: { \"ndarray\": \"sdsnansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsnansumpw = require( './../../../../ext/base/sdsnansumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdsnansum( N, x, stride ) {\n\treturn sdsnansumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdsnansumpw = require( './../../../../ext/base/sdsnansumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdsnansum( N, x, stride, offset ) {\n\treturn sdsnansumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdsnansum = require( './sdsnansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdsnansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdsnansum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdsnansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdsnansum = require( '@stdlib/blas/ext/base/sdsnansum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdsnansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdsnansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdsnansum = main;\n} else {\n\tsdsnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdsnansum;\n\n// exports: { \"ndarray\": \"sdsnansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdssumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 += x[ ix ];\n\t\t\ts1 += x[ ix+stride ];\n\t\t\ts2 += x[ ix+(2*stride) ];\n\t\t\ts3 += x[ ix+(3*stride) ];\n\t\t\ts4 += x[ ix+(4*stride) ];\n\t\t\ts5 += x[ ix+(5*stride) ];\n\t\t\ts6 += x[ ix+(6*stride) ];\n\t\t\ts7 += x[ ix+(7*stride) ];\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = ((s0+s1) + (s2+s3)) + ((s4+s5) + (s6+s7));\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( sdssumpw( n, x, stride, ix ) + sdssumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdssumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts += x[ ix ];\n\t\t\tix += stride;\n\t\t}\n\t\treturn float64ToFloat32( s );\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdssumpw = require( './sdssumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdssumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdssumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdssumpw = require( '@stdlib/blas/ext/base/sdssumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdssumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdssumpw = main;\n} else {\n\tsdssumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssumpw;\n\n// exports: { \"ndarray\": \"sdssumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdssumpw = require( './../../../../ext/base/sdssumpw' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssum( N, x, 1 );\n* // returns 1.0\n*/\nfunction sdssum( N, x, stride ) {\n\treturn sdssumpw( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sdssumpw = require( './../../../../ext/base/sdssumpw' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using extended accumulation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction sdssum( N, x, stride, offset ) {\n\treturn sdssumpw( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sdssum = require( './sdssum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sdssum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using extended accumulation.\n*\n* @module @stdlib/blas/ext/base/sdssum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sdssum = require( '@stdlib/blas/ext/base/sdssum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = sdssum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var sdssum = require( '@stdlib/blas/ext/base/sdssum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = sdssum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sdssum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsdssum = main;\n} else {\n\tsdssum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdssum;\n\n// exports: { \"ndarray\": \"sdssum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a single-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction sfill( N, alpha, x, stride ) {\n\tvar ix;\n\tvar i;\n\tvar m;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ i ] = alpha;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ i ] = alpha;\n\t\t\tx[ i+1 ] = alpha;\n\t\t\tx[ i+2 ] = alpha;\n\t\t\tx[ i+3 ] = alpha;\n\t\t\tx[ i+4 ] = alpha;\n\t\t\tx[ i+5 ] = alpha;\n\t\t\tx[ i+6 ] = alpha;\n\t\t\tx[ i+7 ] = alpha;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a single-precision floating-point strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* sfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction sfill( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar sfill = require( './sfill.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( sfill, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a single-precision floating-point strided array with a specified scalar constant.\n*\n* @module @stdlib/blas/ext/base/sfill\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sfill = require( '@stdlib/blas/ext/base/sfill' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var sfill = require( '@stdlib/blas/ext/base/sfill' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* sfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar sfill;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsfill = main;\n} else {\n\tsfill = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sfill;\n\n// exports: { \"ndarray\": \"sfill.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = sum + v;\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\tsum = t;\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumkbn = require( './snansumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/snansumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumkbn = require( '@stdlib/blas/ext/base/snansumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumkbn = main;\n} else {\n\tsnansumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn;\n\n// exports: { \"ndarray\": \"snansumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar snansumkbn = require( './../../../../ext/base/snansumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansum( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansum( N, x, stride ) {\n\treturn snansumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar snansumkbn = require( './../../../../ext/base/snansumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansum( N, x, stride, offset ) {\n\treturn snansumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansum = require( './snansum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values.\n*\n* @module @stdlib/blas/ext/base/snansum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansum = require( '@stdlib/blas/ext/base/snansum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansum = require( '@stdlib/blas/ext/base/snansum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansum = main;\n} else {\n\tsnansum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansum;\n\n// exports: { \"ndarray\": \"snansum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = float64ToFloat32( sum + v );\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = float64ToFloat32( cs + c );\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(cs-t) + c );\n\t\t\t} else {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(c-t) + cs );\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs = float64ToFloat32( ccs + cc );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs + ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tif ( isnanf( v ) === false ) {\n\t\t\tt = float64ToFloat32( sum + v );\n\t\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t\t} else {\n\t\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t\t}\n\t\t\tsum = t;\n\t\t\tt = float64ToFloat32( cs + c );\n\t\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(cs-t) + c );\n\t\t\t} else {\n\t\t\t\tcc = float64ToFloat32( float64ToFloat32(c-t) + cs );\n\t\t\t}\n\t\t\tcs = t;\n\t\t\tccs = float64ToFloat32( ccs + cc );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs + ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumkbn2 = require( './snansumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/snansumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumkbn2 = require( '@stdlib/blas/ext/base/snansumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumkbn2 = main;\n} else {\n\tsnansumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumkbn2;\n\n// exports: { \"ndarray\": \"snansumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn sum;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\t}\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumors = require( './snansumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/snansumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumors = require( '@stdlib/blas/ext/base/snansumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumors = require( '@stdlib/blas/ext/base/snansumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumors = main;\n} else {\n\tsnansumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumors;\n\n// exports: { \"ndarray\": \"snansumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction snansumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ offset ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts1 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts2 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts3 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts4 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts5 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts6 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\t\ts7 = ( isnanf( x[ ix ] ) ) ? 0.0 : x[ ix ];\n\t\tix += stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = ( isnanf( x[ ix ] ) ) ? s0 : float64ToFloat32( s0 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts1 = ( isnanf( x[ ix ] ) ) ? s1 : float64ToFloat32( s1 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts2 = ( isnanf( x[ ix ] ) ) ? s2 : float64ToFloat32( s2 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts3 = ( isnanf( x[ ix ] ) ) ? s3 : float64ToFloat32( s3 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts4 = ( isnanf( x[ ix ] ) ) ? s4 : float64ToFloat32( s4 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts5 = ( isnanf( x[ ix ] ) ) ? s5 : float64ToFloat32( s5 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts6 = ( isnanf( x[ ix ] ) ) ? s6 : float64ToFloat32( s6 + x[ ix ] );\n\t\t\tix += stride;\n\t\t\ts7 = ( isnanf( x[ ix ] ) ) ? s7 : float64ToFloat32( s7 + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) ); // eslint-disable-line max-len\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( snansumpw( n, x, stride, ix ) + snansumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction snansumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\tif ( isnanf( x[ 0 ] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( isnanf( x[ ix ] ) === false ) {\n\t\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\t}\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar snansumpw = require( './snansumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( snansumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements, ignoring `NaN` values and using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/snansumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var snansumpw = require( '@stdlib/blas/ext/base/snansumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, NaN, 2.0 ] );\n* var N = x.length;\n*\n* var v = snansumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var snansumpw = require( '@stdlib/blas/ext/base/snansumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );\n* var N = floor( x.length / 2 );\n*\n* var v = snansumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar snansumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsnansumpw = main;\n} else {\n\tsnansumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = snansumpw;\n\n// exports: { \"ndarray\": \"snansumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a single-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\nfunction srev( N, x, stride ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( ix = 0; ix < m; ix++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tiy -= 1;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( ix = m; ix < n; ix += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a single-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n*\n* srev( 3, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]\n*/\nfunction srev( N, x, stride, offset ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\tix = offset;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = n % M;\n\t\tiy = ix + N - 1;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tix += stride;\n\t\t\t\tiy -= stride;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < n; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tiy = ix + ((N-1)*stride);\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += stride;\n\t\tiy -= stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar srev = require( './srev.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( srev, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Reverse a single-precision floating-point strided array in-place.\n*\n* @module @stdlib/blas/ext/base/srev\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var srev = require( '@stdlib/blas/ext/base/srev' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var srev = require( '@stdlib/blas/ext/base/srev' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1, 0 );\n* // x => [ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar srev;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsrev = main;\n} else {\n\tsrev = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n\n// exports: { \"ndarray\": \"srev.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2hp( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnanf( v1 ) || ( v1 === tx && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2hp( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar tx;\n\tvar ty;\n\tvar ix;\n\tvar iy;\n\tvar n;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\ttx = x[ offsetX+(parent*strideX) ];\n\t\t\tty = y[ offsetY+(parent*strideY) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\tix = offsetX + (n*strideX);\n\t\t\ttx = x[ ix ];\n\t\t\tiy = offsetY + (n*strideY);\n\t\t\tty = y[ iy ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ ix ] = x[ offsetX ];\n\t\t\ty[ iy ] = y[ offsetY ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offsetX+(k*strideX) ];\n\t\t\t\tv2 = x[ offsetX+(child*strideX) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offsetX+(child*strideX) ];\n\t\t\tif ( v1 > tx || isnanf( v1 ) || ( v1 === tx && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offsetX+(j*strideX) ] = v1;\n\t\t\t\ty[ offsetY+(j*strideY) ] = y[ offsetY+(child*strideY) ];\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offsetX+(j*strideX) ] = tx;\n\t\ty[ offsetY+(j*strideY) ] = ty;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssort2hp = require( './ssort2hp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssort2hp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using heapsort.\n*\n* @module @stdlib/blas/ext/base/ssort2hp\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2hp = require( '@stdlib/blas/ext/base/ssort2hp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2hp( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssort2hp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssort2hp = main;\n} else {\n\tssort2hp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2hp;\n\n// exports: { \"ndarray\": \"ssort2hp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2ins( N, order, x, strideX, y, strideY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideY < 0 ) {\n\t\tfy = (1-N) * strideY;\n\t\tly = 0;\n\t} else {\n\t\tfy = 0;\n\t\tly = (N-1) * strideY;\n\t}\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * strideX; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + strideX;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * strideX; // last index\n\tix = fx + strideX;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2ins( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar iy;\n\tvar jy;\n\tvar fy;\n\tvar ly;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfx = offsetX; // first index\n\tlx = fx + ((N-1)*strideX); // last index\n\tix = fx + strideX;\n\n\tfy = offsetY; // first index\n\tly = fy + ((N-1)*strideY); // last index\n\tiy = fy + strideY;\n\n\tif ( strideX < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tvx = x[ ix ];\n\t\t\tvy = y[ iy ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tjx = ix;\n\t\t\t\tjy = iy;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\t\tjx += strideX;\n\t\t\t\t\tjy += strideY;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = vx;\n\t\t\t\ty[ ly ] = vy;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( vx );\n\t\t\t\tjx = ix - strideX;\n\t\t\t\tjy = iy - strideY;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tux = x[ jx ];\n\t\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\t\tjx -= strideX;\n\t\t\t\t\tjy -= strideY;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = vx;\n\t\t\t\ty[ jy+strideY ] = vy;\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tvx = x[ ix ];\n\t\tvy = y[ iy ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( vx ) ) {\n\t\t\tjx = ix;\n\t\t\tjy = iy;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+strideX ];\n\t\t\t\ty[ jy ] = y[ jy+strideY ];\n\t\t\t\tjx += strideX;\n\t\t\t\tjy += strideY;\n\t\t\t}\n\t\t\tx[ lx ] = vx;\n\t\t\ty[ ly ] = vy;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tjx = ix - strideX;\n\t\t\tjy = iy - strideY;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tux = x[ jx ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx && isNegativeZerof( ux ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+strideX ] = ux;\n\t\t\t\ty[ jy+strideY ] = y[ jy ];\n\t\t\t\tjx -= strideX;\n\t\t\t\tjy -= strideY;\n\t\t\t}\n\t\t\tx[ jx+strideX ] = vx;\n\t\t\ty[ jy+strideY ] = vy;\n\t\t\tix += strideX;\n\t\t\tiy += strideY;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssort2ins = require( './ssort2ins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssort2ins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/ssort2ins\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2ins = require( '@stdlib/blas/ext/base/ssort2ins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2ins( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssort2ins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssort2ins = main;\n} else {\n\tssort2ins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2ins;\n\n// exports: { \"ndarray\": \"ssort2ins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2sh( N, order, x, strideX, y, strideY ) {\n\tvar offsetX;\n\tvar offsetY;\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t}\n\tif ( strideX < 0 ) {\n\t\toffsetX = (1-N) * strideX;\n\t} else {\n\t\toffsetX = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\toffsetY = (1-N) * strideY;\n\t} else {\n\t\toffsetY = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Simultaneously sorts two single-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - first input array\n* @param {integer} strideX - `x` index increment\n* @param {NonNegativeInteger} offsetX - `x` starting index\n* @param {Float32Array} y - second input array\n* @param {integer} strideY - `y` index increment\n* @param {NonNegativeInteger} offsetY - `y` starting index\n* @returns {Float32Array} `x`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\nfunction ssort2sh( N, order, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar flg;\n\tvar gap;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstrideX *= -1;\n\t\tstrideY *= -1;\n\t\toffsetX -= (N-1) * strideX;\n\t\toffsetY -= (N-1) * strideY;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tvx = x[ offsetX+(j*strideX) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( vx ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvy = y[ offsetY+(j*strideY) ];\n\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( vx );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tux = x[ offsetX+((k-gap)*strideX) ];\n\t\t\t\tif ( ux <= vx && !(flg && ux === vx) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offsetX+(k*strideX) ] = ux;\n\t\t\t\ty[ offsetY+(k*strideY) ] = y[ offsetY+((k-gap)*strideY) ];\n\t\t\t}\n\t\t\tx[ offsetX+(k*strideX) ] = vx;\n\t\t\ty[ offsetY+(k*strideY) ] = vy;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssort2sh = require( './ssort2sh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssort2sh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Simultaneously sort two single-precision floating-point strided arrays based on the sort order of the first array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/ssort2sh\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, y, 1 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssort2sh = require( '@stdlib/blas/ext/base/ssort2sh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n* var y = new Float32Array( [ 0.0, 1.0, 2.0, 3.0 ] );\n*\n* ssort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );\n*\n* console.log( x );\n* // => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* console.log( y );\n* // => [ 3.0, 1.0, 0.0, 2.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssort2sh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssort2sh = main;\n} else {\n\tssort2sh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssort2sh;\n\n// exports: { \"ndarray\": \"ssort2sh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssorthp( N, order, x, stride ) {\n\tvar offset;\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnanf( v1 ) || ( v1 === t && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using heapsort.\n*\n* ## Notes\n*\n* - This implementation uses an in-place algorithm derived from the work of Floyd (1964).\n*\n* ## References\n*\n* - Williams, John William Joseph. 1964. \"Algorithm 232: Heapsort.\" _Communications of the ACM_ 7 (6). New York, NY, USA: Association for Computing Machinery: 347\u201349. doi:[10.1145/512274.512284](https://doi.org/10.1145/512274.512284).\n* - Floyd, Robert W. 1964. \"Algorithm 245: Treesort.\" _Communications of the ACM_ 7 (12). New York, NY, USA: Association for Computing Machinery: 701. doi:[10.1145/355588.365103](https://doi.org/10.1145/355588.365103).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssorthp( N, order, x, stride, offset ) {\n\tvar parent;\n\tvar child;\n\tvar v1;\n\tvar v2;\n\tvar n;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\t// Set the initial heap size:\n\tn = N;\n\n\t// Specify an initial \"parent\" index for building the heap:\n\tparent = floor( N / 2 );\n\n\t// Continue looping until the array is sorted...\n\twhile ( true ) {\n\t\tif ( parent > 0 ) {\n\t\t\t// We need to build the heap...\n\t\t\tparent -= 1;\n\t\t\tt = x[ offset+(parent*stride) ];\n\t\t} else {\n\t\t\t// Reduce the heap size:\n\t\t\tn -= 1;\n\n\t\t\t// Check if the heap is empty, and, if so, we are finished sorting...\n\t\t\tif ( n === 0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t\t// Store the last heap value in a temporary variable in order to make room for the heap root being placed into its sorted position:\n\t\t\ti = offset + (n*stride);\n\t\t\tt = x[ i ];\n\n\t\t\t// Move the heap root to its sorted position:\n\t\t\tx[ i ] = x[ offset ];\n\t\t}\n\t\t// We need to \"sift down\", pushing `t` down the heap to in order to replace the parent and satisfy the heap property...\n\n\t\t// Start at the parent index:\n\t\tj = parent;\n\n\t\t// Get the \"left\" child index:\n\t\tchild = (j*2) + 1;\n\n\t\twhile ( child < n ) {\n\t\t\t// Find the largest child...\n\t\t\tk = child + 1;\n\t\t\tif ( k < n ) {\n\t\t\t\tv1 = x[ offset+(k*stride) ];\n\t\t\t\tv2 = x[ offset+(child*stride) ];\n\n\t\t\t\t// Check if a \"right\" child exists and is \"bigger\"...\n\t\t\t\tif ( v1 > v2 || isnanf( v1 ) || (v1 === v2 && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t\tchild += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check if the largest child is bigger than `t`...\n\t\t\tv1 = x[ offset+(child*stride) ];\n\t\t\tif ( v1 > t || isnanf( v1 ) || ( v1 === t && isPositiveZerof( v1 ) ) ) { // eslint-disable-line max-len\n\t\t\t\t// Insert the larger child value:\n\t\t\t\tx[ offset+(j*stride) ] = v1;\n\n\t\t\t\t// Update `j` to point to the child index:\n\t\t\t\tj = child;\n\n\t\t\t\t// Get the \"left\" child index and repeat...\n\t\t\t\tchild = (j*2) + 1;\n\t\t\t} else {\n\t\t\t\t// We've found `t`'s place in the heap...\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Insert `t` into the heap:\n\t\tx[ offset+(j*stride) ] = t;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssorthp = require( './ssorthp.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssorthp, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a single-precision floating-point strided array using heapsort.\n*\n* @module @stdlib/blas/ext/base/ssorthp\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssorthp = require( '@stdlib/blas/ext/base/ssorthp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssorthp = require( '@stdlib/blas/ext/base/ssorthp' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssorthp.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssorthp;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssorthp = main;\n} else {\n\tssorthp = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssorthp;\n\n// exports: { \"ndarray\": \"ssorthp.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortins( N, order, x, stride ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\t\tfx = (1-N) * stride; // first index\n\t\tlx = 0; // last index\n\t\tix = fx + stride;\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\tfx = 0; // first index\n\tlx = (N-1) * stride; // last index\n\tix = fx + stride;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using insertion sort.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortins( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar ix;\n\tvar jx;\n\tvar fx;\n\tvar lx;\n\tvar v;\n\tvar u;\n\tvar i;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfx = offset; // first index\n\tlx = fx + ((N-1)*stride); // last index\n\tix = fx + stride;\n\n\tif ( stride < 0 ) {\n\t\t// Traverse the strided array from right-to-left...\n\n\t\t// Sort in increasing order...\n\t\tfor ( i = 1; i < N; i++ ) {\n\t\t\tv = x[ ix ];\n\n\t\t\t// Sort `NaN` values to the end (i.e., the left)...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tjx = ix;\n\n\t\t\t\t// Shift all values (including NaNs) to the left of the current element to the right...\n\t\t\t\twhile ( jx > lx ) {\n\t\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\t\tjx += stride;\n\t\t\t\t}\n\t\t\t\tx[ lx ] = v;\n\t\t\t} else {\n\t\t\t\tflg = isNegativeZerof( v );\n\t\t\t\tjx = ix - stride;\n\n\t\t\t\t// Shift all larger values to the right of the current element to the left...\n\t\t\t\twhile ( jx <= fx ) {\n\t\t\t\t\tu = x[ jx ];\n\t\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when last element is NaN)) are sorted to the left\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\t\tjx -= stride;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = v;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}\n\t// Traverse the strided array from left-to-right...\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < N; i++ ) {\n\t\tv = x[ ix ];\n\n\t\t// Sort `NaN` values to the end...\n\t\tif ( isnanf( v ) ) {\n\t\t\tjx = ix;\n\n\t\t\t// Shift all values (including NaNs) to the right of the current element to the left...\n\t\t\twhile ( jx < lx ) {\n\t\t\t\tx[ jx ] = x[ jx+stride ];\n\t\t\t\tjx += stride;\n\t\t\t}\n\t\t\tx[ lx ] = v;\n\t\t} else {\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tjx = ix - stride;\n\n\t\t\t// Shift all larger values to the left of the current element to the right...\n\t\t\twhile ( jx >= fx ) {\n\t\t\t\tu = x[ jx ];\n\t\t\t\tif ( u <= v && !(flg && u === v && isNegativeZerof( u ) === false) ) { // eslint-disable-line max-len\n\t\t\t\t\t// Note: positive zeros (and NaNs (e.g., when first element is NaN)) are sorted to the right\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ jx+stride ] = u;\n\t\t\t\tjx -= stride;\n\t\t\t}\n\t\t\tx[ jx+stride ] = v;\n\t\t\tix += stride;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssortins = require( './ssortins.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssortins, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a single-precision floating-point strided array using insertion sort.\n*\n* @module @stdlib/blas/ext/base/ssortins\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortins = require( '@stdlib/blas/ext/base/ssortins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortins = require( '@stdlib/blas/ext/base/ssortins' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortins.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssortins;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssortins = main;\n} else {\n\tssortins = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortins;\n\n// exports: { \"ndarray\": \"ssortins.ndarray\" }\n", "[701,301,132,57,23,10,4,1]\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortsh( N, order, x, stride ) {\n\tvar offset;\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t}\n\tif ( stride < 0 ) {\n\t\toffset = (1-N) * stride;\n\t} else {\n\t\toffset = 0;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );\nvar isnanf = require( '@stdlib/math/base/assert/is-nanf' );\nvar GAPS = require( './gaps.json' );\n\n\n// VARIABLES //\n\nvar NGAPS = GAPS.length;\n\n\n// MAIN //\n\n/**\n* Sorts a single-precision floating-point strided array using Shellsort.\n*\n* ## Notes\n*\n* - This implementation uses the gap sequence proposed by Ciura (2001).\n*\n* ## References\n*\n* - Shell, Donald L. 1959. \"A High-Speed Sorting Procedure.\" _Communications of the ACM_ 2 (7). Association for Computing Machinery: 30\u201332. doi:[10.1145/368370.368387](https://doi.org/10.1145/368370.368387).\n* - Ciura, Marcin. 2001. \"Best Increments for the Average Case of Shellsort.\" In _Fundamentals of Computation Theory_, 106\u201317. Springer Berlin Heidelberg. doi:[10.1007/3-540-44669-9\\_12](https://doi.org/10.1007/3-540-44669-9_12).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} order - sort order\n* @param {Float32Array} x - input array\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\nfunction ssortsh( N, order, x, stride, offset ) {\n\tvar flg;\n\tvar gap;\n\tvar v;\n\tvar u;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tif ( N <= 0 || order === 0.0 ) {\n\t\treturn x;\n\t}\n\t// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...\n\tif ( order < 0.0 ) {\n\t\tstride *= -1;\n\t\toffset -= (N-1) * stride;\n\t}\n\tfor ( i = 0; i < NGAPS; i++ ) {\n\t\tgap = GAPS[ i ];\n\t\tfor ( j = gap; j < N; j++ ) {\n\t\t\tv = x[ offset+(j*stride) ];\n\n\t\t\t// If `NaN`, the current value is already sorted to its place...\n\t\t\tif ( isnanf( v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Perform insertion sort on the \"gapped\" subarray...\n\t\t\tflg = isNegativeZerof( v );\n\t\t\tfor ( k = j; k >= gap; k -= gap ) {\n\t\t\t\tu = x[ offset+((k-gap)*stride) ];\n\t\t\t\tif ( u <= v && !(flg && u === v) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx[ offset+(k*stride) ] = u;\n\t\t\t}\n\t\t\tx[ offset+(k*stride) ] = v;\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssortsh = require( './ssortsh.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssortsh, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sort a single-precision floating-point strided array using Shellsort.\n*\n* @module @stdlib/blas/ext/base/ssortsh\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortsh = require( '@stdlib/blas/ext/base/ssortsh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh( x.length, 1.0, x, 1 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssortsh = require( '@stdlib/blas/ext/base/ssortsh' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0 ] );\n*\n* ssortsh.ndarray( x.length, 1.0, x, 1, 0 );\n* // x => [ -4.0, -2.0, 1.0, 3.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssortsh;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssortsh = main;\n} else {\n\tssortsh = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssortsh;\n\n// exports: { \"ndarray\": \"ssortsh.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumkbn( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses an \"improved Kahan\u2013Babu\u0161ka algorithm\", as described by Neumaier (1974).\n*\n* ## References\n*\n* - Neumaier, Arnold. 1974. \"Rounding Error Analysis of Some Methods for Summing Finite Sums.\" _Zeitschrift F\u00FCr Angewandte Mathematik Und Mechanik_ 54 (1): 39\u201351. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumkbn( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tc = 0.0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum + v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( sum-t ) + v ) ); // eslint-disable-line max-len\n\t\t} else {\n\t\t\tc = float64ToFloat32( c + float64ToFloat32( float64ToFloat32( v-t ) + sum ) ); // eslint-disable-line max-len\n\t\t}\n\t\tsum = t;\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + c );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumkbn = require( './ssumkbn.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumkbn, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using an improved Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/ssumkbn\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumkbn = require( '@stdlib/blas/ext/base/ssumkbn' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumkbn;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumkbn = main;\n} else {\n\tssumkbn = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn;\n\n// exports: { \"ndarray\": \"ssumkbn.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ssumkbn = require( './../../../../ext/base/ssumkbn' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssum( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssum( N, x, stride ) {\n\treturn ssumkbn( N, x, stride );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ssumkbn = require( './../../../../ext/base/ssumkbn' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssum( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssum( N, x, stride, offset ) {\n\treturn ssumkbn( N, x, stride, offset );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssum = require( './ssum.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssum, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements.\n*\n* @module @stdlib/blas/ext/base/ssum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssum = require( '@stdlib/blas/ext/base/ssum' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssum( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssum = require( '@stdlib/blas/ext/base/ssum' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssum.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssum;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssum = main;\n} else {\n\tssum = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssum;\n\n// exports: { \"ndarray\": \"ssum.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn2( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumkbn2( N, x, stride ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar abs = require( '@stdlib/math/base/special/abs' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* ## Method\n*\n* - This implementation uses a second-order iterative Kahan\u2013Babu\u0161ka algorithm, as described by Klein (2005).\n*\n* ## References\n*\n* - Klein, Andreas. 2005. \"A Generalized Kahan-Babu\u0161ka-Summation-Algorithm.\" _Computing_ 76 (3): 279\u201393. doi:[10.1007/s00607-005-0139-x](https://doi.org/10.1007/s00607-005-0139-x).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn2( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumkbn2( N, x, stride, offset ) {\n\tvar sum;\n\tvar ccs;\n\tvar ix;\n\tvar cs;\n\tvar cc;\n\tvar v;\n\tvar t;\n\tvar c;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tsum = 0.0;\n\tccs = 0.0; // second order correction term for lost low order bits\n\tcs = 0.0; // first order correction term for lost low order bits\n\tfor ( i = 0; i < N; i++ ) {\n\t\tv = x[ ix ];\n\t\tt = float64ToFloat32( sum+v );\n\t\tif ( abs( sum ) >= abs( v ) ) {\n\t\t\tc = float64ToFloat32( float64ToFloat32( sum-t ) + v );\n\t\t} else {\n\t\t\tc = float64ToFloat32( float64ToFloat32( v-t ) + sum );\n\t\t}\n\t\tsum = t;\n\t\tt = float64ToFloat32( cs+c );\n\t\tif ( abs( cs ) >= abs( c ) ) {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( cs-t ) + c );\n\t\t} else {\n\t\t\tcc = float64ToFloat32( float64ToFloat32( c-t ) + cs );\n\t\t}\n\t\tcs = t;\n\t\tccs = float64ToFloat32( ccs+cc );\n\t\tix += stride;\n\t}\n\treturn float64ToFloat32( sum + float64ToFloat32( cs+ccs ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumkbn2 = require( './ssumkbn2.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumkbn2, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using a second-order iterative Kahan\u2013Babu\u0161ka algorithm.\n*\n* @module @stdlib/blas/ext/base/ssumkbn2\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumkbn2( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumkbn2 = require( '@stdlib/blas/ext/base/ssumkbn2' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumkbn2.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumkbn2;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumkbn2 = main;\n} else {\n\tssumkbn2 = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumkbn2;\n\n// exports: { \"ndarray\": \"ssumkbn2.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumors( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumors( N, x, stride ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumors( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumors( N, x, stride, offset ) {\n\tvar sum;\n\tvar ix;\n\tvar i;\n\n\tsum = 0.0;\n\tif ( N <= 0 ) {\n\t\treturn sum;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tsum = float64ToFloat32( sum + x[ ix ] );\n\t\tix += stride;\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumors = require( './ssumors.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumors, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using ordinary recursive summation.\n*\n* @module @stdlib/blas/ext/base/ssumors\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumors = require( '@stdlib/blas/ext/base/ssumors' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumors( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumors = require( '@stdlib/blas/ext/base/ssumors' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumors.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumors;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumors = main;\n} else {\n\tssumors = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumors;\n\n// exports: { \"ndarray\": \"ssumors.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\n// Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.):\nvar BLOCKSIZE = 128;\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumpw( N, x, 2, 1 );\n* // returns 5.0\n*/\nfunction ssumpw( N, x, stride, offset ) {\n\tvar ix;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar M;\n\tvar s;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ offset ];\n\t}\n\tix = offset;\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\tif ( N <= BLOCKSIZE ) {\n\t\t// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...\n\t\ts0 = x[ ix ];\n\t\ts1 = x[ ix+stride ];\n\t\ts2 = x[ ix+(2*stride) ];\n\t\ts3 = x[ ix+(3*stride) ];\n\t\ts4 = x[ ix+(4*stride) ];\n\t\ts5 = x[ ix+(5*stride) ];\n\t\ts6 = x[ ix+(6*stride) ];\n\t\ts7 = x[ ix+(7*stride) ];\n\t\tix += 8 * stride;\n\n\t\tM = N % 8;\n\t\tfor ( i = 8; i < N-M; i += 8 ) {\n\t\t\ts0 = float64ToFloat32( s0 + x[ ix ] );\n\t\t\ts1 = float64ToFloat32( s1 + x[ ix+stride ] );\n\t\t\ts2 = float64ToFloat32( s2 + x[ ix+(2*stride) ] );\n\t\t\ts3 = float64ToFloat32( s3 + x[ ix+(3*stride) ] );\n\t\t\ts4 = float64ToFloat32( s4 + x[ ix+(4*stride) ] );\n\t\t\ts5 = float64ToFloat32( s5 + x[ ix+(5*stride) ] );\n\t\t\ts6 = float64ToFloat32( s6 + x[ ix+(6*stride) ] );\n\t\t\ts7 = float64ToFloat32( s7 + x[ ix+(7*stride) ] );\n\t\t\tix += 8 * stride;\n\t\t}\n\t\t// Pairwise sum the accumulators:\n\t\ts = float64ToFloat32( float64ToFloat32( float64ToFloat32(s0+s1) + float64ToFloat32(s2+s3) ) + float64ToFloat32( float64ToFloat32(s4+s5) + float64ToFloat32(s6+s7) ) ); // eslint-disable-line max-len\n\n\t\t// Clean-up loop...\n\t\tfor ( i; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\t// Recurse by dividing by two, but avoiding non-multiples of unroll factor...\n\tn = floor( N/2 );\n\tn -= n % 8;\n\treturn float64ToFloat32( ssumpw( n, x, stride, ix ) + ssumpw( N-n, x, stride, ix+(n*stride) ) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );\nvar sum = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Computes the sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* ## Method\n*\n* - This implementation uses pairwise summation, which accrues rounding error `O(log2 N)` instead of `O(N)`. The recursion depth is also `O(log2 N)`.\n*\n* ## References\n*\n* - Higham, Nicholas J. 1993. \"The Accuracy of Floating Point Summation.\" _SIAM Journal on Scientific Computing_ 14 (4): 783\u201399. doi:[10.1137/0914050](https://doi.org/10.1137/0914050).\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - stride length\n* @returns {number} sum\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumpw( N, x, 1 );\n* // returns 1.0\n*/\nfunction ssumpw( N, x, stride ) {\n\tvar ix;\n\tvar s;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( N === 1 || stride === 0 ) {\n\t\treturn x[ 0 ];\n\t}\n\tif ( stride < 0 ) {\n\t\tix = (1-N) * stride;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( N < 8 ) {\n\t\t// Use simple summation...\n\t\ts = 0.0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\ts = float64ToFloat32( s + x[ ix ] );\n\t\t\tix += stride;\n\t\t}\n\t\treturn s;\n\t}\n\treturn sum( N, x, stride, ix );\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar ssumpw = require( './ssumpw.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( ssumpw, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the sum of single-precision floating-point strided array elements using pairwise summation.\n*\n* @module @stdlib/blas/ext/base/ssumpw\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var ssumpw = require( '@stdlib/blas/ext/base/ssumpw' );\n*\n* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );\n* var N = x.length;\n*\n* var v = ssumpw( N, x, 1 );\n* // returns 1.0\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var floor = require( '@stdlib/math/base/special/floor' );\n* var ssumpw = require( '@stdlib/blas/ext/base/ssumpw' );\n*\n* var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );\n* var N = floor( x.length / 2 );\n*\n* var v = ssumpw.ndarray( N, x, 2, 1 );\n* // returns 5.0\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils/try-require' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar ssumpw;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tssumpw = main;\n} else {\n\tssumpw = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ssumpw;\n\n// exports: { \"ndarray\": \"ssumpw.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name dapx\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapx}\n*/\nsetReadOnly( ns, 'dapx', require( './../../../ext/base/dapx' ) );\n\n/**\n* @name dapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsum}\n*/\nsetReadOnly( ns, 'dapxsum', require( './../../../ext/base/dapxsum' ) );\n\n/**\n* @name dapxsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumkbn}\n*/\nsetReadOnly( ns, 'dapxsumkbn', require( './../../../ext/base/dapxsumkbn' ) );\n\n/**\n* @name dapxsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumkbn2}\n*/\nsetReadOnly( ns, 'dapxsumkbn2', require( './../../../ext/base/dapxsumkbn2' ) );\n\n/**\n* @name dapxsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumors}\n*/\nsetReadOnly( ns, 'dapxsumors', require( './../../../ext/base/dapxsumors' ) );\n\n/**\n* @name dapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dapxsumpw}\n*/\nsetReadOnly( ns, 'dapxsumpw', require( './../../../ext/base/dapxsumpw' ) );\n\n/**\n* @name dasumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dasumpw}\n*/\nsetReadOnly( ns, 'dasumpw', require( './../../../ext/base/dasumpw' ) );\n\n/**\n* @name dcusum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusum}\n*/\nsetReadOnly( ns, 'dcusum', require( './../../../ext/base/dcusum' ) );\n\n/**\n* @name dcusumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumkbn}\n*/\nsetReadOnly( ns, 'dcusumkbn', require( './../../../ext/base/dcusumkbn' ) );\n\n/**\n* @name dcusumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumkbn2}\n*/\nsetReadOnly( ns, 'dcusumkbn2', require( './../../../ext/base/dcusumkbn2' ) );\n\n/**\n* @name dcusumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumors}\n*/\nsetReadOnly( ns, 'dcusumors', require( './../../../ext/base/dcusumors' ) );\n\n/**\n* @name dcusumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dcusumpw}\n*/\nsetReadOnly( ns, 'dcusumpw', require( './../../../ext/base/dcusumpw' ) );\n\n/**\n* @name dfill\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dfill}\n*/\nsetReadOnly( ns, 'dfill', require( './../../../ext/base/dfill' ) );\n\n/**\n* @name dnanasum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnanasum}\n*/\nsetReadOnly( ns, 'dnanasum', require( './../../../ext/base/dnanasum' ) );\n\n/**\n* @name dnanasumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnanasumors}\n*/\nsetReadOnly( ns, 'dnanasumors', require( './../../../ext/base/dnanasumors' ) );\n\n/**\n* @name dnannsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsum}\n*/\nsetReadOnly( ns, 'dnannsum', require( './../../../ext/base/dnannsum' ) );\n\n/**\n* @name dnannsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumkbn}\n*/\nsetReadOnly( ns, 'dnannsumkbn', require( './../../../ext/base/dnannsumkbn' ) );\n\n/**\n* @name dnannsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumkbn2}\n*/\nsetReadOnly( ns, 'dnannsumkbn2', require( './../../../ext/base/dnannsumkbn2' ) );\n\n/**\n* @name dnannsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumors}\n*/\nsetReadOnly( ns, 'dnannsumors', require( './../../../ext/base/dnannsumors' ) );\n\n/**\n* @name dnannsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnannsumpw}\n*/\nsetReadOnly( ns, 'dnannsumpw', require( './../../../ext/base/dnannsumpw' ) );\n\n/**\n* @name dnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansum}\n*/\nsetReadOnly( ns, 'dnansum', require( './../../../ext/base/dnansum' ) );\n\n/**\n* @name dnansumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumkbn}\n*/\nsetReadOnly( ns, 'dnansumkbn', require( './../../../ext/base/dnansumkbn' ) );\n\n/**\n* @name dnansumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumkbn2}\n*/\nsetReadOnly( ns, 'dnansumkbn2', require( './../../../ext/base/dnansumkbn2' ) );\n\n/**\n* @name dnansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumors}\n*/\nsetReadOnly( ns, 'dnansumors', require( './../../../ext/base/dnansumors' ) );\n\n/**\n* @name dnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dnansumpw}\n*/\nsetReadOnly( ns, 'dnansumpw', require( './../../../ext/base/dnansumpw' ) );\n\n/**\n* @name drev\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/drev}\n*/\nsetReadOnly( ns, 'drev', require( './../../../ext/base/drev' ) );\n\n/**\n* @name dsapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsapxsum}\n*/\nsetReadOnly( ns, 'dsapxsum', require( './../../../ext/base/dsapxsum' ) );\n\n/**\n* @name dsapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsapxsumpw}\n*/\nsetReadOnly( ns, 'dsapxsumpw', require( './../../../ext/base/dsapxsumpw' ) );\n\n/**\n* @name dsnannsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnannsumors}\n*/\nsetReadOnly( ns, 'dsnannsumors', require( './../../../ext/base/dsnannsumors' ) );\n\n/**\n* @name dsnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnansum}\n*/\nsetReadOnly( ns, 'dsnansum', require( './../../../ext/base/dsnansum' ) );\n\n/**\n* @name dsnansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnansumors}\n*/\nsetReadOnly( ns, 'dsnansumors', require( './../../../ext/base/dsnansumors' ) );\n\n/**\n* @name dsnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsnansumpw}\n*/\nsetReadOnly( ns, 'dsnansumpw', require( './../../../ext/base/dsnansumpw' ) );\n\n/**\n* @name dsort2hp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsort2hp}\n*/\nsetReadOnly( ns, 'dsort2hp', require( './../../../ext/base/dsort2hp' ) );\n\n/**\n* @name dsort2ins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsort2ins}\n*/\nsetReadOnly( ns, 'dsort2ins', require( './../../../ext/base/dsort2ins' ) );\n\n/**\n* @name dsort2sh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsort2sh}\n*/\nsetReadOnly( ns, 'dsort2sh', require( './../../../ext/base/dsort2sh' ) );\n\n/**\n* @name dsorthp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsorthp}\n*/\nsetReadOnly( ns, 'dsorthp', require( './../../../ext/base/dsorthp' ) );\n\n/**\n* @name dsortins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsortins}\n*/\nsetReadOnly( ns, 'dsortins', require( './../../../ext/base/dsortins' ) );\n\n/**\n* @name dsortsh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsortsh}\n*/\nsetReadOnly( ns, 'dsortsh', require( './../../../ext/base/dsortsh' ) );\n\n/**\n* @name dssum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dssum}\n*/\nsetReadOnly( ns, 'dssum', require( './../../../ext/base/dssum' ) );\n\n/**\n* @name dssumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dssumors}\n*/\nsetReadOnly( ns, 'dssumors', require( './../../../ext/base/dssumors' ) );\n\n/**\n* @name dssumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dssumpw}\n*/\nsetReadOnly( ns, 'dssumpw', require( './../../../ext/base/dssumpw' ) );\n\n/**\n* @name dsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsum}\n*/\nsetReadOnly( ns, 'dsum', require( './../../../ext/base/dsum' ) );\n\n/**\n* @name dsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumkbn}\n*/\nsetReadOnly( ns, 'dsumkbn', require( './../../../ext/base/dsumkbn' ) );\n\n/**\n* @name dsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumkbn2}\n*/\nsetReadOnly( ns, 'dsumkbn2', require( './../../../ext/base/dsumkbn2' ) );\n\n/**\n* @name dsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumors}\n*/\nsetReadOnly( ns, 'dsumors', require( './../../../ext/base/dsumors' ) );\n\n/**\n* @name dsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/dsumpw}\n*/\nsetReadOnly( ns, 'dsumpw', require( './../../../ext/base/dsumpw' ) );\n\n/**\n* @name gapx\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapx}\n*/\nsetReadOnly( ns, 'gapx', require( './../../../ext/base/gapx' ) );\n\n/**\n* @name gapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsum}\n*/\nsetReadOnly( ns, 'gapxsum', require( './../../../ext/base/gapxsum' ) );\n\n/**\n* @name gapxsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumkbn}\n*/\nsetReadOnly( ns, 'gapxsumkbn', require( './../../../ext/base/gapxsumkbn' ) );\n\n/**\n* @name gapxsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumkbn2}\n*/\nsetReadOnly( ns, 'gapxsumkbn2', require( './../../../ext/base/gapxsumkbn2' ) );\n\n/**\n* @name gapxsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumors}\n*/\nsetReadOnly( ns, 'gapxsumors', require( './../../../ext/base/gapxsumors' ) );\n\n/**\n* @name gapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gapxsumpw}\n*/\nsetReadOnly( ns, 'gapxsumpw', require( './../../../ext/base/gapxsumpw' ) );\n\n/**\n* @name gasumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gasumpw}\n*/\nsetReadOnly( ns, 'gasumpw', require( './../../../ext/base/gasumpw' ) );\n\n/**\n* @name gcusum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusum}\n*/\nsetReadOnly( ns, 'gcusum', require( './../../../ext/base/gcusum' ) );\n\n/**\n* @name gcusumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumkbn}\n*/\nsetReadOnly( ns, 'gcusumkbn', require( './../../../ext/base/gcusumkbn' ) );\n\n/**\n* @name gcusumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumkbn2}\n*/\nsetReadOnly( ns, 'gcusumkbn2', require( './../../../ext/base/gcusumkbn2' ) );\n\n/**\n* @name gcusumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumors}\n*/\nsetReadOnly( ns, 'gcusumors', require( './../../../ext/base/gcusumors' ) );\n\n/**\n* @name gcusumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gcusumpw}\n*/\nsetReadOnly( ns, 'gcusumpw', require( './../../../ext/base/gcusumpw' ) );\n\n/**\n* @name gfill\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gfill}\n*/\nsetReadOnly( ns, 'gfill', require( './../../../ext/base/gfill' ) );\n\n/**\n* @name gfillBy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gfill-by}\n*/\nsetReadOnly( ns, 'gfillBy', require( './../../../ext/base/gfill-by' ) );\n\n/**\n* @name gnannsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnannsumkbn}\n*/\nsetReadOnly( ns, 'gnannsumkbn', require( './../../../ext/base/gnannsumkbn' ) );\n\n/**\n* @name gnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansum}\n*/\nsetReadOnly( ns, 'gnansum', require( './../../../ext/base/gnansum' ) );\n\n/**\n* @name gnansumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumkbn}\n*/\nsetReadOnly( ns, 'gnansumkbn', require( './../../../ext/base/gnansumkbn' ) );\n\n/**\n* @name gnansumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumkbn2}\n*/\nsetReadOnly( ns, 'gnansumkbn2', require( './../../../ext/base/gnansumkbn2' ) );\n\n/**\n* @name gnansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumors}\n*/\nsetReadOnly( ns, 'gnansumors', require( './../../../ext/base/gnansumors' ) );\n\n/**\n* @name gnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gnansumpw}\n*/\nsetReadOnly( ns, 'gnansumpw', require( './../../../ext/base/gnansumpw' ) );\n\n/**\n* @name grev\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/grev}\n*/\nsetReadOnly( ns, 'grev', require( './../../../ext/base/grev' ) );\n\n/**\n* @name gsort2hp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsort2hp}\n*/\nsetReadOnly( ns, 'gsort2hp', require( './../../../ext/base/gsort2hp' ) );\n\n/**\n* @name gsort2ins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsort2ins}\n*/\nsetReadOnly( ns, 'gsort2ins', require( './../../../ext/base/gsort2ins' ) );\n\n/**\n* @name gsort2sh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsort2sh}\n*/\nsetReadOnly( ns, 'gsort2sh', require( './../../../ext/base/gsort2sh' ) );\n\n/**\n* @name gsorthp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsorthp}\n*/\nsetReadOnly( ns, 'gsorthp', require( './../../../ext/base/gsorthp' ) );\n\n/**\n* @name gsortins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsortins}\n*/\nsetReadOnly( ns, 'gsortins', require( './../../../ext/base/gsortins' ) );\n\n/**\n* @name gsortsh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsortsh}\n*/\nsetReadOnly( ns, 'gsortsh', require( './../../../ext/base/gsortsh' ) );\n\n/**\n* @name gsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsum}\n*/\nsetReadOnly( ns, 'gsum', require( './../../../ext/base/gsum' ) );\n\n/**\n* @name gsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumkbn}\n*/\nsetReadOnly( ns, 'gsumkbn', require( './../../../ext/base/gsumkbn' ) );\n\n/**\n* @name gsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumkbn2}\n*/\nsetReadOnly( ns, 'gsumkbn2', require( './../../../ext/base/gsumkbn2' ) );\n\n/**\n* @name gsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumors}\n*/\nsetReadOnly( ns, 'gsumors', require( './../../../ext/base/gsumors' ) );\n\n/**\n* @name gsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/gsumpw}\n*/\nsetReadOnly( ns, 'gsumpw', require( './../../../ext/base/gsumpw' ) );\n\n/**\n* @name sapx\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapx}\n*/\nsetReadOnly( ns, 'sapx', require( './../../../ext/base/sapx' ) );\n\n/**\n* @name sapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsum}\n*/\nsetReadOnly( ns, 'sapxsum', require( './../../../ext/base/sapxsum' ) );\n\n/**\n* @name sapxsumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumkbn}\n*/\nsetReadOnly( ns, 'sapxsumkbn', require( './../../../ext/base/sapxsumkbn' ) );\n\n/**\n* @name sapxsumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumkbn2}\n*/\nsetReadOnly( ns, 'sapxsumkbn2', require( './../../../ext/base/sapxsumkbn2' ) );\n\n/**\n* @name sapxsumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumors}\n*/\nsetReadOnly( ns, 'sapxsumors', require( './../../../ext/base/sapxsumors' ) );\n\n/**\n* @name sapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sapxsumpw}\n*/\nsetReadOnly( ns, 'sapxsumpw', require( './../../../ext/base/sapxsumpw' ) );\n\n/**\n* @name sasumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sasumpw}\n*/\nsetReadOnly( ns, 'sasumpw', require( './../../../ext/base/sasumpw' ) );\n\n/**\n* @name scusum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusum}\n*/\nsetReadOnly( ns, 'scusum', require( './../../../ext/base/scusum' ) );\n\n/**\n* @name scusumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumkbn}\n*/\nsetReadOnly( ns, 'scusumkbn', require( './../../../ext/base/scusumkbn' ) );\n\n/**\n* @name scusumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumkbn2}\n*/\nsetReadOnly( ns, 'scusumkbn2', require( './../../../ext/base/scusumkbn2' ) );\n\n/**\n* @name scusumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumors}\n*/\nsetReadOnly( ns, 'scusumors', require( './../../../ext/base/scusumors' ) );\n\n/**\n* @name scusumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/scusumpw}\n*/\nsetReadOnly( ns, 'scusumpw', require( './../../../ext/base/scusumpw' ) );\n\n/**\n* @name sdsapxsum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsapxsum}\n*/\nsetReadOnly( ns, 'sdsapxsum', require( './../../../ext/base/sdsapxsum' ) );\n\n/**\n* @name sdsapxsumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsapxsumpw}\n*/\nsetReadOnly( ns, 'sdsapxsumpw', require( './../../../ext/base/sdsapxsumpw' ) );\n\n/**\n* @name sdsnansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsnansum}\n*/\nsetReadOnly( ns, 'sdsnansum', require( './../../../ext/base/sdsnansum' ) );\n\n/**\n* @name sdsnansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdsnansumpw}\n*/\nsetReadOnly( ns, 'sdsnansumpw', require( './../../../ext/base/sdsnansumpw' ) );\n\n/**\n* @name sdssum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdssum}\n*/\nsetReadOnly( ns, 'sdssum', require( './../../../ext/base/sdssum' ) );\n\n/**\n* @name sdssumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sdssumpw}\n*/\nsetReadOnly( ns, 'sdssumpw', require( './../../../ext/base/sdssumpw' ) );\n\n/**\n* @name sfill\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/sfill}\n*/\nsetReadOnly( ns, 'sfill', require( './../../../ext/base/sfill' ) );\n\n/**\n* @name snansum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansum}\n*/\nsetReadOnly( ns, 'snansum', require( './../../../ext/base/snansum' ) );\n\n/**\n* @name snansumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumkbn}\n*/\nsetReadOnly( ns, 'snansumkbn', require( './../../../ext/base/snansumkbn' ) );\n\n/**\n* @name snansumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumkbn2}\n*/\nsetReadOnly( ns, 'snansumkbn2', require( './../../../ext/base/snansumkbn2' ) );\n\n/**\n* @name snansumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumors}\n*/\nsetReadOnly( ns, 'snansumors', require( './../../../ext/base/snansumors' ) );\n\n/**\n* @name snansumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/snansumpw}\n*/\nsetReadOnly( ns, 'snansumpw', require( './../../../ext/base/snansumpw' ) );\n\n/**\n* @name srev\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/srev}\n*/\nsetReadOnly( ns, 'srev', require( './../../../ext/base/srev' ) );\n\n/**\n* @name ssort2hp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssort2hp}\n*/\nsetReadOnly( ns, 'ssort2hp', require( './../../../ext/base/ssort2hp' ) );\n\n/**\n* @name ssort2ins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssort2ins}\n*/\nsetReadOnly( ns, 'ssort2ins', require( './../../../ext/base/ssort2ins' ) );\n\n/**\n* @name ssort2sh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssort2sh}\n*/\nsetReadOnly( ns, 'ssort2sh', require( './../../../ext/base/ssort2sh' ) );\n\n/**\n* @name ssorthp\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssorthp}\n*/\nsetReadOnly( ns, 'ssorthp', require( './../../../ext/base/ssorthp' ) );\n\n/**\n* @name ssortins\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssortins}\n*/\nsetReadOnly( ns, 'ssortins', require( './../../../ext/base/ssortins' ) );\n\n/**\n* @name ssortsh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssortsh}\n*/\nsetReadOnly( ns, 'ssortsh', require( './../../../ext/base/ssortsh' ) );\n\n/**\n* @name ssum\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssum}\n*/\nsetReadOnly( ns, 'ssum', require( './../../../ext/base/ssum' ) );\n\n/**\n* @name ssumkbn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumkbn}\n*/\nsetReadOnly( ns, 'ssumkbn', require( './../../../ext/base/ssumkbn' ) );\n\n/**\n* @name ssumkbn2\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumkbn2}\n*/\nsetReadOnly( ns, 'ssumkbn2', require( './../../../ext/base/ssumkbn2' ) );\n\n/**\n* @name ssumors\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumors}\n*/\nsetReadOnly( ns, 'ssumors', require( './../../../ext/base/ssumors' ) );\n\n/**\n* @name ssumpw\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ext/base/ssumpw}\n*/\nsetReadOnly( ns, 'ssumpw', require( './../../../ext/base/ssumpw' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/blas/ext/base}\n*/\nsetReadOnly( ns, 'base', require( './../../ext/base' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFloat64Array = require( '@stdlib/assert/is-float64array' );\nvar isFloat32Array = require( '@stdlib/assert/is-float32array' );\nvar format = require( '@stdlib/string/format' );\nvar ddot = require( './../../base/ddot' ).ndarray;\nvar sdot = require( './../../base/sdot' ).ndarray;\nvar dot = require( './../../base/gdot' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Computes the dot product of vectors `x` and `y`.\n*\n* ## Notes\n*\n* - In general, for best performance, especially for large vectors, provide 1-dimensional `ndarrays` whose underlying data type is either `float64` or `float32`.\n*\n* @param {(Collection|VectorLike)} x - first input array\n* @param {(Collection|VectorLike)} y - second input array\n* @throws {TypeError} first argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {TypeError} second argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {RangeError} input arrays must be the same length\n* @returns {number} dot product\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot( x, y );\n* // returns -5.0\n*/\nfunction gdot( x, y ) {\n\tvar isxf64;\n\tvar isxf32;\n\tvar isyf64;\n\tvar isyf32;\n\tvar isxa;\n\tvar isxv;\n\tvar isya;\n\tvar isyv;\n\n\tisxa = isndarrayLike( x );\n\tisya = isndarrayLike( y );\n\tisxv = isxa && x.ndims === 1 && x.strides.length === 1; // is ndarray-like vector?\n\tisyv = isya && y.ndims === 1 && y.strides.length === 1; // is ndarray-like vector?\n\tif ( isxv ) {\n\t\tisxf64 = isFloat64Array( x.data );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x.data );\n\t} else if ( isxa === false && isCollection( x ) ) {\n\t\tisxf64 = isFloat64Array( x );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', x ) );\n\t}\n\tif ( isyv ) {\n\t\tisyf64 = isFloat64Array( y.data );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y.data );\n\t} else if ( isya === false && isCollection( y ) ) {\n\t\tisyf64 = isFloat64Array( y );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tif ( isxv && isyv ) {\n\t\tif ( isxf64 && isyf64 ) {\n\t\t\treturn ddot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t}\n\t\tif ( isxf32 && isyf32 ) {\n\t\t\treturn sdot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t}\n\t\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t}\n\tif ( isxv ) {\n\t\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y, 1, 0 );\n\t}\n\tif ( isyv ) {\n\t\treturn dot( x.length, x, 1, 0, y.data, y.strides[ 0 ], y.offset );\n\t}\n\treturn dot( x.length, x, 1, 0, y, 1, 0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two vectors.\n*\n* @module @stdlib/blas/gdot\n*\n* @example\n* var gdot = require( '@stdlib/blas/gdot' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* var z = gdot( x, y );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isFloat64Array = require( '@stdlib/assert/is-float64array' );\nvar isFloat32Array = require( '@stdlib/assert/is-float32array' );\nvar format = require( '@stdlib/string/format' );\nvar dswap = require( './../../base/dswap' ).ndarray;\nvar sswap = require( './../../base/sswap' ).ndarray;\nvar swap = require( './../../base/gswap' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Interchanges two vectors.\n*\n* ## Notes\n*\n* - In general, for best performance, especially for large vectors, provide 1-dimensional `ndarrays` whose underlying data type is either `float64` or `float32`.\n*\n* @param {(Collection|VectorLike)} x - first input array\n* @param {(Collection|VectorLike)} y - second input array\n* @throws {TypeError} first argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {TypeError} second argument must be either an array-like object or a 1-dimensional ndarray\n* @throws {RangeError} input arrays must be the same length\n* @returns {(Collection|VectorLike)} `y`\n*\n* @example\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* gswap( x, y );\n* // x => [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n* // y => [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction gswap( x, y ) {\n\tvar isxf64;\n\tvar isxf32;\n\tvar isyf64;\n\tvar isyf32;\n\tvar isxa;\n\tvar isxv;\n\tvar isya;\n\tvar isyv;\n\n\tisxa = isndarrayLike( x );\n\tisya = isndarrayLike( y );\n\tisxv = isxa && x.ndims === 1 && x.strides.length === 1; // is ndarray-like vector?\n\tisyv = isya && y.ndims === 1 && y.strides.length === 1; // is ndarray-like vector?\n\tif ( isxv ) {\n\t\tisxf64 = isFloat64Array( x.data );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x.data );\n\t} else if ( isxa === false && isCollection( x ) ) {\n\t\tisxf64 = isFloat64Array( x );\n\t\tisxf32 = ( isxf64 ) ? false : isFloat32Array( x );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', x ) );\n\t}\n\tif ( isyv ) {\n\t\tisyf64 = isFloat64Array( y.data );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y.data );\n\t} else if ( isya === false && isCollection( y ) ) {\n\t\tisyf64 = isFloat64Array( y );\n\t\tisyf32 = ( isyf64 ) ? false : isFloat32Array( y );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be either an array-like object or a one-dimensional ndarray. Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tif ( isxv && isyv ) {\n\t\tif ( isxf64 && isyf64 ) {\n\t\t\tdswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t\treturn y;\n\t\t}\n\t\tif ( isxf32 && isyf32 ) {\n\t\t\tsswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\t\treturn y;\n\t\t}\n\t\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\t\treturn y;\n\t}\n\tif ( isxv ) {\n\t\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y, 1, 0 );\n\t\treturn y;\n\t}\n\tif ( isyv ) {\n\t\tswap( x.length, x, 1, 0, y.data, y.strides[ 0 ], y.offset );\n\t\treturn y;\n\t}\n\tswap( x.length, x, 1, 0, y, 1, 0 );\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two vectors.\n*\n* @module @stdlib/blas/gswap\n*\n* @example\n* var gswap = require( '@stdlib/blas/gswap' );\n*\n* var x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];\n* var y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];\n*\n* gswap( x, y );\n* // x => [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n* // y => [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' );\nvar dot = require( './../../base/sdot' ).ndarray;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Computes the dot product of two single-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {number} dot product\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = sdot( x, y );\n* // returns -5.0\n*/\nfunction sdot( x, y ) {\n\tif ( !isFloat32VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat32VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\treturn dot( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nmodule.exports = sdot;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to compute the dot product of two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/sdot\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n* var sdot = require( '@stdlib/blas/sdot' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* var z = sdot( x, y );\n* // returns -5.0\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFloat32VectorLike = require( '@stdlib/assert/is-float32vector-like' );\nvar format = require( '@stdlib/string/format' );\nvar swap = require( './../../base/sswap' ).ndarray;\n\n\n// MAIN //\n\n/**\n* Interchanges two single-precision floating-point vectors.\n*\n* @param {VectorLike} x - first input array\n* @param {VectorLike} y - second input array\n* @throws {TypeError} first argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {TypeError} second argument must be a 1-dimensional ndarray containing single-precision floating-point numbers\n* @throws {RangeError} input arrays must be the same length\n* @returns {VectorLike} `y`\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* sswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction sswap( x, y ) {\n\tif ( !isFloat32VectorLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat32VectorLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a one-dimensional ndarray containing single-precision floating-point numbers (i.e., an ndarray whose underlying data buffer is a Float32Array). Value: `%s`.', y ) );\n\t}\n\tif ( x.length !== y.length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Arrays must be the same length. First argument length: `%u`. Second argument length: `%u`.', x.length, y.length ) );\n\t}\n\tswap( x.length, x.data, x.strides[ 0 ], x.offset, y.data, y.strides[ 0 ], y.offset ); // eslint-disable-line max-len\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to interchange two single-precision floating-point vectors.\n*\n* @module @stdlib/blas/sswap\n*\n* @example\n* var Float32Array = require( '@stdlib/array/float32' );\n* var array = require( '@stdlib/ndarray/array' );\n* var sswap = require( '@stdlib/blas/sswap' );\n*\n* var x = array( new Float32Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* sswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/blas/base}\n*/\nsetReadOnly( ns, 'base', require( './../base' ) );\n\n/**\n* @name ddot\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/ddot}\n*/\nsetReadOnly( ns, 'ddot', require( './../ddot' ) );\n\n/**\n* @name dswap\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/dswap}\n*/\nsetReadOnly( ns, 'dswap', require( './../dswap' ) );\n\n/**\n* @name ext\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/blas/ext}\n*/\nsetReadOnly( ns, 'ext', require( './../ext' ) );\n\n/**\n* @name gdot\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/gdot}\n*/\nsetReadOnly( ns, 'gdot', require( './../gdot' ) );\n\n/**\n* @name gswap\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/gswap}\n*/\nsetReadOnly( ns, 'gswap', require( './../gswap' ) );\n\n/**\n* @name sdot\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/sdot}\n*/\nsetReadOnly( ns, 'sdot', require( './../sdot' ) );\n\n/**\n* @name sswap\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/blas/sswap}\n*/\nsetReadOnly( ns, 'sswap', require( './../sswap' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"], + "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,GAAAC,GAAA,cAsBA,IAAIC,GAAc,QAAS,4CAA6C,EAkCxE,SAASC,GAAOC,EAAGC,EAAGC,EAASC,EAAG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E,EAE5O,GAAKD,EAAE,SAAWC,EAAE,OACnB,MAAM,IAAI,WAAYJ,GAAQ,+GAAgHG,EAAE,OAAQC,EAAE,MAAO,CAAE,EAEpK,OAAAH,GAAME,EAAE,OAAQA,EAAE,KAAMA,EAAE,QAAS,CAAE,EAAGA,EAAE,OAAQC,EAAE,KAAMA,EAAE,QAAS,CAAE,EAAGA,EAAE,MAAO,EAC5EA,CACR,CAKAN,GAAO,QAAUI,KCvEjB,IAAAG,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cA4CA,IAAIC,GAAO,KAKXD,GAAO,QAAUC,KCvBjB,IAAIC,GAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,GAAaC,EAAI,OAAQ,IAAuB,EAShDD,GAAaC,EAAI,OAAQ,IAAuB,EAShDD,GAAaC,EAAI,QAAS,IAAwB,EASlDD,GAAaC,EAAI,MAAO,IAAsB,EAS9CD,GAAaC,EAAI,OAAQ,IAAuB,EAShDD,GAAaC,EAAI,QAAS,IAAwB,EASlDD,GAAaC,EAAI,OAAQ,IAAuB,EAShDD,GAAaC,EAAI,QAAS,IAAwB,EAKlD,OAAO,QAAUA", "names": ["require_ccopy", "__commonJSMin", "exports", "module", "reinterpret", "ccopy", "N", "x", "strideX", "y", "strideY", "viewX", "viewY", "sx", "sy", "ix", "iy", "i", "require_ndarray", "__commonJSMin", "exports", "module", "reinterpret", "ccopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "viewX", "viewY", "sx", "sy", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ccopy", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ccopy", "tmp", "require_cswap", "__commonJSMin", "exports", "module", "reinterpret", "cswap", "N", "x", "strideX", "y", "strideY", "viewX", "viewY", "tmp", "sx", "sy", "ix", "iy", "i", "j", "require_ndarray", "__commonJSMin", "exports", "module", "reinterpret", "cswap", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "viewX", "viewY", "tmp", "sx", "sy", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "cswap", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "cswap", "tmp", "require_dasum", "__commonJSMin", "exports", "module", "abs", "M", "dasum", "N", "x", "stride", "sum", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "M", "dasum", "N", "x", "stride", "offset", "sum", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dasum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dasum", "tmp", "require_daxpy", "__commonJSMin", "exports", "module", "M", "daxpy", "N", "alpha", "x", "strideX", "y", "strideY", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "daxpy", "N", "alpha", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "daxpy", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "daxpy", "tmp", "require_dcopy", "__commonJSMin", "exports", "module", "M", "dcopy", "N", "x", "strideX", "y", "strideY", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dcopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dcopy", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dcopy", "tmp", "require_ddot", "__commonJSMin", "exports", "module", "M", "ddot", "N", "x", "strideX", "y", "strideY", "dot", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "ddot", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "dot", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ddot", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ddot", "tmp", "require_dnrm2", "__commonJSMin", "exports", "module", "sqrt", "abs", "pow", "dnrm2", "N", "x", "stride", "scale", "ssq", "ax", "i", "require_ndarray", "__commonJSMin", "exports", "module", "sqrt", "abs", "pow", "dnrm2", "N", "x", "stride", "offset", "scale", "ssq", "ax", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnrm2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnrm2", "tmp", "require_dscal", "__commonJSMin", "exports", "module", "M", "dscal", "N", "alpha", "x", "stride", "i", "m", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dscal", "N", "alpha", "x", "stride", "offset", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dscal", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dscal", "tmp", "require_dsdot", "__commonJSMin", "exports", "module", "M", "dsdot", "N", "x", "strideX", "y", "strideY", "dot", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dsdot", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "dot", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsdot", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsdot", "tmp", "require_dswap", "__commonJSMin", "exports", "module", "M", "dswap", "N", "x", "strideX", "y", "strideY", "tmp", "ix", "iy", "m", "i", "j", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dswap", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "tmp", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dswap", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dswap", "tmp", "require_main", "__commonJSMin", "exports", "module", "abs", "M", "gasum", "N", "x", "stride", "sum", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "M", "gasum", "N", "x", "stride", "offset", "sum", "ix", "m", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "M", "gaxpy", "N", "alpha", "x", "strideX", "y", "strideY", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "gaxpy", "N", "alpha", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "m", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_accessors", "__commonJSMin", "exports", "module", "gcopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "xbuf", "ybuf", "set", "get", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "M", "gcopy", "N", "x", "strideX", "y", "strideY", "ix", "iy", "ox", "oy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "M", "gcopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "ox", "oy", "m", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "M", "gdot", "N", "x", "strideX", "y", "strideY", "dot", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "gdot", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "dot", "ix", "iy", "m", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_gnrm2", "__commonJSMin", "exports", "module", "sqrt", "abs", "pow", "gnrm2", "N", "x", "stride", "scale", "ssq", "ax", "i", "require_ndarray", "__commonJSMin", "exports", "module", "sqrt", "abs", "pow", "gnrm2", "N", "x", "stride", "offset", "scale", "ssq", "ax", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "gnrm2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "gnrm2", "require_main", "__commonJSMin", "exports", "module", "M", "gscal", "N", "alpha", "x", "stride", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "gscal", "N", "alpha", "x", "stride", "offset", "ix", "m", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_accessors", "__commonJSMin", "exports", "module", "gswap", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "xbuf", "ybuf", "set", "get", "tmp", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "M", "gswap", "N", "x", "strideX", "y", "strideY", "tmp", "ix", "iy", "ox", "oy", "m", "i", "j", "require_ndarray", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "M", "gswap", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "tmp", "ix", "iy", "ox", "oy", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_sasum", "__commonJSMin", "exports", "module", "abs", "float64ToFloat32", "sasum", "N", "x", "stride", "sum", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "float64ToFloat32", "sasum", "N", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sasum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sasum", "tmp", "require_saxpy", "__commonJSMin", "exports", "module", "float64ToFloat32", "M", "saxpy", "N", "alpha", "x", "strideX", "y", "strideY", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "M", "saxpy", "N", "alpha", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "saxpy", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "saxpy", "tmp", "require_scopy", "__commonJSMin", "exports", "module", "M", "scopy", "N", "x", "strideX", "y", "strideY", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "scopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scopy", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "scopy", "tmp", "require_sdot", "__commonJSMin", "exports", "module", "float64ToFloat32", "sdot", "N", "x", "strideX", "y", "strideY", "dot", "ix", "iy", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "sdot", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "dot", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdot", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdot", "tmp", "require_sdsdot", "__commonJSMin", "exports", "module", "float64ToFloat32", "M", "sdsdot", "N", "scalar", "x", "strideX", "y", "strideY", "dot", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "M", "sdsdot", "N", "scalar", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "dot", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdsdot", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdsdot", "tmp", "require_snrm2", "__commonJSMin", "exports", "module", "sqrt", "abs", "pow", "float64ToFloat32", "snrm2", "N", "x", "stride", "scale", "ssq", "ax", "i", "require_ndarray", "__commonJSMin", "exports", "module", "sqrt", "abs", "pow", "float64ToFloat32", "snrm2", "N", "x", "stride", "offset", "scale", "ssq", "ax", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "snrm2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "snrm2", "tmp", "require_assign", "__commonJSMin", "exports", "module", "float64ToFloat32", "absf", "sqrtf", "abs2f", "copysignf", "srotg", "a", "b", "out", "stride", "offset", "scale", "sign", "aa", "ab", "r", "c", "s", "z", "require_main", "__commonJSMin", "exports", "module", "Float32Array", "fcn", "srotg", "a", "b", "out", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "assign", "require_sscal", "__commonJSMin", "exports", "module", "M", "sscal", "N", "alpha", "x", "stride", "i", "m", "require_ndarray", "__commonJSMin", "exports", "module", "M", "sscal", "N", "alpha", "x", "stride", "offset", "ix", "i", "m", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sscal", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sscal", "tmp", "require_sswap", "__commonJSMin", "exports", "module", "M", "sswap", "N", "x", "strideX", "y", "strideY", "tmp", "ix", "iy", "m", "i", "j", "require_ndarray", "__commonJSMin", "exports", "module", "M", "sswap", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "tmp", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sswap", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sswap", "tmp", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "blas", "require_main", "__commonJSMin", "exports", "module", "isFloat64VectorLike", "format", "dot", "ddot", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFloat64VectorLike", "format", "swap", "dswap", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "require_dapx", "__commonJSMin", "exports", "module", "M", "dapx", "N", "alpha", "x", "stride", "ix", "i", "m", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dapx", "N", "alpha", "x", "stride", "offset", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dapx", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dapx", "tmp", "require_dapxsumkbn", "__commonJSMin", "exports", "module", "abs", "dapxsumkbn", "N", "alpha", "x", "stride", "sum", "ix", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "dapxsumkbn", "N", "alpha", "x", "stride", "offset", "sum", "ix", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dapxsumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dapxsumkbn", "tmp", "require_dapxsum", "__commonJSMin", "exports", "module", "dapxsumkbn", "dapxsum", "N", "alpha", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "dapxsumkbn", "dapxsum", "N", "alpha", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dapxsum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dapxsum", "tmp", "require_dapxsumkbn2", "__commonJSMin", "exports", "module", "abs", "dapxsumkbn2", "N", "alpha", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "dapxsumkbn2", "N", "alpha", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dapxsumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dapxsumkbn2", "tmp", "require_dapxsumors", "__commonJSMin", "exports", "module", "dapxsumors", "N", "alpha", "x", "stride", "sum", "ix", "i", "require_ndarray", "__commonJSMin", "exports", "module", "dapxsumors", "N", "alpha", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dapxsumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dapxsumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "dapxsumpw", "N", "alpha", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_dapxsumpw", "__commonJSMin", "exports", "module", "sum", "dapxsumpw", "N", "alpha", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dapxsumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dapxsumpw", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "abs", "BLOCKSIZE", "dasumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_dasumpw", "__commonJSMin", "exports", "module", "abs", "sum", "dasumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dasumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dasumpw", "tmp", "require_dcusumkbn", "__commonJSMin", "exports", "module", "abs", "dcusumkbn", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "s", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "dcusumkbn", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "s", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dcusumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dcusumkbn", "tmp", "require_dcusum", "__commonJSMin", "exports", "module", "dcusumkbn", "dcusum", "N", "sum", "x", "strideX", "y", "strideY", "require_ndarray", "__commonJSMin", "exports", "module", "dcusumkbn", "dcusum", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dcusum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dcusum", "tmp", "require_dcusumkbn2", "__commonJSMin", "exports", "module", "abs", "dcusumkbn2", "N", "sum", "x", "strideX", "y", "strideY", "ccs", "ix", "iy", "cs", "cc", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "dcusumkbn2", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ccs", "ix", "iy", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dcusumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dcusumkbn2", "tmp", "require_dcusumors", "__commonJSMin", "exports", "module", "dcusumors", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "i", "require_ndarray", "__commonJSMin", "exports", "module", "dcusumors", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dcusumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dcusumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "dcusumpw", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "s", "n", "i", "require_dcusumpw", "__commonJSMin", "exports", "module", "cusum", "dcusumpw", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dcusumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dcusumpw", "tmp", "require_dfill", "__commonJSMin", "exports", "module", "M", "dfill", "N", "alpha", "x", "stride", "ix", "i", "m", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dfill", "N", "alpha", "x", "stride", "offset", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dfill", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dfill", "tmp", "require_dnanasumors", "__commonJSMin", "exports", "module", "isnan", "abs", "dnanasumors", "N", "x", "stride", "sum", "ix", "v", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "dnanasumors", "N", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnanasumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnanasumors", "tmp", "require_dnanasum", "__commonJSMin", "exports", "module", "dnanasumors", "dnanasum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "dnanasumors", "dnanasum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnanasum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnanasum", "tmp", "require_dnannsumkbn", "__commonJSMin", "exports", "module", "isnan", "abs", "dnannsumkbn", "N", "x", "strideX", "out", "strideOut", "sum", "ix", "io", "v", "c", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "dnannsumkbn", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "sum", "ix", "io", "v", "t", "c", "n", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnannsumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnannsumkbn", "tmp", "require_dnannsum", "__commonJSMin", "exports", "module", "dnannsumkbn", "dnannsum", "N", "x", "strideX", "out", "strideOut", "require_ndarray", "__commonJSMin", "exports", "module", "dnannsumkbn", "dnannsum", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnannsum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnannsum", "tmp", "require_dnannsumkbn2", "__commonJSMin", "exports", "module", "isnan", "abs", "dnannsumkbn2", "N", "x", "strideX", "out", "strideOut", "sum", "ccs", "cs", "cc", "ix", "io", "v", "t", "c", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "dnannsumkbn2", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "sum", "ccs", "cs", "cc", "ix", "io", "v", "t", "c", "n", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnannsumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnannsumkbn2", "tmp", "require_dnannsumors", "__commonJSMin", "exports", "module", "isnan", "dnannsumors", "N", "x", "strideX", "out", "strideOut", "sum", "ix", "io", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "dnannsumors", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "sum", "ix", "io", "n", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnannsumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnannsumors", "tmp", "require_sumpw", "__commonJSMin", "exports", "module", "isnan", "floor", "BLOCKSIZE", "sumpw", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "ix", "io", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "v", "i", "require_dnannsumpw", "__commonJSMin", "exports", "module", "sumpw", "dnannsumpw", "N", "x", "strideX", "out", "strideOut", "ix", "io", "require_ndarray", "__commonJSMin", "exports", "module", "sumpw", "dnannsumpw", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnannsumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnannsumpw", "tmp", "require_dnansumkbn", "__commonJSMin", "exports", "module", "isnan", "abs", "dnansumkbn", "N", "x", "stride", "sum", "ix", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "dnansumkbn", "N", "x", "stride", "offset", "sum", "ix", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnansumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnansumkbn", "tmp", "require_dnansum", "__commonJSMin", "exports", "module", "dnansumkbn", "dnansum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "dnansumkbn", "dnansum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnansum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnansum", "tmp", "require_dnansumkbn2", "__commonJSMin", "exports", "module", "isnan", "abs", "dnansumkbn2", "N", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "dnansumkbn2", "N", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnansumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnansumkbn2", "tmp", "require_dnansumors", "__commonJSMin", "exports", "module", "isnan", "dnansumors", "N", "x", "stride", "sum", "ix", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "dnansumors", "N", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnansumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnansumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "floor", "BLOCKSIZE", "dnansumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_dnansumpw", "__commonJSMin", "exports", "module", "isnan", "sum", "dnansumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dnansumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dnansumpw", "tmp", "require_drev", "__commonJSMin", "exports", "module", "floor", "M", "drev", "N", "x", "stride", "tmp", "ix", "iy", "m", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "M", "drev", "N", "x", "stride", "offset", "tmp", "ix", "iy", "m", "n", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "drev", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "drev", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "dsapxsumpw", "N", "alpha", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_dsapxsumpw", "__commonJSMin", "exports", "module", "sum", "dsapxsumpw", "N", "alpha", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsapxsumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsapxsumpw", "tmp", "require_dsapxsum", "__commonJSMin", "exports", "module", "dsapxsumpw", "dsapxsum", "N", "alpha", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "dsapxsumpw", "dsapxsum", "N", "alpha", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsapxsum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsapxsum", "tmp", "require_dsnannsumors", "__commonJSMin", "exports", "module", "isnan", "dsnannsumors", "N", "x", "strideX", "out", "strideOut", "sum", "ix", "io", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "dsnannsumors", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "sum", "ix", "io", "n", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsnannsumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsnannsumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "isnanf", "floor", "BLOCKSIZE", "dsnansumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_dsnansumpw", "__commonJSMin", "exports", "module", "isnanf", "sum", "dsnansumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsnansumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsnansumpw", "tmp", "require_dsnansum", "__commonJSMin", "exports", "module", "dsnansumpw", "dsnansum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "dsnansumpw", "dsnansum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsnansum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsnansum", "tmp", "require_dsnansumors", "__commonJSMin", "exports", "module", "isnan", "dsnansumors", "N", "x", "stride", "sum", "ix", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "dsnansumors", "N", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsnansumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsnansumors", "tmp", "require_dsort2hp", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "dsort2hp", "N", "order", "x", "strideX", "y", "strideY", "offsetX", "offsetY", "parent", "child", "v1", "v2", "tx", "ty", "ix", "iy", "n", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "dsort2hp", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "parent", "child", "v1", "v2", "tx", "ty", "ix", "iy", "n", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsort2hp", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsort2hp", "tmp", "require_dsort2ins", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "dsort2ins", "N", "order", "x", "strideX", "y", "strideY", "flg", "ix", "jx", "fx", "lx", "iy", "jy", "fy", "ly", "vx", "vy", "ux", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "dsort2ins", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "flg", "ix", "jx", "fx", "lx", "iy", "jy", "fy", "ly", "vx", "vy", "ux", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsort2ins", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsort2ins", "tmp", "require_gaps", "__commonJSMin", "exports", "module", "require_dsort2sh", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "dsort2sh", "N", "order", "x", "strideX", "y", "strideY", "offsetX", "offsetY", "flg", "gap", "vx", "vy", "ux", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "dsort2sh", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "flg", "gap", "vx", "vy", "ux", "i", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsort2sh", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsort2sh", "tmp", "require_dsorthp", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "dsorthp", "N", "order", "x", "stride", "offset", "parent", "child", "v1", "v2", "n", "t", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "dsorthp", "N", "order", "x", "stride", "offset", "parent", "child", "v1", "v2", "n", "t", "i", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsorthp", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsorthp", "tmp", "require_dsortins", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "dsortins", "N", "order", "x", "stride", "flg", "ix", "jx", "fx", "lx", "v", "u", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "dsortins", "N", "order", "x", "stride", "offset", "flg", "ix", "jx", "fx", "lx", "v", "u", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsortins", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsortins", "tmp", "require_gaps", "__commonJSMin", "exports", "module", "require_dsortsh", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "dsortsh", "N", "order", "x", "stride", "offset", "flg", "gap", "v", "u", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "dsortsh", "N", "order", "x", "stride", "offset", "flg", "gap", "v", "u", "i", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsortsh", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsortsh", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "dssumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_dssumpw", "__commonJSMin", "exports", "module", "sum", "dssumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dssumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dssumpw", "tmp", "require_dssum", "__commonJSMin", "exports", "module", "dssumpw", "dssum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "dssumpw", "dssum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dssum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dssum", "tmp", "require_dssumors", "__commonJSMin", "exports", "module", "M", "dssumors", "N", "x", "stride", "sum", "ix", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dssumors", "N", "x", "stride", "offset", "sum", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dssumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dssumors", "tmp", "require_dsumkbn", "__commonJSMin", "exports", "module", "abs", "dsumkbn", "N", "x", "stride", "sum", "ix", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "dsumkbn", "N", "x", "stride", "offset", "sum", "ix", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsumkbn", "tmp", "require_dsum", "__commonJSMin", "exports", "module", "dsumkbn", "dsum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "dsumkbn", "dsum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsum", "tmp", "require_dsumkbn2", "__commonJSMin", "exports", "module", "abs", "dsumkbn2", "N", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "dsumkbn2", "N", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsumkbn2", "tmp", "require_dsumors", "__commonJSMin", "exports", "module", "M", "dsumors", "N", "x", "stride", "sum", "ix", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "dsumors", "N", "x", "stride", "offset", "sum", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "dsumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_dsumpw", "__commonJSMin", "exports", "module", "sum", "dsumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "dsumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "dsumpw", "tmp", "require_main", "__commonJSMin", "exports", "module", "M", "gapx", "N", "alpha", "x", "stride", "ix", "i", "m", "require_ndarray", "__commonJSMin", "exports", "module", "M", "gapx", "N", "alpha", "x", "stride", "offset", "ix", "m", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "abs", "gapxsumkbn", "N", "alpha", "x", "stride", "sum", "ix", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "gapxsumkbn", "N", "alpha", "x", "stride", "offset", "sum", "ix", "v", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "gapxsumkbn", "gapxsum", "N", "alpha", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "gapxsumkbn", "gapxsum", "N", "alpha", "x", "stride", "offset", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "abs", "gapxsumkbn2", "N", "alpha", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "gapxsumkbn2", "N", "alpha", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "gapxsumors", "N", "alpha", "x", "stride", "sum", "ix", "i", "require_ndarray", "__commonJSMin", "exports", "module", "gapxsumors", "N", "alpha", "x", "stride", "offset", "sum", "ix", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "gapxsumpw", "N", "alpha", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_main", "__commonJSMin", "exports", "module", "sum", "gapxsumpw", "N", "alpha", "x", "stride", "ix", "s", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "abs", "BLOCKSIZE", "gasumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_main", "__commonJSMin", "exports", "module", "abs", "sum", "gasumpw", "N", "x", "stride", "ix", "s", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "abs", "gcusumkbn", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "s", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "gcusumkbn", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "s", "v", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "gcusumkbn", "gcusum", "N", "sum", "x", "strideX", "y", "strideY", "require_ndarray", "__commonJSMin", "exports", "module", "gcusumkbn", "gcusum", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "abs", "gcusumkbn2", "N", "sum", "x", "strideX", "y", "strideY", "ccs", "ix", "iy", "cs", "cc", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "gcusumkbn2", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ccs", "ix", "iy", "cs", "cc", "v", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "gcusumors", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "i", "require_ndarray", "__commonJSMin", "exports", "module", "gcusumors", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "gcusumpw", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "s", "n", "i", "require_main", "__commonJSMin", "exports", "module", "cusum", "gcusumpw", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_accessors", "__commonJSMin", "exports", "module", "gfill", "N", "alpha", "x", "stride", "offset", "xbuf", "set", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "M", "gfill", "N", "alpha", "x", "stride", "ix", "i", "m", "o", "require_ndarray", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "M", "gfill", "N", "alpha", "x", "stride", "offset", "ix", "m", "o", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_accessors", "__commonJSMin", "exports", "module", "gfillBy", "N", "x", "stride", "offset", "clbk", "thisArg", "xbuf", "set", "get", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "gfillBy", "N", "x", "stride", "clbk", "thisArg", "ix", "o", "i", "require_ndarray", "__commonJSMin", "exports", "module", "arraylike2object", "accessors", "gfillBy", "N", "x", "stride", "offset", "clbk", "thisArg", "ix", "o", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isnan", "abs", "gnannsumkbn", "N", "x", "strideX", "out", "strideOut", "sum", "ix", "io", "v", "c", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "gnannsumkbn", "N", "x", "strideX", "offsetX", "out", "strideOut", "offsetOut", "sum", "ix", "io", "v", "t", "c", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isnan", "abs", "gnansumkbn", "N", "x", "stride", "sum", "ix", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "gnansumkbn", "N", "x", "stride", "offset", "sum", "ix", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "gnansumkbn", "gnansum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "gnansumkbn", "gnansum", "N", "x", "stride", "offset", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isnan", "abs", "gnansumkbn2", "N", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "abs", "gnansumkbn2", "N", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isnan", "gnansumors", "N", "x", "stride", "ix", "s", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "gnansumors", "N", "x", "stride", "offset", "ix", "s", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_ndarray", "__commonJSMin", "exports", "module", "isnan", "floor", "BLOCKSIZE", "gnansumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_main", "__commonJSMin", "exports", "module", "isnan", "sum", "gnansumpw", "N", "x", "stride", "ix", "s", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_accessors", "__commonJSMin", "exports", "module", "floor", "grev", "N", "x", "stride", "offset", "xbuf", "set", "get", "tmp", "ix", "iy", "n", "i", "require_main", "__commonJSMin", "exports", "module", "floor", "arraylike2object", "accessors", "M", "grev", "N", "x", "stride", "tmp", "ix", "iy", "o", "m", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "arraylike2object", "accessors", "M", "grev", "N", "x", "stride", "offset", "tmp", "ix", "iy", "o", "m", "n", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "gsort2hp", "N", "order", "x", "strideX", "y", "strideY", "offsetX", "offsetY", "parent", "child", "v1", "v2", "tx", "ty", "ix", "iy", "n", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "gsort2hp", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "parent", "child", "v1", "v2", "tx", "ty", "ix", "iy", "n", "j", "k", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "gsort2ins", "N", "order", "x", "strideX", "y", "strideY", "flg", "ix", "jx", "fx", "lx", "iy", "jy", "fy", "ly", "vx", "vy", "ux", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "gsort2ins", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "flg", "ix", "jx", "fx", "lx", "iy", "jy", "fy", "ly", "vx", "vy", "ux", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_gaps", "__commonJSMin", "exports", "module", "require_main", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "gsort2sh", "N", "order", "x", "strideX", "y", "strideY", "offsetX", "offsetY", "flg", "gap", "vx", "vy", "ux", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "gsort2sh", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "flg", "gap", "vx", "vy", "ux", "i", "j", "k", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "gsorthp", "N", "order", "x", "stride", "offset", "parent", "child", "v1", "v2", "n", "t", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isPositiveZero", "isnan", "floor", "gsorthp", "N", "order", "x", "stride", "offset", "parent", "child", "v1", "v2", "n", "t", "i", "j", "k", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "gsortins", "N", "order", "x", "stride", "flg", "ix", "jx", "fx", "lx", "v", "u", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "gsortins", "N", "order", "x", "stride", "offset", "flg", "ix", "jx", "fx", "lx", "v", "u", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_gaps", "__commonJSMin", "exports", "module", "require_main", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "gsortsh", "N", "order", "x", "stride", "offset", "flg", "gap", "v", "u", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZero", "isnan", "GAPS", "NGAPS", "gsortsh", "N", "order", "x", "stride", "offset", "flg", "gap", "v", "u", "i", "j", "k", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "abs", "gsumkbn", "N", "x", "stride", "sum", "ix", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "gsumkbn", "N", "x", "stride", "offset", "sum", "ix", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "gsumkbn", "gsum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "gsumkbn", "gsum", "N", "x", "stride", "offset", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "abs", "gsumkbn2", "N", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "abs", "gsumkbn2", "N", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "M", "gsumors", "N", "x", "stride", "ix", "m", "s", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "gsumors", "N", "x", "stride", "offset", "ix", "m", "s", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "BLOCKSIZE", "gsumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_main", "__commonJSMin", "exports", "module", "sum", "gsumpw", "N", "x", "stride", "ix", "s", "i", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_sapx", "__commonJSMin", "exports", "module", "M", "sapx", "N", "alpha", "x", "stride", "ix", "i", "m", "require_ndarray", "__commonJSMin", "exports", "module", "M", "sapx", "N", "alpha", "x", "stride", "offset", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sapx", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sapx", "tmp", "require_sapxsumkbn", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "sapxsumkbn", "N", "alpha", "x", "stride", "sum", "ix", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "sapxsumkbn", "N", "alpha", "x", "stride", "offset", "sum", "ix", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sapxsumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sapxsumkbn", "tmp", "require_sapxsum", "__commonJSMin", "exports", "module", "sapxsumkbn", "sapxsum", "N", "alpha", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "sapxsumkbn", "sapxsum", "N", "alpha", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sapxsum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sapxsum", "tmp", "require_sapxsumkbn2", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "sapxsumkbn2", "N", "alpha", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "sapxsumkbn2", "N", "alpha", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sapxsumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sapxsumkbn2", "tmp", "require_sapxsumors", "__commonJSMin", "exports", "module", "float64ToFloat32", "sapxsumors", "N", "alpha", "x", "stride", "sum", "ix", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "sapxsumors", "N", "alpha", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sapxsumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sapxsumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "floor", "BLOCKSIZE", "sapxsumpw", "N", "alpha", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_sapxsumpw", "__commonJSMin", "exports", "module", "float64ToFloat32", "sum", "sapxsumpw", "N", "alpha", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sapxsumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sapxsumpw", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "floor", "abs", "BLOCKSIZE", "sasumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_sasumpw", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "sum", "sasumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sasumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sasumpw", "tmp", "require_scusumkbn", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "scusumkbn", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "s", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "scusumkbn", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "s", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scusumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "scusumkbn", "tmp", "require_scusum", "__commonJSMin", "exports", "module", "scusumkbn", "scusum", "N", "sum", "x", "strideX", "y", "strideY", "require_ndarray", "__commonJSMin", "exports", "module", "scusumkbn", "scusum", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scusum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "scusum", "tmp", "require_scusumkbn2", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "scusumkbn2", "N", "sum", "x", "strideX", "y", "strideY", "ccs", "ix", "iy", "cs", "cc", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "scusumkbn2", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ccs", "ix", "iy", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scusumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "scusumkbn2", "tmp", "require_scusumors", "__commonJSMin", "exports", "module", "float64ToFloat32", "scusumors", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "scusumors", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scusumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "scusumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "floor", "BLOCKSIZE", "scusumpw", "N", "sum", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "s", "n", "i", "require_scusumpw", "__commonJSMin", "exports", "module", "cusum", "scusumpw", "N", "sum", "x", "strideX", "y", "strideY", "ix", "iy", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scusumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "scusumpw", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "floor", "BLOCKSIZE", "sdsapxsumpw", "N", "alpha", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_sdsapxsumpw", "__commonJSMin", "exports", "module", "float64ToFloat32", "sum", "sdsapxsumpw", "N", "alpha", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdsapxsumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdsapxsumpw", "tmp", "require_sdsapxsum", "__commonJSMin", "exports", "module", "sdsapxsumpw", "sdsapxsum", "N", "alpha", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "sdsapxsumpw", "sdsapxsum", "N", "alpha", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdsapxsum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdsapxsum", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "floor", "BLOCKSIZE", "sdsnansumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_sdsnansumpw", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "sum", "sdsnansumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdsnansumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdsnansumpw", "tmp", "require_sdsnansum", "__commonJSMin", "exports", "module", "sdsnansumpw", "sdsnansum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "sdsnansumpw", "sdsnansum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdsnansum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdsnansum", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "floor", "BLOCKSIZE", "sdssumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_sdssumpw", "__commonJSMin", "exports", "module", "float64ToFloat32", "sum", "sdssumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdssumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdssumpw", "tmp", "require_sdssum", "__commonJSMin", "exports", "module", "sdssumpw", "sdssum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "sdssumpw", "sdssum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sdssum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sdssum", "tmp", "require_sfill", "__commonJSMin", "exports", "module", "M", "sfill", "N", "alpha", "x", "stride", "ix", "i", "m", "require_ndarray", "__commonJSMin", "exports", "module", "M", "sfill", "N", "alpha", "x", "stride", "offset", "ix", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "sfill", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "sfill", "tmp", "require_snansumkbn", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "abs", "snansumkbn", "N", "x", "stride", "sum", "ix", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "abs", "snansumkbn", "N", "x", "stride", "offset", "sum", "ix", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "snansumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "snansumkbn", "tmp", "require_snansum", "__commonJSMin", "exports", "module", "snansumkbn", "snansum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "snansumkbn", "snansum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "snansum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "snansum", "tmp", "require_snansumkbn2", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "abs", "snansumkbn2", "N", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "abs", "snansumkbn2", "N", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "snansumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "snansumkbn2", "tmp", "require_snansumors", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "snansumors", "N", "x", "stride", "sum", "ix", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "snansumors", "N", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "snansumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "snansumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "floor", "BLOCKSIZE", "snansumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_snansumpw", "__commonJSMin", "exports", "module", "float64ToFloat32", "isnanf", "sum", "snansumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "snansumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "snansumpw", "tmp", "require_srev", "__commonJSMin", "exports", "module", "floor", "M", "srev", "N", "x", "stride", "tmp", "ix", "iy", "m", "n", "i", "require_ndarray", "__commonJSMin", "exports", "module", "floor", "M", "srev", "N", "x", "stride", "offset", "tmp", "ix", "iy", "m", "n", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "srev", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "srev", "tmp", "require_ssort2hp", "__commonJSMin", "exports", "module", "isPositiveZerof", "isnanf", "floor", "ssort2hp", "N", "order", "x", "strideX", "y", "strideY", "offsetX", "offsetY", "parent", "child", "v1", "v2", "tx", "ty", "ix", "iy", "n", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isPositiveZerof", "isnanf", "floor", "ssort2hp", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "parent", "child", "v1", "v2", "tx", "ty", "ix", "iy", "n", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssort2hp", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssort2hp", "tmp", "require_ssort2ins", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "ssort2ins", "N", "order", "x", "strideX", "y", "strideY", "flg", "ix", "jx", "fx", "lx", "iy", "jy", "fy", "ly", "vx", "vy", "ux", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "ssort2ins", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "flg", "ix", "jx", "fx", "lx", "iy", "jy", "fy", "ly", "vx", "vy", "ux", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssort2ins", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssort2ins", "tmp", "require_gaps", "__commonJSMin", "exports", "module", "require_ssort2sh", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "GAPS", "NGAPS", "ssort2sh", "N", "order", "x", "strideX", "y", "strideY", "offsetX", "offsetY", "flg", "gap", "vx", "vy", "ux", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "GAPS", "NGAPS", "ssort2sh", "N", "order", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "flg", "gap", "vx", "vy", "ux", "i", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssort2sh", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssort2sh", "tmp", "require_ssorthp", "__commonJSMin", "exports", "module", "isPositiveZerof", "isnanf", "floor", "ssorthp", "N", "order", "x", "stride", "offset", "parent", "child", "v1", "v2", "n", "t", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isPositiveZerof", "isnanf", "floor", "ssorthp", "N", "order", "x", "stride", "offset", "parent", "child", "v1", "v2", "n", "t", "i", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssorthp", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssorthp", "tmp", "require_ssortins", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "ssortins", "N", "order", "x", "stride", "flg", "ix", "jx", "fx", "lx", "v", "u", "i", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "ssortins", "N", "order", "x", "stride", "offset", "flg", "ix", "jx", "fx", "lx", "v", "u", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssortins", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssortins", "tmp", "require_gaps", "__commonJSMin", "exports", "module", "require_ssortsh", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "GAPS", "NGAPS", "ssortsh", "N", "order", "x", "stride", "offset", "flg", "gap", "v", "u", "i", "j", "k", "require_ndarray", "__commonJSMin", "exports", "module", "isNegativeZerof", "isnanf", "GAPS", "NGAPS", "ssortsh", "N", "order", "x", "stride", "offset", "flg", "gap", "v", "u", "i", "j", "k", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssortsh", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssortsh", "tmp", "require_ssumkbn", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "ssumkbn", "N", "x", "stride", "sum", "ix", "v", "t", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "ssumkbn", "N", "x", "stride", "offset", "sum", "ix", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssumkbn", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssumkbn", "tmp", "require_ssum", "__commonJSMin", "exports", "module", "ssumkbn", "ssum", "N", "x", "stride", "require_ndarray", "__commonJSMin", "exports", "module", "ssumkbn", "ssum", "N", "x", "stride", "offset", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssum", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssum", "tmp", "require_ssumkbn2", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "ssumkbn2", "N", "x", "stride", "sum", "ccs", "ix", "cs", "cc", "v", "c", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "abs", "ssumkbn2", "N", "x", "stride", "offset", "sum", "ccs", "ix", "cs", "cc", "v", "t", "c", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssumkbn2", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssumkbn2", "tmp", "require_ssumors", "__commonJSMin", "exports", "module", "float64ToFloat32", "ssumors", "N", "x", "stride", "sum", "ix", "i", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "ssumors", "N", "x", "stride", "offset", "sum", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssumors", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssumors", "tmp", "require_ndarray", "__commonJSMin", "exports", "module", "float64ToFloat32", "floor", "BLOCKSIZE", "ssumpw", "N", "x", "stride", "offset", "ix", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "M", "s", "n", "i", "require_ssumpw", "__commonJSMin", "exports", "module", "float64ToFloat32", "sum", "ssumpw", "N", "x", "stride", "ix", "s", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "ssumpw", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "join", "tryRequire", "isError", "main", "ssumpw", "tmp", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_main", "__commonJSMin", "exports", "module", "isndarrayLike", "isCollection", "isFloat64Array", "isFloat32Array", "format", "ddot", "sdot", "dot", "gdot", "x", "y", "isxf64", "isxf32", "isyf64", "isyf32", "isxa", "isxv", "isya", "isyv", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isndarrayLike", "isCollection", "isFloat64Array", "isFloat32Array", "format", "dswap", "sswap", "swap", "gswap", "x", "y", "isxf64", "isxf32", "isyf64", "isyf32", "isxa", "isxv", "isya", "isyv", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFloat32VectorLike", "dot", "format", "sdot", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "isFloat32VectorLike", "format", "swap", "sswap", "x", "y", "require_lib", "__commonJSMin", "exports", "module", "main", "setReadOnly", "ns"] }