From c9d3672e692f17da822a3f1fa3a52708384e304c Mon Sep 17 00:00:00 2001 From: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> Date: Sat, 2 Mar 2024 16:25:21 +0000 Subject: [PATCH 1/8] chore: refactor `blas/ext/base/dfill` to follow current project conventions Signed-off-by: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> --- .../@stdlib/blas/ext/base/dfill/README.md | 34 ++--- .../ext/base/dfill/benchmark/benchmark.js | 17 ++- .../base/dfill/benchmark/benchmark.native.js | 13 +- .../base/dfill/benchmark/benchmark.ndarray.js | 17 ++- .../benchmark/benchmark.ndarray.native.js | 13 +- .../@stdlib/blas/ext/base/dfill/docs/repl.txt | 18 ++- .../blas/ext/base/dfill/docs/types/index.d.ts | 6 +- .../blas/ext/base/dfill/examples/index.js | 22 +-- .../@stdlib/blas/ext/base/dfill/include.gypi | 2 +- .../@stdlib/blas/ext/base/dfill/lib/dfill.js | 2 +- .../blas/ext/base/dfill/lib/dfill.native.js | 2 +- .../blas/ext/base/dfill/lib/ndarray.js | 2 +- .../blas/ext/base/dfill/lib/ndarray.native.js | 13 +- .../@stdlib/blas/ext/base/dfill/manifest.json | 8 +- .../@stdlib/blas/ext/base/dfill/package.json | 4 +- .../@stdlib/blas/ext/base/dfill/src/addon.c | 45 ++++++ .../@stdlib/blas/ext/base/dfill/src/addon.cpp | 128 ------------------ .../blas/ext/base/dfill/test/test.dfill.js | 2 +- .../ext/base/dfill/test/test.dfill.native.js | 2 +- .../blas/ext/base/dfill/test/test.ndarray.js | 2 +- .../base/dfill/test/test.ndarray.native.js | 2 +- 21 files changed, 117 insertions(+), 237 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/dfill/src/addon.c delete mode 100644 lib/node_modules/@stdlib/blas/ext/base/dfill/src/addon.cpp diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md b/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md index 4c38329f6753..584bbcc71f6d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/README.md @@ -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 fill every other element +The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to fill 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 ); -dfill( N, 5.0, x, 2 ); +dfill( 4, 5.0, x, 2 ); // x => [ 5.0, 1.0, 5.0, -5.0, 5.0, 0.0, 5.0, -3.0 ] ``` @@ -67,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 = floor( x0.length/2 ); // Fill every other element... -dfill( N, 5.0, x1, 2 ); +dfill( 3, 5.0, x1, 2 ); // x0 => [ 1.0, 5.0, 3.0, 5.0, 5.0, 5.0 ] ``` @@ -130,27 +126,13 @@ dfill.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 dfill = require( '@stdlib/blas/ext/base/dfill' ); -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 rand = discreteUniform( -100, 100 ); + +var x = filledarrayBy( 10, 'float64', rand ); console.log( x ); dfill( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.js index 24cae44d6820..a6a77a9f8130 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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 dfill = require( './../lib/dfill.js' ); +// VARIABLES // + +var rand = uniform( -10.0, 10.0 ); + + // FUNCTIONS // /** @@ -39,13 +44,7 @@ var dfill = require( './../lib/dfill.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/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.native.js index d694eb470c99..eaea1696624a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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 dfill = tryRequire( resolve( __dirname, './../lib/dfill.native.js' ) ); var opts = { 'skip': ( dfill instanceof Error ) }; +var rand = uniform( -10.0, 10.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/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.js index 8c6c2b32b6cd..1b54c7dc6cc4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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 dfill = require( './../lib/ndarray.js' ); +// VARIABLES // + +var rand = uniform( -10.0, 10.0 ); + + // FUNCTIONS // /** @@ -39,13 +44,7 @@ var dfill = 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/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.native.js index 9af086110aa7..c4321a472a83 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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 dfill = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); var opts = { 'skip': ( dfill instanceof Error ) }; +var rand = uniform( -10.0, 10.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/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt index 2589381fd7d6..6779788d81bb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt @@ -3,8 +3,8 @@ Fills a double-precision floating-point strided array with a specified scalar value. - 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. @@ -28,7 +28,7 @@ Returns ------- x: Float64Array - Input array `x`. + Output array. Examples -------- @@ -39,19 +39,18 @@ // 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 ); - > {{alias}}( N, 5.0, x, 2 ) + > {{alias}}( 3, 5.0, x, 2 ) [ 5.0, 1.0, 5.0, -5.0, 5.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 ); - > {{alias}}( N, 5.0, x1, 2 ) + > {{alias}}( 3, 5.0, x1, 2 ) [ 5.0, 3.0, 5.0, 5.0, 5.0 ] > x0 [ 1.0, 5.0, 3.0, 5.0, 5.0, 5.0 ] + {{alias}}.ndarray( N, alpha, x, stride, offset ) Fills a double-precision floating-point strided array with a specified scalar value using alternative indexing semantics. @@ -80,7 +79,7 @@ Returns ------- x: Float64Array - Input array `x`. + Output array. Examples -------- @@ -91,8 +90,7 @@ // 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 ); - > {{alias}}.ndarray( N, 5.0, x, 2, 1 ) + > {{alias}}.ndarray( 3, 5.0, x, 2, 1 ) [ 1.0, 5.0, 3.0, 5.0, 5.0, 5.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/types/index.d.ts index c84628cea837..0978e9001946 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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 output 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 output 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 output array * * @example * var Float64Array = require( '@stdlib/array/float64' ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/examples/index.js index 22c30bb277bb..c17fccca4a64 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/examples/index.js @@ -18,27 +18,13 @@ '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 dfill = require( './../lib' ); -var rand; -var sign; -var x; -var i; +var rand = discreteUniform( -100, 100 ); -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', rand ); console.log( x ); dfill( x.length, 5.0, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dfill/include.gypi index 868c5c12e852..26476a8c2655 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/include.gypi +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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 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_FLOAT( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, stride, argv, 2 ); + c_dfill( N, alpha, X, stride ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/src/addon.cpp b/lib/node_modules/@stdlib/blas/ext/base/dfill/src/addon.cpp deleted file mode 100644 index cc3e113a3ac2..000000000000 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/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/dfill.h" -#include -#include -#include -#include -#include - -/** -* Add-on namespace. -*/ -namespace stdlib_blas_ext_base_dfill { - - /** - * Fills a double-precision floating-point strided array with a specified scalar 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_dfill( 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_dfill( 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_dfill, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; - } - - NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) -} // end namespace stdlib_blas_ext_base_dfill diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.js index 38385038d9ef..734633328f29 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.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; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.native.js index d0f8f2c9043b..53f6ab6e35f9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.dfill.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; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.ndarray.js index 8d32f30f3a84..dd34e93b3738 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.ndarray.native.js index 2e55def35aad..69806f4c8a4d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/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; From 09551605dddb5889fe5c39eb862fca71a1bf91c6 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 2 Mar 2024 19:04:02 -0800 Subject: [PATCH 2/8] Apply suggestions from code review Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt | 4 ++-- .../@stdlib/blas/ext/base/dfill/docs/types/index.d.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt index 6779788d81bb..98a4276ae3f2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/repl.txt @@ -28,7 +28,7 @@ Returns ------- x: Float64Array - Output array. + Input array. Examples -------- @@ -79,7 +79,7 @@ Returns ------- x: Float64Array - Output array. + Input array. Examples -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/types/index.d.ts index 0978e9001946..7c04af3f9dec 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/docs/types/index.d.ts @@ -29,7 +29,7 @@ interface Routine { * @param alpha - constant * @param x - input array * @param stride - stride length - * @returns output array + * @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 output array + * @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 output array +* @returns input array * * @example * var Float64Array = require( '@stdlib/array/float64' ); From 6818a394f8de3fe62efef140234c5396798c6422 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 2 Mar 2024 19:05:56 -0800 Subject: [PATCH 3/8] Apply suggestions from code review Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.js | 2 +- .../@stdlib/blas/ext/base/dfill/lib/ndarray.native.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.js index 2ff57dc9450d..83494881c497 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.js @@ -32,7 +32,7 @@ var M = 8; * @param {number} alpha - scalar * @param {Float64Array} x - input array * @param {integer} stride - index increment -* @returns {Float64Array} output array +* @returns {Float64Array} input array * * @example * var Float64Array = require( '@stdlib/array/float64' ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.js index 9e2e87813933..fd56066a370b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.js @@ -33,7 +33,7 @@ var M = 8; * @param {Float64Array} x - input array * @param {integer} stride - index increment * @param {NonNegativeInteger} offset - starting index -* @returns {Float64Array} output array +* @returns {Float64Array} input array * * @example * var Float64Array = require( '@stdlib/array/float64' ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.native.js index 802761eb45a0..5cab5b7028ef 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/ndarray.native.js @@ -35,7 +35,7 @@ var addon = require( './dfill.native.js' ); * @param {Float64Array} x - input array * @param {integer} stride - index increment * @param {NonNegativeInteger} offset - starting index -* @returns {Float64Array} output array +* @returns {Float64Array} input array * * @example * var Float64Array = require( '@stdlib/array/float64' ); From 58de3073682d6c25e02b22aec9814e061a8d5e6d Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 2 Mar 2024 19:06:05 -0800 Subject: [PATCH 4/8] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/blas/ext/base/dfill/lib/dfill.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.native.js b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.native.js index 5c938b5a91b0..3a630ebed66f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/lib/dfill.native.js @@ -32,7 +32,7 @@ var addon = require( './../src/addon.node' ); * @param {number} alpha - scalar * @param {Float64Array} x - input array * @param {integer} stride - index increment -* @returns {Float64Array} output array +* @returns {Float64Array} input array * * @example * var Float64Array = require( '@stdlib/array/float64' ); From e482f215d08e678a9b55f45b8d721d7878a2f0c1 Mon Sep 17 00:00:00 2001 From: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:33:17 +0530 Subject: [PATCH 5/8] Update manifest.json indentation --- .../@stdlib/blas/ext/base/dfill/manifest.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json index 715343336e30..a9d2d9d7439c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json @@ -35,12 +35,12 @@ ], "libpath": [], "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-float", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" - ] + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-float", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] } ] } From 9687fb8f227ec4e9c543e79aaa0e753d60e15cbc Mon Sep 17 00:00:00 2001 From: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:45:27 +0530 Subject: [PATCH 6/8] Update manifest.json Signed-off-by: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> --- .../@stdlib/blas/ext/base/dfill/manifest.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json index a9d2d9d7439c..715343336e30 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json @@ -35,12 +35,12 @@ ], "libpath": [], "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-float", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" - ] + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-float", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] } ] } From b17028bce73b4df5a7525f82b9fd2fc6262af7e7 Mon Sep 17 00:00:00 2001 From: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:16:11 +0530 Subject: [PATCH 7/8] Update manifest.json Signed-off-by: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> From 1ba28fea7747b3c4672c18359ad18b42cc5c723c Mon Sep 17 00:00:00 2001 From: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:22:44 +0530 Subject: [PATCH 8/8] fix: indentation Signed-off-by: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> --- .../@stdlib/blas/ext/base/dfill/manifest.json | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json index 715343336e30..73f6ab7a43ce 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dfill/manifest.json @@ -1,46 +1,46 @@ { - "options": {}, - "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": [ - { - "src": [ - "./src/dfill.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ + "options": {}, + "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": [ + { + "src": [ + "./src/dfill.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-float", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-strided-float64array" ] - } - ] + } + ] }