From 2c62b681dc5bae7d86b20310b2393d875d5058f8 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:12:56 +0000 Subject: [PATCH 1/6] refactor: update to follow current project conventions --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/blas/ext/base/gcusumkbn/README.md | 40 ++++++----------- .../ext/base/gcusumkbn/benchmark/benchmark.js | 22 +++++----- .../gcusumkbn/benchmark/benchmark.ndarray.js | 22 +++++----- .../blas/ext/base/gcusumkbn/docs/repl.txt | 28 ++++++------ .../blas/ext/base/gcusumkbn/examples/index.js | 17 +++----- .../blas/ext/base/gcusumkbn/lib/index.js | 4 +- .../blas/ext/base/gcusumkbn/lib/main.js | 43 +++---------------- .../blas/ext/base/gcusumkbn/lib/ndarray.js | 5 +-- 8 files changed, 60 insertions(+), 121 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md index a1212ae6b0d5..24a398d50bed 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md @@ -59,21 +59,17 @@ The function has the following parameters: - **N**: number of indexed elements. - **sum**: initial sum. - **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array]. -- **strideX**: index increment for `x`. +- **strideX**: stride length for `x`. - **y**: output [`Array`][mdn-array] or [`typed array`][mdn-typed-array]. -- **strideY**: index increment for `y`. +- **strideY**: stride length for `y`. -The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative sum of every other element in `x`, +The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in the strided input array: ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); - var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); - -var v = gcusumkbn( N, 0.0, x, 2, y, 1 ); +var v = gcusumkbn( 4, 0.0, x, 2, y, 1 ); // y => [ 1.0, 3.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] ``` @@ -83,7 +79,6 @@ 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 arrays... var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); @@ -93,9 +88,7 @@ var y0 = new Float64Array( x0.length ); var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element -var N = floor( x0.length / 2 ); - -gcusumkbn( N, 0.0, x1, -2, y1, 1 ); +gcusumkbn( 4, 0.0, x1, -2, y1, 1 ); // y0 => [ 0.0, 0.0, 0.0, 4.0, 6.0, 4.0, 5.0, 0.0 ] ``` @@ -116,17 +109,13 @@ The function has the following additional parameters: - **offsetX**: starting index for `x`. - **offsetY**: starting index for `y`. -While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offsetX and offsetY parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other element in the strided input array starting from the second element and to store in the last `N` elements of the strided output array starting from the last element: ```javascript -var floor = require( '@stdlib/math/base/special/floor' ); - var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -var N = floor( x.length / 2 ); - -gcusumkbn.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); +gcusumkbn.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 ); // y => [ 0.0, 0.0, 0.0, 0.0, 5.0, 1.0, -1.0, 1.0 ] ``` @@ -152,20 +141,15 @@ gcusumkbn.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var Float64Array = require( '@stdlib/array/float64' ); var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); -var y; -var x; -var i; +var x = discreteUniform( 10.0, -100, 100, { + 'dtype': 'float64' +}); +var y = new Float64Array( x.length ); -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = round( randu()*100.0 ); -} console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.js index e284a3506fa9..593979631297 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.js @@ -21,14 +21,22 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var gfill = require( '@stdlib/blas/ext/base/gfill' ); +var Float64Array = require( '@stdlib/array/float64' ); var pkg = require( './../package.json' ).name; var gcusumkbn = require( './../lib/main.js' ); +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + // FUNCTIONS // /** @@ -39,16 +47,8 @@ var gcusumkbn = require( './../lib/main.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var y; - var x; - var i; - - x = []; - y = []; - for ( i = 0; i < len; i++ ) { - x.push( ( randu()*20.0 ) - 10.0 ); - y.push( 0.0 ); - } + var x = uniform( len, -100, 100, options ); + var y = new Float64Array( len ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.ndarray.js index 0be383435519..26974b7cc027 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/benchmark/benchmark.ndarray.js @@ -21,14 +21,22 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var gfill = require( '@stdlib/blas/ext/base/gfill' ); +var Float64Array = require( '@stdlib/array/float64' ); var pkg = require( './../package.json' ).name; var gcusumkbn = require( './../lib/ndarray.js' ); +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + // FUNCTIONS // /** @@ -39,16 +47,8 @@ var gcusumkbn = require( './../lib/ndarray.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var y; - var i; - - x = []; - y = []; - for ( i = 0; i < len; i++ ) { - x.push( ( randu()*20.0 ) - 10.0 ); - y.push( 0.0 ); - } + var x = uniform( len, -100, 100, options ); + var y = new Float64Array( len ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt index 0c379f4f9bff..c59326fa7eba 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt @@ -3,8 +3,8 @@ Computes the cumulative sum of strided array elements using an improved Kahan–Babuška algorithm. - The `N` and `stride` parameters determine which elements in `x` and `y` are - accessed at runtime. + The `N` and stride parameters determine which elements in the strided + arrays are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use a typed array view. @@ -23,13 +23,13 @@ Input array. strideX: integer - Index increment for `x`. + Stride length for `x`. y: Array|TypedArray Output array. strideY: integer - Index increment for `y`. + Stride length for `y`. Returns ------- @@ -44,11 +44,10 @@ > {{alias}}( x.length, 0.0, x, 1, y, 1 ) [ 1.0, -1.0, 1.0 ] - // Using `N` and `stride` parameters: + // Using `N` and stride parameters: > x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ]; > y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > {{alias}}( N, 0.0, x, 2, y, 2 ) + > {{alias}}( 3, 0.0, x, 2, y, 2 ) [ -2.0, 0.0, -1.0, 0.0, 1.0, 0.0 ] // Using view offsets: @@ -56,19 +55,19 @@ > var y0 = new {{alias:@stdlib/array/float64}}( x0.length ); > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); > var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); - > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); - > {{alias}}( N, 0.0, x1, 2, y1, 1 ) + > {{alias}}( 3, 0.0, x1, 2, y1, 1 ) [ -2.0, 0.0, -1.0 ] > y0 [ 0.0, 0.0, 0.0, -2.0, 0.0, -1.0 ] + {{alias}}.ndarray( N, sum, x, strideX, offsetX, y, strideY, offsetY ) Computes the cumulative sum of strided array elements using an improved Kahan–Babuška algorithm and alternative indexing semantics. While typed array views mandate a view offset based on the underlying - buffer, the `offset` parameter supports indexing semantics based on a - starting index. + buffer, the offset parameter support indexing semantics based on starting + indices. Parameters ---------- @@ -82,7 +81,7 @@ Input array. strideX: integer - Index increment for `x`. + Stride length for `x`. offsetX: integer Starting index for `x`. @@ -91,7 +90,7 @@ Output array. strideY: integer - Index increment for `y`. + Stride length for `y`. offsetY: integer Starting index for `y`. @@ -112,8 +111,7 @@ // Advanced indexing: > x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ]; > y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > {{alias}}.ndarray( N, 0.0, x, 2, 1, y, -1, y.length-1 ) + > {{alias}}.ndarray( 3, 0.0, x, 2, 1, y, -1, y.length-1 ) [ 0.0, 0.0, 0.0, -1.0, 0.0, -2.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js index 557a1316954c..7fa76f987b7a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js @@ -18,20 +18,15 @@ 'use strict'; -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var Float64Array = require( '@stdlib/array/float64' ); -var gcusumkbn = require( './../lib' ); +var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); -var y; -var x; -var i; +var x = discreteUniform( 10.0, -100, 100, { + 'dtype': 'float64' +}); +var y = new Float64Array( x.length ); -x = new Float64Array( 10 ); -y = new Float64Array( x.length ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = round( randu()*100.0 ); -} console.log( x ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/index.js index 2131bbb3829f..5445901e9261 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/index.js @@ -33,14 +33,12 @@ * // y => [ 1.0, -1.0, 1.0 ] * * @example -* var floor = require( '@stdlib/math/base/special/floor' ); * var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); * * var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; * var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -* var N = floor( x.length / 2 ); * -* gcusumkbn.ndarray( N, 0.0, x, 2, 1, y, 1, 0 ); +* gcusumkbn.ndarray( 4, 0.0, x, 2, 1, y, 1, 0 ); * // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] */ diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js index 6270d431ae02..8bd4bf3735bb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js @@ -20,7 +20,8 @@ // MODULES // -var abs = require( '@stdlib/math/base/special/abs' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' ); // MAIN // @@ -52,43 +53,9 @@ var abs = require( '@stdlib/math/base/special/abs' ); * // returns [ 1.0, -1.0, 1.0 ] */ function gcusumkbn( N, sum, x, strideX, y, strideY ) { - var ix; - var iy; - var s; - var v; - var t; - var c; - var i; - - if ( N <= 0 ) { - return y; - } - if ( strideX < 0 ) { - ix = (1-N) * strideX; - } else { - ix = 0; - } - if ( strideY < 0 ) { - iy = (1-N) * strideY; - } else { - iy = 0; - } - s = sum; - c = 0.0; - for ( i = 0; i < N; i++ ) { - v = x[ ix ]; - t = s + v; - if ( abs( s ) >= abs( v ) ) { - c += (s-t) + v; - } else { - c += (v-t) + s; - } - s = t; - y[ iy ] = s + c; - ix += strideX; - iy += strideY; - } - return y; + var ox = stride2offset( N, strideX ); + var oy = stride2offset( N, strideY ); + return ndarray( N, sum, x, strideX, ox, y, strideY, oy ); } diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js index 65064a686467..fc331f606d86 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js @@ -47,13 +47,10 @@ var abs = require( '@stdlib/math/base/special/abs' ); * @returns {NumericArray} output array * * @example -* var floor = require( '@stdlib/math/base/special/floor' ); -* * var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; * var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; -* var N = floor( x.length / 2 ); * -* gcusumkbn( N, 0.0, x, 2, 1, y, 1, 0 ); +* gcusumkbn( 4, 0.0, x, 2, 1, y, 1, 0 ); * // y => [ 1.0, -1.0, 1.0, 5.0, 0.0, 0.0, 0.0, 0.0 ] */ function gcusumkbn( N, sum, x, strideX, offsetX, y, strideY, offsetY ) { From 80cd926f149253f32083ca98e4ecdc9338436a45 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:53:00 +0000 Subject: [PATCH 2/6] fix: apply code review suggestions --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../blas/ext/base/gcusumkbn/docs/types/index.d.ts | 12 ++++++------ .../blas/ext/base/gcusumkbn/examples/index.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/types/index.d.ts index eb821d4a5fa7..03a5c842cccc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/types/index.d.ts @@ -32,9 +32,9 @@ interface Routine { * @param N - number of indexed elements * @param sum - initial sum * @param x - input array - * @param strideX - `x` stride length + * @param strideX - stride length for `x` * @param y - output array - * @param strideY - `y` stride length + * @param strideY - stride length for `y` * @returns output array * * @example @@ -52,10 +52,10 @@ interface Routine { * @param N - number of indexed elements * @param sum - initial sum * @param x - input array - * @param strideX - `x` stride length + * @param strideX - stride length for `x` * @param offsetX - starting index for `x` * @param y - output array - * @param strideY - `y` stride length + * @param strideY - stride length for `y` * @param offsetY - starting index for `y` * @returns output array * @@ -75,9 +75,9 @@ interface Routine { * @param N - number of indexed elements * @param sum - initial sum * @param x - input array -* @param strideX - `x` stride length +* @param strideX - stride length for `x` * @param y - output array -* @param strideY - `y` stride length +* @param strideY - stride length for `y` * @returns output array * * @example diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js index 7fa76f987b7a..bc54ef0c0874 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js @@ -20,7 +20,7 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var Float64Array = require( '@stdlib/array/float64' ); -var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); +var gcusumkbn = require( './../lib' ); var x = discreteUniform( 10.0, -100, 100, { 'dtype': 'float64' From ee28255199579e9b6827c3889bbe15e7fcd6584c Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 31 Dec 2024 13:22:31 +0000 Subject: [PATCH 3/6] docs: apply code review suggestions --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js | 4 ++-- .../@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js index 8bd4bf3735bb..03ff7b8bdd55 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/main.js @@ -40,9 +40,9 @@ var ndarray = require( './ndarray.js' ); * @param {PositiveInteger} N - number of indexed elements * @param {number} sum - initial sum * @param {NumericArray} x - input array -* @param {integer} strideX - `x` stride length +* @param {integer} strideX - stride length for `x` * @param {NumericArray} y - output array -* @param {integer} strideY - `y` stride length +* @param {integer} strideY - stride length for `y` * @returns {NumericArray} output array * * @example diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js index fc331f606d86..346e4d33317f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/lib/ndarray.js @@ -39,10 +39,10 @@ var abs = require( '@stdlib/math/base/special/abs' ); * @param {PositiveInteger} N - number of indexed elements * @param {number} sum - initial sum * @param {NumericArray} x - input array -* @param {integer} strideX - `x` stride length +* @param {integer} strideX - stride length for `x` * @param {NonNegativeInteger} offsetX - starting index for `x` * @param {NumericArray} y - output array -* @param {integer} strideY - `y` stride length +* @param {integer} strideY - stride length for `y` * @param {NonNegativeInteger} offsetY - starting index for `y` * @returns {NumericArray} output array * From 98eb9fe2cb7653333d3bbc1facc04f0381f25c14 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:34:54 +0500 Subject: [PATCH 4/6] docs: apply review suggestion Signed-off-by: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md index 24a398d50bed..283fd2cd3c05 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md @@ -63,7 +63,7 @@ The function has the following parameters: - **y**: output [`Array`][mdn-array] or [`typed array`][mdn-typed-array]. - **strideY**: stride length for `y`. -The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element in the strided input array: +The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to compute the cumulative sum of every other element: ```javascript var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ]; From e1f7b8db0fbcb5af5a081837f87aed459198e1ce Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:43:52 +0000 Subject: [PATCH 5/6] docs: apply code review suggestion --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt index c59326fa7eba..d25cb47d621a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt @@ -3,8 +3,8 @@ Computes the cumulative sum of strided array elements using an improved Kahan–Babuška algorithm. - The `N` and stride parameters determine which elements in the strided - arrays are accessed at runtime. + The `N` and stride parameters determine which elements in the strided arrays + are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use a typed array view. From 256420878f89377652da7692287816e90f21b032 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 1 Jan 2025 19:45:23 -0800 Subject: [PATCH 6/6] Apply suggestions from code review Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md | 4 ++-- .../@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt | 2 +- .../@stdlib/blas/ext/base/gcusumkbn/examples/index.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md index 283fd2cd3c05..f7d91d8a1853 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/README.md @@ -109,7 +109,7 @@ The function has the following additional parameters: - **offsetX**: starting index for `x`. - **offsetY**: starting index for `y`. -While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offsetX and offsetY parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other element in the strided input array starting from the second element and to store in the last `N` elements of the strided output array starting from the last element: +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offset parameters support indexing semantics based on starting indices. For example, to calculate the cumulative sum of every other element in the strided input array starting from the second element and to store in the last `N` elements of the strided output array starting from the last element: ```javascript var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ]; @@ -145,7 +145,7 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var Float64Array = require( '@stdlib/array/float64' ); var gcusumkbn = require( '@stdlib/blas/ext/base/gcusumkbn' ); -var x = discreteUniform( 10.0, -100, 100, { +var x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); var y = new Float64Array( x.length ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt index d25cb47d621a..9dad6dd9f89f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/docs/repl.txt @@ -66,7 +66,7 @@ Kahan–Babuška algorithm and alternative indexing semantics. While typed array views mandate a view offset based on the underlying - buffer, the offset parameter support indexing semantics based on starting + buffer, the offset parameters support indexing semantics based on starting indices. Parameters diff --git a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js index bc54ef0c0874..9f7dcf49da63 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/gcusumkbn/examples/index.js @@ -22,7 +22,7 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var Float64Array = require( '@stdlib/array/float64' ); var gcusumkbn = require( './../lib' ); -var x = discreteUniform( 10.0, -100, 100, { +var x = discreteUniform( 10, -100, 100, { 'dtype': 'float64' }); var y = new Float64Array( x.length );