From 0d2528ece212fef00cf6c641c298d174b3c3ba04 Mon Sep 17 00:00:00 2001 From: naveen Date: Thu, 21 Mar 2024 08:48:47 +0530 Subject: [PATCH] refactor: update `blas/ext/base/dapx` to follow current project conventions PR-URL: https://github.com/stdlib-js/stdlib/pull/1954 Closes: https://github.com/stdlib-js/stdlib/issues/1464 Ref: https://github.com/stdlib-js/stdlib/issues/1152 Co-authored-by: Athan Reines Reviewed-by: Athan Reines Signed-off-by: Athan Reines --- .../@stdlib/blas/ext/base/dapx/README.md | 40 ++---- .../blas/ext/base/dapx/benchmark/benchmark.js | 15 +- .../base/dapx/benchmark/benchmark.native.js | 11 +- .../base/dapx/benchmark/benchmark.ndarray.js | 15 +- .../benchmark/benchmark.ndarray.native.js | 11 +- .../@stdlib/blas/ext/base/dapx/docs/repl.txt | 38 ++---- .../blas/ext/base/dapx/docs/types/index.d.ts | 6 +- .../blas/ext/base/dapx/examples/index.js | 22 +-- .../@stdlib/blas/ext/base/dapx/include.gypi | 2 +- .../blas/ext/base/dapx/lib/ndarray.native.js | 9 +- .../@stdlib/blas/ext/base/dapx/manifest.json | 113 ++++++++++------ .../@stdlib/blas/ext/base/dapx/src/addon.c | 45 ++++++ .../@stdlib/blas/ext/base/dapx/src/addon.cpp | 128 ------------------ .../blas/ext/base/dapx/test/test.dapx.js | 4 +- .../ext/base/dapx/test/test.dapx.native.js | 4 +- .../blas/ext/base/dapx/test/test.ndarray.js | 4 +- .../ext/base/dapx/test/test.ndarray.native.js | 4 +- 17 files changed, 187 insertions(+), 284 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/dapx/src/addon.c delete mode 100644 lib/node_modules/@stdlib/blas/ext/base/dapx/src/addon.cpp diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md b/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md index 3449170450a..1aadc282dbc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/README.md @@ -32,7 +32,7 @@ var dapx = require( '@stdlib/blas/ext/base/dapx' ); #### dapx( N, alpha, x, stride ) -Adds a constant `alpha` to each element in a double-precision floating-point strided array `x`. +Adds a constant `alpha` to each element in a double-precision floating-point strided array. ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -50,16 +50,14 @@ The function has the following parameters: - **x**: input [`Float64Array`][@stdlib/array/float64]. - **stride**: index increment. -The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to add a constant to every other element +The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element ```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 ); -dapx( N, 5.0, x, 2 ); +dapx( 4, 5.0, x, 2 ); // x => [ 3.0, 1.0, 8.0, -5.0, 9.0, 0.0, 4.0, -3.0 ] ``` @@ -67,23 +65,21 @@ 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 = floor( x0.length/2 ); // Add a constant to every other element... -dapx( N, 5.0, x1, 2 ); +dapx( 3, 5.0, x1, 2 ); // x0 => [ 1.0, 3.0, 3.0, 1.0, 5.0, -1.0 ] ``` #### dapx.ndarray( N, alpha, x, stride, offset ) -Adds a constant `alpha` to each element in a double-precision floating-point strided array `x` using alternative indexing semantics. +Adds a constant `alpha` to each element in a double-precision floating-point strided array using alternative indexing semantics. ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -98,7 +94,7 @@ The function has the following additional parameters: - **offset**: starting index. -While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of `x` +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -117,7 +113,7 @@ dapx.ndarray( 3, 5.0, x, 1, x.length-3 ); ## Notes -- If `N <= 0`, both functions return `x` unchanged. +- If `N <= 0`, both functions return the strided array unchanged. @@ -130,27 +126,11 @@ dapx.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 dapx = require( '@stdlib/blas/ext/base/dapx' ); -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 ); dapx( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.js index a8b1105782c..1e2ec3f9006 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/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 dapx = require( './../lib/dapx.js' ); +// VARIABLES // + +var rand = uniform( -10.0, 10.0 ); + + // FUNCTIONS // /** @@ -40,12 +45,8 @@ var dapx = require( './../lib/dapx.js' ); */ function createBenchmark( len ) { var x; - var i; - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.native.js index c9624311993..bec331f1727 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/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 dapx = tryRequire( resolve( __dirname, './../lib/dapx.native.js' ) ); var opts = { 'skip': ( dapx instanceof Error ) }; +var rand = uniform( -10.0, 10.0 ); // FUNCTIONS // @@ -49,12 +50,8 @@ var opts = { */ function createBenchmark( len ) { var x; - var i; - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.js index 7fccdbcd49b..0a0fd541875 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/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 dapx = require( './../lib/ndarray.js' ); +// VARIABLES // + +var rand = uniform( -10.0, 10.0 ); + + // FUNCTIONS // /** @@ -40,12 +45,8 @@ var dapx = require( './../lib/ndarray.js' ); */ function createBenchmark( len ) { var x; - var i; - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.native.js index ea4007141b3..77d9e12eeb1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/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 dapx = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); var opts = { 'skip': ( dapx instanceof Error ) }; +var rand = uniform( -10.0, 10.0 ); // FUNCTIONS // @@ -49,12 +50,8 @@ var opts = { */ function createBenchmark( len ) { var x; - var i; - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/repl.txt index 80e0c0b9d3a..2f77bbf08b2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/repl.txt @@ -3,13 +3,13 @@ Adds a constant to each element in a double-precision floating-point strided array. - The `N` and `stride` parameters determine which elements in `x` are accessed - at runtime. + The `N` and stride parameters determine which elements in the strided array + are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use typed array views. - If `N <= 0`, the function returns `x` unchanged. + If `N <= 0`, the function returns the strided array unchanged. Parameters ---------- @@ -23,40 +23,34 @@ Input array. stride: integer - Index increment for `x`. + Index increment. Returns ------- x: Float64Array - Input array `x`. + Input array. Examples -------- // 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 ) [ 3.0, 6.0, 8.0, 0.0, 9.0, 4.0, 2.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 ) [ 3.0, 1.0, 8.0, -5.0, 9.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 ) [ 3.0, 3.0, 1.0, 5.0, -1.0 ] > x0 [ 1.0, 3.0, 3.0, 1.0, 5.0, -1.0 ] + {{alias}}.ndarray( N, alpha, x, stride, offset ) Adds a constant to each element in a double-precision floating-point strided array using alternative indexing semantics. @@ -77,30 +71,26 @@ Input array. stride: integer - Index increment for `x`. + Index increment. offset: integer - Starting index of `x`. + Starting index. Returns ------- x: Float64Array - Input array `x`. + Input array. Examples -------- // 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 ) [ 3.0, 6.0, 8.0, 0.0, 9.0, 4.0, 2.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, 3.0, 3.0, 1.0, 5.0, -1.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/types/index.d.ts index 99f90326ef7..1211a0d3463 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/docs/types/index.d.ts @@ -29,7 +29,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' ); @@ -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/lib/node_modules/@stdlib/blas/ext/base/dapx/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/examples/index.js index 55c57165263..58d039e922b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/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 dapx = 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 ); dapx( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dapx/include.gypi index 868c5c12e85..26476a8c265 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/include.gypi +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/include.gypi @@ -36,7 +36,7 @@ # Source files: 'src_files': [ - '<(src_dir)/addon.cpp', + '<(src_dir)/addon.c', ' + +/** +* 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 node_dapx( 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, stride, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, stride, argv, 2 ); + c_dapx( N, alpha, X, stride ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/src/addon.cpp b/lib/node_modules/@stdlib/blas/ext/base/dapx/src/addon.cpp deleted file mode 100644 index 7280d7e21b6..00000000000 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/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/ext/base/dapx.h" -#include -#include -#include -#include -#include - -/** -* Add-on namespace. -*/ -namespace stdlib_blas_ext_base_dapx { - - /** - * Adds a constant to each element in a double-precision floating-point strided array. - * - * ## 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_dapx( 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_dapx( 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_dapx, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; - } - - NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) -} // end namespace stdlib_blas_ext_base_dapx diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.js index 1ad083a0c40..539c980f43f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.js @@ -86,7 +86,7 @@ tape( 'the function returns a reference to the input array', function test( t ) t.end(); }); -tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `x` unchanged', function test( t ) { +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the output array unchanged', function test( t ) { var expected; var x; @@ -102,7 +102,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu t.end(); }); -tape( 'if `alpha` equals `0`, the function returns `x` unchanged', function test( t ) { +tape( 'if `alpha` equals `0`, the function returns the output array unchanged', function test( t ) { var expected; var x; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.native.js index c90f015cb35..21e7a224008 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.dapx.native.js @@ -95,7 +95,7 @@ tape( 'the function returns a reference to the input array', opts, function test t.end(); }); -tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `x` unchanged', opts, function test( t ) { +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the output array unchanged', opts, function test( t ) { var expected; var x; @@ -111,7 +111,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu t.end(); }); -tape( 'if `alpha` equals `0`, the function returns `x` unchanged', opts, function test( t ) { +tape( 'if `alpha` equals `0`, the function returns the output array unchanged', opts, function test( t ) { var expected; var x; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.js index 2cdbdfb45b2..db2e07f0f97 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.js @@ -86,7 +86,7 @@ tape( 'the function returns a reference to the input array', function test( t ) t.end(); }); -tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `x` unchanged', function test( t ) { +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the output array unchanged', function test( t ) { var expected; var x; @@ -102,7 +102,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu t.end(); }); -tape( 'if `alpha` equals `0`, the function returns `x` unchanged', function test( t ) { +tape( 'if `alpha` equals `0`, the function returns the output array unchanged', function test( t ) { var expected; var x; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.native.js index b7bce4bd8cc..d68862de0c8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dapx/test/test.ndarray.native.js @@ -95,7 +95,7 @@ tape( 'the function returns a reference to the input array', opts, function test t.end(); }); -tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `x` unchanged', opts, function test( t ) { +tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the output array unchanged', opts, function test( t ) { var expected; var x; @@ -111,7 +111,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu t.end(); }); -tape( 'if `alpha` equals `0`, the function returns `x` unchanged', opts, function test( t ) { +tape( 'if `alpha` equals `0`, the function returns the output array unchanged', opts, function test( t ) { var expected; var x;