From 2f1d3aa2e81c92162250372a4be45c648226583c Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 5 Dec 2025 18:51:13 +0530 Subject: [PATCH 1/9] feat: add blas/ext/base/ndarray/ssumkbn --- .../blas/ext/base/ndarray/ssumkbn/README.md | 124 +++++++++++++ .../ndarray/ssumkbn/benchmark/benchmark.js | 102 +++++++++++ .../ext/base/ndarray/ssumkbn/docs/repl.txt | 32 ++++ .../ndarray/ssumkbn/docs/types/index.d.ts | 46 +++++ .../base/ndarray/ssumkbn/docs/types/test.ts | 57 ++++++ .../base/ndarray/ssumkbn/examples/index.js | 33 ++++ .../ext/base/ndarray/ssumkbn/lib/index.js | 45 +++++ .../blas/ext/base/ndarray/ssumkbn/lib/main.js | 56 ++++++ .../ext/base/ndarray/ssumkbn/package.json | 71 +++++++ .../ext/base/ndarray/ssumkbn/test/test.js | 173 ++++++++++++++++++ 10 files changed, 739 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md new file mode 100644 index 000000000000..9e46101442e6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md @@ -0,0 +1,124 @@ + + +# ssumkbn + +> Compute the sum of all elements in a one-dimensional single-precision floating-point ndarray using an improved Kahan–Babuška algorithm. + +
+ +
+ + + +
+ +## Usage + +```javascript +var ssumkbn = require( '@stdlib/blas/ext/base/ndarray/ssumkbn' ); +``` + +#### ssumkbn( arrays ) + +Computes the sum of all elements in a one-dimensional single-precision floating-point ndarray using an improved Kahan–Babuška algorithm. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); + +var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); +var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); + +var v = ssumkbn( [ x ] ); +// returns 10.0 +``` + +The function has the following parameters: + +- **arrays**: array-like object containing a one-dimensional input ndarray. + +
+ + + +
+ +## Notes + +- If provided an empty one-dimensional ndarray, the function returns `0.0`. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var ssumkbn = require( '@stdlib/blas/ext/base/ndarray/ssumkbn' ); + +var xbuf = discreteUniform( 10, -50, 50, { + 'dtype': 'float32' +}); +var x = new ndarray( 'float32', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); +console.log( ndarray2array( x ) ); + +var v = ssumkbn( [ x ] ); +console.log( v ); +``` + +
+ + + +
+ +## References + +- Neumaier, Arnold. 1974. "Rounding Error Analysis of Some Methods for Summing Finite Sums." _Zeitschrift Für Angewandte Mathematik Und Mechanik_ 54 (1): 39–51. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106). + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js new file mode 100644 index 000000000000..44504d0368e3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js @@ -0,0 +1,102 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var bench = require('@stdlib/bench'); +var uniform = require('@stdlib/random/array/uniform'); +var isnanf = require('@stdlib/math/base/assert/is-nanf'); +var pow = require('@stdlib/math/base/special/pow'); +var ndarray = require('@stdlib/ndarray/base/ctor'); +var pkg = require('./../package.json').name; +var ssumkbn = require('./../lib'); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark(len) { + var xbuf; + var x; + + xbuf = uniform(len, -10.0, 10.0, options); + x = new ndarray(options.dtype, xbuf, [len], [1], 0, 'row-major'); + + return benchmark; + + function benchmark(b) { + var v; + var i; + + b.tic(); + for (i = 0; i < b.iterations; i++) { + v = ssumkbn([x]); + if (isnanf(v)) { + b.fail('should not return NaN'); + } + } + b.toc(); + if (isnanf(v)) { + b.fail('should not return NaN'); + } + b.pass('benchmark finished'); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for (i = min; i <= max; i++) { + len = pow(10, i); + f = createBenchmark(len); + bench(pkg + ':len=' + len, f); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/repl.txt new file mode 100644 index 000000000000..e1957d1cf7af --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/repl.txt @@ -0,0 +1,32 @@ + +{{alias}}( arrays ) + Computes the sum of all elements in a one-dimensional single-precision + floating-point ndarray using an improved Kahan–Babuška algorithm. + + If provided an empty ndarray, the function returns `0.0`. + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing a one-dimensional input ndarray. + + Returns + ------- + out: number + Sum. + + Examples + -------- + > var xbuf = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 3.0 ] ); + > var dt = 'float32'; + > var sh = [ xbuf.length ]; + > var sx = [ 1 ]; + > var ox = 0; + > var ord = 'row-major'; + > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord ); + > {{alias}}( [ x ] ) + 6.0 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts new file mode 100644 index 000000000000..0b861748d7a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts @@ -0,0 +1,46 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +// TypeScript Version: 4.1 + +/// + +import { float32ndarray } from '@stdlib/types/ndarray'; + +/** +* Computes the sum of all elements in a one-dimensional single-precision floating-point ndarray using an improved Kahan–Babuška algorithm. +* +* @param arrays - array-like object containing an input ndarray +* @returns sum +* +* @example +* var Float32Array = require('@stdlib/array/float32'); +* var ndarray = require('@stdlib/ndarray/base/ctor'); +* +* var xbuf = new Float32Array([1.0, 3.0, 4.0, 2.0]); +* var x = new ndarray('float32', xbuf, [4], [1], 0, 'row-major'); +* +* var v = ssumkbn([x]); +* // returns 10.0 +*/ +declare function ssumkbn(arrays: [float32ndarray]): number; + + +// EXPORTS // + +export = ssumkbn; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts new file mode 100644 index 000000000000..629a34359360 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +/* eslint-disable space-in-parens */ + +import zeros = require('@stdlib/ndarray/zeros'); +import ssumkbn = require('./index'); + + +// TESTS // + +// The function returns a number... +{ + const x = zeros([10], { + 'dtype': 'float32' + }); + + ssumkbn([x]); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + ssumkbn('10'); // $ExpectError + ssumkbn(10); // $ExpectError + ssumkbn(true); // $ExpectError + ssumkbn(false); // $ExpectError + ssumkbn(null); // $ExpectError + ssumkbn(undefined); // $ExpectError + ssumkbn([]); // $ExpectError + ssumkbn({}); // $ExpectError + ssumkbn((x: number): number => x); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros([10], { + 'dtype': 'float32' + }); + + ssumkbn(); // $ExpectError + ssumkbn([x], 10); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js new file mode 100644 index 000000000000..956211dce3a9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +var discreteUniform = require('@stdlib/random/array/discrete-uniform'); +var ndarray = require('@stdlib/ndarray/base/ctor'); +var ndarray2array = require('@stdlib/ndarray/to-array'); +var ssumkbn = require('./../lib'); + +var xbuf = discreteUniform(10, -50, 50, { + 'dtype': 'float32' +}); +var x = new ndarray('float32', xbuf, [xbuf.length], [1], 0, 'row-major'); +console.log(ndarray2array(x)); + +var v = ssumkbn([x]); +console.log(v); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js new file mode 100644 index 000000000000..aa0d77a7e276 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +/** +* Compute the sum of all elements in a one-dimensional single-precision floating-point ndarray using an improved Kahan-Babuška algorithm. +* +* @module @stdlib/blas/ext/base/ndarray/ssumkbn +* +* @example +* var Float32Array = require('@stdlib/array/float32'); +* var ndarray = require('@stdlib/ndarray/base/ctor'); +* var ssumkbn = require('@stdlib/blas/ext/base/ndarray/ssumkbn'); +* +* var xbuf = new Float32Array([1.0, 3.0, 4.0, 2.0]); +* var x = new ndarray('float32', xbuf, [4], [1], 0, 'row-major'); +* +* var v = ssumkbn([x]); +* // returns 10.0 +*/ + +// MODULES // + +var main = require('./main.js'); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js new file mode 100644 index 000000000000..4dad6159513c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js @@ -0,0 +1,56 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require('@stdlib/ndarray/base/numel-dimension'); +var getStride = require('@stdlib/ndarray/base/stride'); +var getOffset = require('@stdlib/ndarray/base/offset'); +var getData = require('@stdlib/ndarray/base/data-buffer'); +var strided = require('@stdlib/blas/ext/base/ssumkbn').ndarray; + + +// MAIN // + +/** +* Computes the sum of all elements in a one-dimensional single-precision floating-point ndarray using an improved Kahan-Babuška algorithm. +* +* @param {ArrayLikeObject} arrays - array-like object containing an input ndarray +* @returns {number} sum +* +* @example +* var Float32Array = require('@stdlib/array/float32'); +* var ndarray = require('@stdlib/ndarray/base/ctor'); +* +* var xbuf = new Float32Array([1.0, 3.0, 4.0, 2.0]); +* var x = new ndarray('float32', xbuf, [4], [1], 0, 'row-major'); +* +* var v = ssumkbn([x]); +* // returns 10.0 +*/ +function ssumkbn(arrays) { + var x = arrays[0]; + return strided(numelDimension(x, 0), getData(x), getStride(x, 0), getOffset(x)); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = ssumkbn; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json new file mode 100644 index 000000000000..5b97d5fd1942 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json @@ -0,0 +1,71 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/ssumkbn", + "version": "0.0.0", + "description": "Compute the sum of all elements in a one-dimensional single-precision floating-point ndarray using an improved Kahan-Babuška algorithm.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "statistics", + "stats", + "mathematics", + "math", + "blas", + "extended", + "sum", + "total", + "summation", + "kahan", + "kbn", + "ndarray", + "float32", + "single", + "float32array" + ], + "__stdlib__": {} +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js new file mode 100644 index 000000000000..9d5c43229c96 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js @@ -0,0 +1,173 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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. +*/ + +'use strict'; + +// MODULES // + +var tape = require('tape'); +var isnanf = require('@stdlib/math/base/assert/is-nanf'); +var isPositiveZerof = require('@stdlib/math/base/assert/is-positive-zerof'); +var Float32Array = require('@stdlib/array/float32'); +var ndarray = require('@stdlib/ndarray/base/ctor'); +var ssumkbn = require('./../lib'); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Float32Array} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector(buffer, length, stride, offset) { + return new ndarray('float32', buffer, [length], [stride], offset, 'row-major'); +} + + +// TESTS // + +tape('main export is a function', function test(t) { + t.ok(true, __filename); + t.strictEqual(typeof ssumkbn, 'function', 'main export is a function'); + t.end(); +}); + +tape('the function has an arity of 1', function test(t) { + t.strictEqual(ssumkbn.length, 1, 'has expected arity'); + t.end(); +}); + +tape('the function computes the sum of all elements in a one-dimensional ndarray', function test(t) { + var x; + var v; + + x = new Float32Array([1.0, -2.0, -4.0, 5.0, 0.0, 3.0]); + v = ssumkbn([vector(x, 6, 1, 0)]); + t.strictEqual(v, 3.0, 'returns expected value'); + + x = new Float32Array([-4.0, -5.0]); + v = ssumkbn([vector(x, 2, 1, 0)]); + t.strictEqual(v, -9.0, 'returns expected value'); + + x = new Float32Array([-0.0, 0.0, -0.0]); + v = ssumkbn([vector(x, 3, 1, 0)]); + t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); + + x = new Float32Array([NaN]); + v = ssumkbn([vector(x, 1, 1, 0)]); + t.strictEqual(isnanf(v), true, 'returns expected value'); + + x = new Float32Array([NaN, NaN]); + v = ssumkbn([vector(x, 2, 1, 0)]); + t.strictEqual(isnanf(v), true, 'returns expected value'); + + t.end(); +}); + +tape('if provided an empty vector, the function returns `0.0`', function test(t) { + var x; + var v; + + x = new Float32Array([]); + + v = ssumkbn([vector(x, 0, 1, 0)]); + t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); + + t.end(); +}); + +tape('if provided a vector containing a single element, the function returns that element', function test(t) { + var x; + var v; + + x = new Float32Array([1.0]); + + v = ssumkbn([vector(x, 1, 1, 0)]); + t.strictEqual(v, 1.0, 'returns expected value'); + + t.end(); +}); + +tape('the function supports one-dimensional ndarrays having non-unit strides', function test(t) { + var x; + var v; + + x = new Float32Array([ + 1.0, // 0 + 2.0, + 2.0, // 1 + -7.0, + -2.0, // 2 + 3.0, + 4.0, // 3 + 2.0 + ]); + + v = ssumkbn([vector(x, 4, 2, 0)]); + + t.strictEqual(v, 5.0, 'returns expected value'); + t.end(); +}); + +tape('the function supports one-dimensional ndarrays having negative strides', function test(t) { + var x; + var v; + + x = new Float32Array([ + 1.0, // 3 + 2.0, + 2.0, // 2 + -7.0, + -2.0, // 1 + 3.0, + 4.0, // 0 + 2.0 + ]); + + v = ssumkbn([vector(x, 4, -2, 6)]); + + t.strictEqual(v, 5.0, 'returns expected value'); + t.end(); +}); + +tape('the function supports one-dimensional ndarrays having non-zero offsets', function test(t) { + var x; + var v; + + x = new Float32Array([ + 2.0, + 1.0, // 0 + 2.0, + -2.0, // 1 + -2.0, + 2.0, // 2 + 3.0, + 4.0 // 3 + ]); + + v = ssumkbn([vector(x, 4, 2, 1)]); + t.strictEqual(v, 5.0, 'returns expected value'); + + t.end(); +}); From a295bffabcf3e7210b649edba0d1e9115a7dc672 Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 5 Dec 2025 19:08:55 +0530 Subject: [PATCH 2/9] lint --- .../blas/ext/base/ndarray/ssumkbn/README.md | 2 - .../ndarray/ssumkbn/benchmark/benchmark.js | 16 ++++---- .../ndarray/ssumkbn/docs/types/index.d.ts | 8 ++-- .../base/ndarray/ssumkbn/docs/types/test.ts | 2 +- .../base/ndarray/ssumkbn/examples/index.js | 10 ++--- .../ext/base/ndarray/ssumkbn/lib/index.js | 14 +++---- .../blas/ext/base/ndarray/ssumkbn/lib/main.js | 18 ++++----- .../ext/base/ndarray/ssumkbn/package.json | 2 +- .../ext/base/ndarray/ssumkbn/test/test.js | 40 +++++++++---------- 9 files changed, 55 insertions(+), 57 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md index 9e46101442e6..1e2d31b63a0f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md @@ -117,8 +117,6 @@ console.log( v ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js index 44504d0368e3..6e1a7bfced9b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js @@ -20,13 +20,13 @@ // MODULES // -var bench = require('@stdlib/bench'); -var uniform = require('@stdlib/random/array/uniform'); -var isnanf = require('@stdlib/math/base/assert/is-nanf'); -var pow = require('@stdlib/math/base/special/pow'); -var ndarray = require('@stdlib/ndarray/base/ctor'); -var pkg = require('./../package.json').name; -var ssumkbn = require('./../lib'); +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var pkg = require( './../package.json' ).name; +var ssumkbn = require( './../lib' ); // VARIABLES // @@ -50,7 +50,7 @@ function createBenchmark(len) { var x; xbuf = uniform(len, -10.0, 10.0, options); - x = new ndarray(options.dtype, xbuf, [len], [1], 0, 'row-major'); + x = new ndarray( options.dtype, xbuf, [len], [1], 0, 'row-major' ); return benchmark; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts index 0b861748d7a0..766f316a01ad 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts @@ -32,13 +32,13 @@ import { float32ndarray } from '@stdlib/types/ndarray'; * var Float32Array = require('@stdlib/array/float32'); * var ndarray = require('@stdlib/ndarray/base/ctor'); * -* var xbuf = new Float32Array([1.0, 3.0, 4.0, 2.0]); -* var x = new ndarray('float32', xbuf, [4], [1], 0, 'row-major'); +* var xbuf = new Float32Array( [1.0, 3.0, 4.0, 2.0] ); +* var x = new ndarray( 'float32', xbuf, [4], [1], 0, 'row-major' ); * -* var v = ssumkbn([x]); +* var v = ssumkbn( [x] ); * // returns 10.0 */ -declare function ssumkbn(arrays: [float32ndarray]): number; +declare function ssumkbn( arrays: [float32ndarray] ): number; // EXPORTS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts index 629a34359360..366cda315ddd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts @@ -53,5 +53,5 @@ import ssumkbn = require('./index'); }); ssumkbn(); // $ExpectError - ssumkbn([x], 10); // $ExpectError + ssumkbn([x], {}); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js index 956211dce3a9..cd8a519b536e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js @@ -18,15 +18,15 @@ 'use strict'; -var discreteUniform = require('@stdlib/random/array/discrete-uniform'); -var ndarray = require('@stdlib/ndarray/base/ctor'); -var ndarray2array = require('@stdlib/ndarray/to-array'); -var ssumkbn = require('./../lib'); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var ssumkbn = require( './../lib' ); var xbuf = discreteUniform(10, -50, 50, { 'dtype': 'float32' }); -var x = new ndarray('float32', xbuf, [xbuf.length], [1], 0, 'row-major'); +var x = new ndarray( 'float32', xbuf, [xbuf.length], [1], 0, 'row-major' ); console.log(ndarray2array(x)); var v = ssumkbn([x]); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js index aa0d77a7e276..96cad0e9ffe6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js @@ -24,20 +24,20 @@ * @module @stdlib/blas/ext/base/ndarray/ssumkbn * * @example -* var Float32Array = require('@stdlib/array/float32'); -* var ndarray = require('@stdlib/ndarray/base/ctor'); -* var ssumkbn = require('@stdlib/blas/ext/base/ndarray/ssumkbn'); +* var Float32Array = require( '@stdlib/array/float32' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); +* var ssumkbn = require( '@stdlib/blas/ext/base/ndarray/ssumkbn' ); * -* var xbuf = new Float32Array([1.0, 3.0, 4.0, 2.0]); -* var x = new ndarray('float32', xbuf, [4], [1], 0, 'row-major'); +* var xbuf = new Float32Array( [1.0, 3.0, 4.0, 2.0] ); +* var x = new ndarray( 'float32', xbuf, [4], [1], 0, 'row-major' ); * -* var v = ssumkbn([x]); +* var v = ssumkbn( [x] ); * // returns 10.0 */ // MODULES // -var main = require('./main.js'); +var main = require( './main.js' ); // EXPORTS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js index 4dad6159513c..edfd3ca98d2f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js @@ -20,11 +20,11 @@ // MODULES // -var numelDimension = require('@stdlib/ndarray/base/numel-dimension'); -var getStride = require('@stdlib/ndarray/base/stride'); -var getOffset = require('@stdlib/ndarray/base/offset'); -var getData = require('@stdlib/ndarray/base/data-buffer'); -var strided = require('@stdlib/blas/ext/base/ssumkbn').ndarray; +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/ext/base/ssumkbn' ).ndarray; // MAIN // @@ -36,11 +36,11 @@ var strided = require('@stdlib/blas/ext/base/ssumkbn').ndarray; * @returns {number} sum * * @example -* var Float32Array = require('@stdlib/array/float32'); -* var ndarray = require('@stdlib/ndarray/base/ctor'); +* var Float32Array = require( '@stdlib/array/float32' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); * -* var xbuf = new Float32Array([1.0, 3.0, 4.0, 2.0]); -* var x = new ndarray('float32', xbuf, [4], [1], 0, 'row-major'); +* var xbuf = new Float32Array( [1.0, 3.0, 4.0, 2.0] ); +* var x = new ndarray( 'float32', xbuf, [4], [1], 0, 'row-major' ); * * var v = ssumkbn([x]); * // returns 10.0 diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json index 5b97d5fd1942..e0694b779a2c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/package.json @@ -68,4 +68,4 @@ "float32array" ], "__stdlib__": {} -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js index 9d5c43229c96..3f426b4c6140 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js @@ -20,12 +20,12 @@ // MODULES // -var tape = require('tape'); -var isnanf = require('@stdlib/math/base/assert/is-nanf'); -var isPositiveZerof = require('@stdlib/math/base/assert/is-positive-zerof'); -var Float32Array = require('@stdlib/array/float32'); -var ndarray = require('@stdlib/ndarray/base/ctor'); -var ssumkbn = require('./../lib'); +var tape = require( 'tape' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); +var Float32Array = require( '@stdlib/array/float32' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var ssumkbn = require( './../lib' ); // FUNCTIONS // @@ -41,7 +41,7 @@ var ssumkbn = require('./../lib'); * @returns {ndarray} one-dimensional ndarray */ function vector(buffer, length, stride, offset) { - return new ndarray('float32', buffer, [length], [stride], offset, 'row-major'); + return new ndarray( 'float32', buffer, [length], [stride], offset, 'row-major' ); } @@ -62,23 +62,23 @@ tape('the function computes the sum of all elements in a one-dimensional ndarray var x; var v; - x = new Float32Array([1.0, -2.0, -4.0, 5.0, 0.0, 3.0]); + x = new Float32Array( [1.0, -2.0, -4.0, 5.0, 0.0, 3.0] ); v = ssumkbn([vector(x, 6, 1, 0)]); t.strictEqual(v, 3.0, 'returns expected value'); - x = new Float32Array([-4.0, -5.0]); + x = new Float32Array( [-4.0, -5.0] ); v = ssumkbn([vector(x, 2, 1, 0)]); t.strictEqual(v, -9.0, 'returns expected value'); - x = new Float32Array([-0.0, 0.0, -0.0]); + x = new Float32Array( [-0.0, 0.0, -0.0] ); v = ssumkbn([vector(x, 3, 1, 0)]); t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); - x = new Float32Array([NaN]); + x = new Float32Array( [NaN] ); v = ssumkbn([vector(x, 1, 1, 0)]); t.strictEqual(isnanf(v), true, 'returns expected value'); - x = new Float32Array([NaN, NaN]); + x = new Float32Array( [NaN, NaN] ); v = ssumkbn([vector(x, 2, 1, 0)]); t.strictEqual(isnanf(v), true, 'returns expected value'); @@ -89,7 +89,7 @@ tape('if provided an empty vector, the function returns `0.0`', function test(t) var x; var v; - x = new Float32Array([]); + x = new Float32Array( [] ); v = ssumkbn([vector(x, 0, 1, 0)]); t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); @@ -101,7 +101,7 @@ tape('if provided a vector containing a single element, the function returns tha var x; var v; - x = new Float32Array([1.0]); + x = new Float32Array( [1.0] ); v = ssumkbn([vector(x, 1, 1, 0)]); t.strictEqual(v, 1.0, 'returns expected value'); @@ -113,7 +113,7 @@ tape('the function supports one-dimensional ndarrays having non-unit strides', f var x; var v; - x = new Float32Array([ + x = new Float32Array( [ 1.0, // 0 2.0, 2.0, // 1 @@ -122,7 +122,7 @@ tape('the function supports one-dimensional ndarrays having non-unit strides', f 3.0, 4.0, // 3 2.0 - ]); + ] ); v = ssumkbn([vector(x, 4, 2, 0)]); @@ -134,7 +134,7 @@ tape('the function supports one-dimensional ndarrays having negative strides', f var x; var v; - x = new Float32Array([ + x = new Float32Array( [ 1.0, // 3 2.0, 2.0, // 2 @@ -143,7 +143,7 @@ tape('the function supports one-dimensional ndarrays having negative strides', f 3.0, 4.0, // 0 2.0 - ]); + ] ); v = ssumkbn([vector(x, 4, -2, 6)]); @@ -155,7 +155,7 @@ tape('the function supports one-dimensional ndarrays having non-zero offsets', f var x; var v; - x = new Float32Array([ + x = new Float32Array( [ 2.0, 1.0, // 0 2.0, @@ -164,7 +164,7 @@ tape('the function supports one-dimensional ndarrays having non-zero offsets', f 2.0, // 2 3.0, 4.0 // 3 - ]); + ] ); v = ssumkbn([vector(x, 4, 2, 1)]); t.strictEqual(v, 5.0, 'returns expected value'); From e949403dff4cf04bd44462f52b20b7ed737eeca6 Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 5 Dec 2025 19:12:52 +0530 Subject: [PATCH 3/9] lint --- .../blas/ext/base/ndarray/ssumkbn/test/test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js index 3f426b4c6140..d06196c16d58 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js @@ -113,7 +113,7 @@ tape('the function supports one-dimensional ndarrays having non-unit strides', f var x; var v; - x = new Float32Array( [ + x = new Float32Array([ 1.0, // 0 2.0, 2.0, // 1 @@ -122,7 +122,7 @@ tape('the function supports one-dimensional ndarrays having non-unit strides', f 3.0, 4.0, // 3 2.0 - ] ); + ]); v = ssumkbn([vector(x, 4, 2, 0)]); @@ -134,7 +134,7 @@ tape('the function supports one-dimensional ndarrays having negative strides', f var x; var v; - x = new Float32Array( [ + x = new Float32Array([ 1.0, // 3 2.0, 2.0, // 2 @@ -143,7 +143,7 @@ tape('the function supports one-dimensional ndarrays having negative strides', f 3.0, 4.0, // 0 2.0 - ] ); + ]); v = ssumkbn([vector(x, 4, -2, 6)]); @@ -155,7 +155,7 @@ tape('the function supports one-dimensional ndarrays having non-zero offsets', f var x; var v; - x = new Float32Array( [ + x = new Float32Array([ 2.0, 1.0, // 0 2.0, @@ -164,7 +164,7 @@ tape('the function supports one-dimensional ndarrays having non-zero offsets', f 2.0, // 2 3.0, 4.0 // 3 - ] ); + ]); v = ssumkbn([vector(x, 4, 2, 1)]); t.strictEqual(v, 5.0, 'returns expected value'); From 93d5b7af829fb7f0a04daa0c389ba9dc067ec54c Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 5 Dec 2025 19:32:04 +0530 Subject: [PATCH 4/9] Added Reference --- .../@stdlib/blas/ext/base/ndarray/ssumkbn/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md index 1e2d31b63a0f..9e46101442e6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md @@ -117,6 +117,8 @@ console.log( v ); From 5c58998936b232292ffed22066e79f1f44279d4d Mon Sep 17 00:00:00 2001 From: kaustubh Date: Fri, 5 Dec 2025 19:35:18 +0530 Subject: [PATCH 5/9] refs --- .../@stdlib/blas/ext/base/ndarray/ssumkbn/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md index 9e46101442e6..15ffbfaf5c5d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/README.md @@ -99,7 +99,7 @@ console.log( v ); ## References -- Neumaier, Arnold. 1974. "Rounding Error Analysis of Some Methods for Summing Finite Sums." _Zeitschrift Für Angewandte Mathematik Und Mechanik_ 54 (1): 39–51. doi:[10.1002/zamm.19740540106](https://doi.org/10.1002/zamm.19740540106). +- Neumaier, Arnold. 1974. "Rounding Error Analysis of Some Methods for Summing Finite Sums." _Zeitschrift Für Angewandte Mathematik Und Mechanik_ 54 (1): 39–51. doi:[10.1002/zamm.19740540106][@neumaier:1974a]. From 079b2daff84285f4b7e6ed63c117206fbe2cfaa5 Mon Sep 17 00:00:00 2001 From: kaustubh Date: Sun, 7 Dec 2025 18:38:35 +0530 Subject: [PATCH 6/9] feat: Added Spacing --- .../ndarray/ssumkbn/benchmark/benchmark.js | 4 +- .../ndarray/ssumkbn/docs/types/index.d.ts | 8 ++-- .../base/ndarray/ssumkbn/docs/types/test.ts | 8 ++-- .../base/ndarray/ssumkbn/examples/index.js | 4 +- .../blas/ext/base/ndarray/ssumkbn/lib/main.js | 8 ++-- .../ext/base/ndarray/ssumkbn/test/test.js | 38 +++++++++---------- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js index 6e1a7bfced9b..8f2e3e1a3fb4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js @@ -50,7 +50,7 @@ function createBenchmark(len) { var x; xbuf = uniform(len, -10.0, 10.0, options); - x = new ndarray( options.dtype, xbuf, [len], [1], 0, 'row-major' ); + x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); return benchmark; @@ -60,7 +60,7 @@ function createBenchmark(len) { b.tic(); for (i = 0; i < b.iterations; i++) { - v = ssumkbn([x]); + v = ssumkbn([ x ]); if (isnanf(v)) { b.fail('should not return NaN'); } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts index 766f316a01ad..fc41b919bbc3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts @@ -32,13 +32,13 @@ import { float32ndarray } from '@stdlib/types/ndarray'; * var Float32Array = require('@stdlib/array/float32'); * var ndarray = require('@stdlib/ndarray/base/ctor'); * -* var xbuf = new Float32Array( [1.0, 3.0, 4.0, 2.0] ); -* var x = new ndarray( 'float32', xbuf, [4], [1], 0, 'row-major' ); +* var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); +* var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * -* var v = ssumkbn( [x] ); +* var v = ssumkbn( [ x ] ); * // returns 10.0 */ -declare function ssumkbn( arrays: [float32ndarray] ): number; +declare function ssumkbn( arrays: [ float32ndarray ] ): number; // EXPORTS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts index 366cda315ddd..0c9368c1eec6 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts @@ -26,11 +26,11 @@ import ssumkbn = require('./index'); // The function returns a number... { - const x = zeros([10], { + const x = zeros([ 10 ], { 'dtype': 'float32' }); - ssumkbn([x]); // $ExpectType number + ssumkbn([ x ]); // $ExpectType number } // The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... @@ -48,10 +48,10 @@ import ssumkbn = require('./index'); // The compiler throws an error if the function is provided an unsupported number of arguments... { - const x = zeros([10], { + const x = zeros([ 10 ], { 'dtype': 'float32' }); ssumkbn(); // $ExpectError - ssumkbn([x], {}); // $ExpectError + ssumkbn([ x ], {}); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js index cd8a519b536e..c6c88d46f08c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js @@ -26,8 +26,8 @@ var ssumkbn = require( './../lib' ); var xbuf = discreteUniform(10, -50, 50, { 'dtype': 'float32' }); -var x = new ndarray( 'float32', xbuf, [xbuf.length], [1], 0, 'row-major' ); +var x = new ndarray( 'float32', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); console.log(ndarray2array(x)); -var v = ssumkbn([x]); +var v = ssumkbn([ x ]); console.log(v); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js index edfd3ca98d2f..ccb214d955c9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js @@ -39,14 +39,14 @@ var strided = require( '@stdlib/blas/ext/base/ssumkbn' ).ndarray; * var Float32Array = require( '@stdlib/array/float32' ); * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * -* var xbuf = new Float32Array( [1.0, 3.0, 4.0, 2.0] ); -* var x = new ndarray( 'float32', xbuf, [4], [1], 0, 'row-major' ); +* var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); +* var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * -* var v = ssumkbn([x]); +* var v = ssumkbn( [ x ] ); * // returns 10.0 */ function ssumkbn(arrays) { - var x = arrays[0]; + var x = arrays[ 0 ]; return strided(numelDimension(x, 0), getData(x), getStride(x, 0), getOffset(x)); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js index d06196c16d58..da674085bd21 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js @@ -41,7 +41,7 @@ var ssumkbn = require( './../lib' ); * @returns {ndarray} one-dimensional ndarray */ function vector(buffer, length, stride, offset) { - return new ndarray( 'float32', buffer, [length], [stride], offset, 'row-major' ); + return new ndarray( 'float32', buffer, [ length ], [ stride ], offset, 'row-major' ); } @@ -62,48 +62,48 @@ tape('the function computes the sum of all elements in a one-dimensional ndarray var x; var v; - x = new Float32Array( [1.0, -2.0, -4.0, 5.0, 0.0, 3.0] ); - v = ssumkbn([vector(x, 6, 1, 0)]); + x = new Float32Array( [ 1.0, -2.0, -4.0, 5.0, 0.0, 3.0 ] ); + v = ssumkbn([ vector(x, 6, 1, 0) ]); t.strictEqual(v, 3.0, 'returns expected value'); - x = new Float32Array( [-4.0, -5.0] ); - v = ssumkbn([vector(x, 2, 1, 0)]); + x = new Float32Array( [ -4.0, -5.0 ] ); + v = ssumkbn([ vector(x, 2, 1, 0) ]); t.strictEqual(v, -9.0, 'returns expected value'); - x = new Float32Array( [-0.0, 0.0, -0.0] ); - v = ssumkbn([vector(x, 3, 1, 0)]); + x = new Float32Array( [ -0.0, 0.0, -0.0 ] ); + v = ssumkbn([ vector(x, 3, 1, 0) ]); t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); - x = new Float32Array( [NaN] ); - v = ssumkbn([vector(x, 1, 1, 0)]); + x = new Float32Array( [ NaN ] ); + v = ssumkbn([ vector(x, 1, 1, 0) ]); t.strictEqual(isnanf(v), true, 'returns expected value'); - x = new Float32Array( [NaN, NaN] ); - v = ssumkbn([vector(x, 2, 1, 0)]); + x = new Float32Array( [ NaN, NaN ] ); + v = ssumkbn([ vector(x, 2, 1, 0) ]); t.strictEqual(isnanf(v), true, 'returns expected value'); t.end(); }); -tape('if provided an empty vector, the function returns `0.0`', function test(t) { +tape('if provided an empty ndarray, the function returns `0.0`', function test(t) { var x; var v; x = new Float32Array( [] ); - v = ssumkbn([vector(x, 0, 1, 0)]); + v = ssumkbn([ vector(x, 0, 1, 0) ]); t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); t.end(); }); -tape('if provided a vector containing a single element, the function returns that element', function test(t) { +tape('if provided a ndarray containing a single element, the function returns that element', function test(t) { var x; var v; - x = new Float32Array( [1.0] ); + x = new Float32Array( [ 1.0 ] ); - v = ssumkbn([vector(x, 1, 1, 0)]); + v = ssumkbn([ vector(x, 1, 1, 0) ]); t.strictEqual(v, 1.0, 'returns expected value'); t.end(); @@ -124,7 +124,7 @@ tape('the function supports one-dimensional ndarrays having non-unit strides', f 2.0 ]); - v = ssumkbn([vector(x, 4, 2, 0)]); + v = ssumkbn([ vector(x, 4, 2, 0) ]); t.strictEqual(v, 5.0, 'returns expected value'); t.end(); @@ -145,7 +145,7 @@ tape('the function supports one-dimensional ndarrays having negative strides', f 2.0 ]); - v = ssumkbn([vector(x, 4, -2, 6)]); + v = ssumkbn([ vector(x, 4, -2, 6) ]); t.strictEqual(v, 5.0, 'returns expected value'); t.end(); @@ -166,7 +166,7 @@ tape('the function supports one-dimensional ndarrays having non-zero offsets', f 4.0 // 3 ]); - v = ssumkbn([vector(x, 4, 2, 1)]); + v = ssumkbn([ vector(x, 4, 2, 1) ]); t.strictEqual(v, 5.0, 'returns expected value'); t.end(); From bdf717c4ae6a137b3453684e6ada832e110904d0 Mon Sep 17 00:00:00 2001 From: kaustubh Date: Mon, 8 Dec 2025 10:16:18 +0530 Subject: [PATCH 7/9] spacing issues --- .../ndarray/ssumkbn/benchmark/benchmark.js | 20 +++--- .../ndarray/ssumkbn/docs/types/index.d.ts | 4 +- .../base/ndarray/ssumkbn/docs/types/test.ts | 30 ++++----- .../base/ndarray/ssumkbn/examples/index.js | 8 +-- .../ext/base/ndarray/ssumkbn/lib/index.js | 2 +- .../blas/ext/base/ndarray/ssumkbn/lib/main.js | 4 +- .../ext/base/ndarray/ssumkbn/test/test.js | 64 +++++++++---------- 7 files changed, 66 insertions(+), 66 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js index 8f2e3e1a3fb4..b7665afbd2cb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js @@ -45,31 +45,31 @@ var options = { * @param {PositiveInteger} len - array length * @returns {Function} benchmark function */ -function createBenchmark(len) { +function createBenchmark( len ) { var xbuf; var x; - xbuf = uniform(len, -10.0, 10.0, options); + xbuf = uniform( len, -10.0, 10.0, options ); x = new ndarray( options.dtype, xbuf, [ len ], [ 1 ], 0, 'row-major' ); return benchmark; - function benchmark(b) { + function benchmark( b ) { var v; var i; b.tic(); - for (i = 0; i < b.iterations; i++) { - v = ssumkbn([ x ]); - if (isnanf(v)) { - b.fail('should not return NaN'); + for ( i = 0; i < b.iterations; i++ ) { + v = ssumkbn( [ x ] ); + if ( isnanf( v ) ) { + b.fail( 'should not return NaN' ); } } b.toc(); - if (isnanf(v)) { - b.fail('should not return NaN'); + if ( isnanf( v ) ) { + b.fail( 'should not return NaN' ); } - b.pass('benchmark finished'); + b.pass( 'benchmark finished' ); b.end(); } } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts index fc41b919bbc3..56dfbf749ead 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/index.d.ts @@ -29,8 +29,8 @@ import { float32ndarray } from '@stdlib/types/ndarray'; * @returns sum * * @example -* var Float32Array = require('@stdlib/array/float32'); -* var ndarray = require('@stdlib/ndarray/base/ctor'); +* var Float32Array = require( '@stdlib/array/float32' ); +* var ndarray = require( '@stdlib/ndarray/base/ctor' ); * * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); * var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts index 0c9368c1eec6..0b3e62943427 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/docs/types/test.ts @@ -18,40 +18,40 @@ /* eslint-disable space-in-parens */ -import zeros = require('@stdlib/ndarray/zeros'); -import ssumkbn = require('./index'); +import zeros = require( '@stdlib/ndarray/zeros' ); +import ssumkbn = require( './index' ); // TESTS // // The function returns a number... { - const x = zeros([ 10 ], { + const x = zeros( [ 10 ], { 'dtype': 'float32' }); - ssumkbn([ x ]); // $ExpectType number + ssumkbn( [ x ] ); // $ExpectType number } // The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... { - ssumkbn('10'); // $ExpectError - ssumkbn(10); // $ExpectError - ssumkbn(true); // $ExpectError - ssumkbn(false); // $ExpectError - ssumkbn(null); // $ExpectError - ssumkbn(undefined); // $ExpectError - ssumkbn([]); // $ExpectError - ssumkbn({}); // $ExpectError - ssumkbn((x: number): number => x); // $ExpectError + ssumkbn( '10' ); // $ExpectError + ssumkbn( 10 ); // $ExpectError + ssumkbn( true ); // $ExpectError + ssumkbn( false ); // $ExpectError + ssumkbn( null ); // $ExpectError + ssumkbn( undefined ); // $ExpectError + ssumkbn( [] ); // $ExpectError + ssumkbn( {} ); // $ExpectError + ssumkbn( ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { - const x = zeros([ 10 ], { + const x = zeros( [ 10 ], { 'dtype': 'float32' }); ssumkbn(); // $ExpectError - ssumkbn([ x ], {}); // $ExpectError + ssumkbn( [ x ], {} ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js index c6c88d46f08c..266f37907fcf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/examples/index.js @@ -23,11 +23,11 @@ var ndarray = require( '@stdlib/ndarray/base/ctor' ); var ndarray2array = require( '@stdlib/ndarray/to-array' ); var ssumkbn = require( './../lib' ); -var xbuf = discreteUniform(10, -50, 50, { +var xbuf = discreteUniform( 10, -50, 50, { 'dtype': 'float32' }); var x = new ndarray( 'float32', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' ); -console.log(ndarray2array(x)); +console.log( ndarray2array( x ) ); -var v = ssumkbn([ x ]); -console.log(v); +var v = ssumkbn( [ x ] ); +console.log( v ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js index 96cad0e9ffe6..5d43bf277c89 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js @@ -28,7 +28,7 @@ * var ndarray = require( '@stdlib/ndarray/base/ctor' ); * var ssumkbn = require( '@stdlib/blas/ext/base/ndarray/ssumkbn' ); * -* var xbuf = new Float32Array( [1.0, 3.0, 4.0, 2.0] ); +* var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); * var x = new ndarray( 'float32', xbuf, [4], [1], 0, 'row-major' ); * * var v = ssumkbn( [x] ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js index ccb214d955c9..0d9bccb21c52 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/main.js @@ -45,9 +45,9 @@ var strided = require( '@stdlib/blas/ext/base/ssumkbn' ).ndarray; * var v = ssumkbn( [ x ] ); * // returns 10.0 */ -function ssumkbn(arrays) { +function ssumkbn( arrays ) { var x = arrays[ 0 ]; - return strided(numelDimension(x, 0), getData(x), getStride(x, 0), getOffset(x)); // eslint-disable-line max-len + return strided( numelDimension( x, 0 ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js index da674085bd21..3207a4ab20cd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/test/test.js @@ -40,76 +40,76 @@ var ssumkbn = require( './../lib' ); * @param {NonNegativeInteger} offset - index offset * @returns {ndarray} one-dimensional ndarray */ -function vector(buffer, length, stride, offset) { +function vector( buffer, length, stride, offset ) { return new ndarray( 'float32', buffer, [ length ], [ stride ], offset, 'row-major' ); } // TESTS // -tape('main export is a function', function test(t) { - t.ok(true, __filename); - t.strictEqual(typeof ssumkbn, 'function', 'main export is a function'); +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ssumkbn, 'function', 'main export is a function' ); t.end(); }); -tape('the function has an arity of 1', function test(t) { - t.strictEqual(ssumkbn.length, 1, 'has expected arity'); +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( ssumkbn.length, 1, 'has expected arity' ); t.end(); }); -tape('the function computes the sum of all elements in a one-dimensional ndarray', function test(t) { +tape( 'the function computes the sum of all elements in a one-dimensional ndarray', function test( t ) { var x; var v; x = new Float32Array( [ 1.0, -2.0, -4.0, 5.0, 0.0, 3.0 ] ); - v = ssumkbn([ vector(x, 6, 1, 0) ]); - t.strictEqual(v, 3.0, 'returns expected value'); + v = ssumkbn( [ vector( x, 6, 1, 0 ) ] ); + t.strictEqual( v, 3.0, 'returns expected value' ); x = new Float32Array( [ -4.0, -5.0 ] ); - v = ssumkbn([ vector(x, 2, 1, 0) ]); - t.strictEqual(v, -9.0, 'returns expected value'); + v = ssumkbn( [ vector( x, 2, 1, 0 ) ] ); + t.strictEqual( v, -9.0, 'returns expected value' ); x = new Float32Array( [ -0.0, 0.0, -0.0 ] ); - v = ssumkbn([ vector(x, 3, 1, 0) ]); - t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); + v = ssumkbn( [ vector( x, 3, 1, 0 ) ] ); + t.strictEqual( isPositiveZerof( v ), true, 'returns expected value' ); x = new Float32Array( [ NaN ] ); - v = ssumkbn([ vector(x, 1, 1, 0) ]); - t.strictEqual(isnanf(v), true, 'returns expected value'); + v = ssumkbn( [ vector( x, 1, 1, 0 ) ] ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); x = new Float32Array( [ NaN, NaN ] ); - v = ssumkbn([ vector(x, 2, 1, 0) ]); - t.strictEqual(isnanf(v), true, 'returns expected value'); + v = ssumkbn( [ vector( x, 2, 1, 0 ) ] ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); t.end(); }); -tape('if provided an empty ndarray, the function returns `0.0`', function test(t) { +tape( 'if provided an empty ndarray, the function returns `0.0`', function test( t ) { var x; var v; x = new Float32Array( [] ); - v = ssumkbn([ vector(x, 0, 1, 0) ]); - t.strictEqual(isPositiveZerof(v), true, 'returns expected value'); + v = ssumkbn( [ vector( x, 0, 1, 0 ) ] ); + t.strictEqual( isPositiveZerof( v ), true, 'returns expected value' ); t.end(); }); -tape('if provided a ndarray containing a single element, the function returns that element', function test(t) { +tape( 'if provided a ndarray containing a single element, the function returns that element', function test( t ) { var x; var v; x = new Float32Array( [ 1.0 ] ); - v = ssumkbn([ vector(x, 1, 1, 0) ]); - t.strictEqual(v, 1.0, 'returns expected value'); + v = ssumkbn( [ vector( x, 1, 1, 0 ) ] ); + t.strictEqual( v, 1.0, 'returns expected value' ); t.end(); }); -tape('the function supports one-dimensional ndarrays having non-unit strides', function test(t) { +tape( 'the function supports one-dimensional ndarrays having non-unit strides', function test( t ) { var x; var v; @@ -124,13 +124,13 @@ tape('the function supports one-dimensional ndarrays having non-unit strides', f 2.0 ]); - v = ssumkbn([ vector(x, 4, 2, 0) ]); + v = ssumkbn( [ vector( x, 4, 2, 0 ) ] ); - t.strictEqual(v, 5.0, 'returns expected value'); + t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); }); -tape('the function supports one-dimensional ndarrays having negative strides', function test(t) { +tape( 'the function supports one-dimensional ndarrays having negative strides', function test( t ) { var x; var v; @@ -145,13 +145,13 @@ tape('the function supports one-dimensional ndarrays having negative strides', f 2.0 ]); - v = ssumkbn([ vector(x, 4, -2, 6) ]); + v = ssumkbn( [ vector( x, 4, -2, 6 ) ] ); - t.strictEqual(v, 5.0, 'returns expected value'); + t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); }); -tape('the function supports one-dimensional ndarrays having non-zero offsets', function test(t) { +tape( 'the function supports one-dimensional ndarrays having non-zero offsets', function test( t ) { var x; var v; @@ -166,8 +166,8 @@ tape('the function supports one-dimensional ndarrays having non-zero offsets', f 4.0 // 3 ]); - v = ssumkbn([ vector(x, 4, 2, 1) ]); - t.strictEqual(v, 5.0, 'returns expected value'); + v = ssumkbn( [ vector( x, 4, 2, 1 ) ] ); + t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); }); From 5105bfc69ead49a029a172e7c5da2530b2d0bf01 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 7 Dec 2025 22:03:59 -0800 Subject: [PATCH 8/9] style: fix spacing Signed-off-by: Athan --- .../blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js index b7665afbd2cb..d3c6ab558520 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/benchmark/benchmark.js @@ -92,10 +92,10 @@ function main() { min = 1; // 10^min max = 6; // 10^max - for (i = min; i <= max; i++) { - len = pow(10, i); - f = createBenchmark(len); - bench(pkg + ':len=' + len, f); + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':len='+len, f ); } } From aac90fb6e811de7f1361e8b2bf1a0eb1601b44e1 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 7 Dec 2025 22:05:45 -0800 Subject: [PATCH 9/9] style: add spaces Signed-off-by: Athan --- .../@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js index 5d43bf277c89..3c6c0288e011 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/ssumkbn/lib/index.js @@ -29,9 +29,9 @@ * var ssumkbn = require( '@stdlib/blas/ext/base/ndarray/ssumkbn' ); * * var xbuf = new Float32Array( [ 1.0, 3.0, 4.0, 2.0 ] ); -* var x = new ndarray( 'float32', xbuf, [4], [1], 0, 'row-major' ); +* var x = new ndarray( 'float32', xbuf, [ 4 ], [ 1 ], 0, 'row-major' ); * -* var v = ssumkbn( [x] ); +* var v = ssumkbn( [ x ] ); * // returns 10.0 */