From 79a0bcf06afdd7de92305bbb01f838b825a91c08 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 6 Feb 2025 00:58:01 +0530 Subject: [PATCH 01/32] feat: add blas/base/icamax --- .../blas/base/icamax/benchmark/benchmark.js | 105 ++++++++++++++++++ .../icamax/benchmark/benchmark.ndarray.js | 105 ++++++++++++++++++ .../@stdlib/blas/base/icamax/lib/icamax.js | 53 +++++++++ .../@stdlib/blas/base/icamax/lib/index.js | 68 ++++++++++++ .../@stdlib/blas/base/icamax/lib/main.js | 35 ++++++ .../@stdlib/blas/base/icamax/lib/ndarray.js | 75 +++++++++++++ .../@stdlib/blas/base/icamax/package.json | 74 ++++++++++++ 7 files changed, 515 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/package.json diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js new file mode 100644 index 000000000000..b03e48e2c5d6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js @@ -0,0 +1,105 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var pkg = require( './../package.json' ).name; +var icamax = require( './../lib/icamax.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var cx; + + cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var icx; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + icx = icamax( cx.length, cx, 1 ); + if ( isnan( icx ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( icx ) ) { + 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(); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..efdfcf632f17 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js @@ -0,0 +1,105 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var pkg = require( './../package.json' ).name; +var icamax = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Create a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var cx; + + cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var icx; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + icx = icamax( cx.length, cx, 1, 0 ); + if ( isnan( icx ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( icx ) ) { + 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+':ndarray:len='+len, f ); + } +} + +main(); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js new file mode 100644 index 000000000000..fa992229e3ea --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +/** +* Finds the index of the first element having maximum |Re(.)| + |Im(.)| +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Float64Array} x - input array +* @param {integer} strideX - `x` stride length +* @returns {integer} index value +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* +* var icx = ixamax( x.length, x, 1 ); +* // returns 4 +*/ +function icamax( N, x, strideX ) { + var ox = stride2offset( N, strideX ); + return ndarray( N, x, strideX, ox ); +} + + +// EXPORTS // + +module.exports = icamax; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js new file mode 100644 index 000000000000..ed79329d4236 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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'; + +/** +* BLAS level 1 routine to find the index of the first element having maximum |Re(.)| + |Im(.)| +* +* @module @stdlib/blas/base/icamax +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var icamax = require( '@stdlib/blas/base/icamax' ); +* +* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var icx = icamax( x.length, x, 1 ); +* // returns 3 +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* var icamax = require( '@stdlib/blas/base/icamax' ); +* +* var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var icx = icamax.ndarray( x.length, x, 1, 0 ); +* // returns 3 +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var icamax; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + icamax = main; +} else { + icamax = tmp; +} + + +// EXPORTS // + +module.exports = icamax; + +// exports: { "ndarray": "icamax.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js new file mode 100644 index 000000000000..00e9db73f780 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var icamax = require( './idamax.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( icamax, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = icamax; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js new file mode 100644 index 000000000000..f943b50b3d5a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -0,0 +1,75 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 scabs1 = require( '@stdlib/blas/base/scabs1' ); + + +// MAIN // + +/** +* Finds the index of the first element having maximum |Re(.)| + |Im(.)| +* +* @param {PositiveInteger} N - number of indexed elements +* @param {Complex64Array} cx - input array +* @param {integer} strideX - `cx` stride length +* @param {NonNegativeInteger} offsetX - starting index for `cx` +* @returns {integer} index value +* +* @example +* var Float64Array = require( '@stdlib/array/complex64' ); +* +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* +* var idx = idamax( x.length, x, 1, 0 ); +* // returns 4 +*/ +function icamax( N, cx, strideX, offsetX ) { + var cmax; + var icx; + var ix; + var v; + var i; + + if ( N < 1 ) { + return -1; + } + icx = 0; + if ( N === 1 ) { + return icx; + } + cmax = scabs1( cx.get( offsetX ) ); + ix = offsetX + strideX; + for( i = 1; i < N; i++ ) { + v = scabs1( cx.get( ix ) ); + if ( v > cmax ) { + icx = i; + cmax = v; + } + ix += strideX; + } + return icx; +} + + +// EXPORTS // + +module.exports = icamax; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/package.json b/lib/node_modules/@stdlib/blas/base/icamax/package.json new file mode 100644 index 000000000000..b2b4c9f63742 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/blas/base/icamax", + "version": "0.0.0", + "description": "Find the index of the first element having maximum |Re(.)| + |Im(.)|", + "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", + "mathematics", + "math", + "blas", + "level 1", + "icamax", + "maximum", + "dcabs1", + "absolute", + "find", + "index", + "linear", + "algebra", + "subroutines", + "vector", + "array", + "ndarray", + "complex64", + "complex", + "complex64array" + ] + } \ No newline at end of file From 5cbf9559f7a30c377137d5186237d5151fb2f401 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Tue, 11 Feb 2025 22:25:56 +0530 Subject: [PATCH 02/32] docs: files completed --- .../@stdlib/blas/base/icamax/README.md | 172 +++++++++++++++ .../@stdlib/blas/base/icamax/docs/repl.txt | 91 ++++++++ .../blas/base/icamax/docs/types/index.d.ts | 96 +++++++++ .../blas/base/icamax/docs/types/test.ts | 158 ++++++++++++++ .../blas/base/icamax/examples/index.js | 35 +++ .../@stdlib/blas/base/icamax/lib/icamax.js | 8 +- .../@stdlib/blas/base/icamax/lib/index.js | 10 +- .../@stdlib/blas/base/icamax/lib/main.js | 2 +- .../@stdlib/blas/base/icamax/lib/ndarray.js | 24 +-- .../blas/base/icamax/test/test.icamax.js | 182 ++++++++++++++++ .../@stdlib/blas/base/icamax/test/test.js | 82 +++++++ .../blas/base/icamax/test/test.ndarray.js | 202 ++++++++++++++++++ 12 files changed, 1040 insertions(+), 22 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/icamax/README.md b/lib/node_modules/@stdlib/blas/base/icamax/README.md new file mode 100644 index 000000000000..c298298e82e6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/README.md @@ -0,0 +1,172 @@ + + +# icamax + +> Finds the index of the first element having maximum |Re(.)| + |Im(.)|. + +
+ +## Usage + +```javascript +var icamax = require( '@stdlib/blas/base/icamax' ); +``` + +#### icamax( N, cx, strideX ) + +Finds the index of the first element having maximum |Re(.)| + |Im(.)|. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + +var icx = icamax( cx.length, cx, 1 ); +// returns 1 +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **cx**: input [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: index increment for `cx`. + +The `N` and `strideX` parameters determine which elements in `cx` are accessed at runtime. For example, to traverse every other value, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + +var icx = icamax( 2, cx, 2 ); +// returns 1 +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +// Initial array: +var cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + +// Create an offset view: +var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +// Find index of element having the maximum absolute value: +var icx = icamax( 2, cx1, 1 ); +// returns 1 +``` + +#### icamax.ndarray( N, cx, strideX, offset ) + +Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + +var icx = icamax.ndarray( cx.length, cx, 1, 0 ); +// returns 1 +``` + +The function has the following additional parameters: + +- **offsetX**: starting index. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to start from the second index, + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); + +var cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); + +var icx = icamax.ndarray( 3, cx, 1, 1 ); +// returns 2 +``` + +
+ + + +
+ +## Notes + +- If `N < 1`, both functions return `-1`. +- `icamax()` corresponds to the [BLAS][blas] level 1 function [`icamax`][icamax]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var complex64 = require( '@stdlib/complex/float32/ctor' ); +var icamax = require( '@stdlib/blas/base/icamax' ); + +function rand() { + return new complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +// Generate random input arrays: +var cx = filledarrayBy( 10, 'complex64', rand ); +console.log( cx.toString() ); + +var icx = icamax( cx.length, cx, 1 ); +console.log( icx ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt new file mode 100644 index 000000000000..d3652661db38 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt @@ -0,0 +1,91 @@ + +{{alias}}( N, cx, strideX ) + Finds the index of the first element having maximum |Re(.)| + |Im(.)|. + + The `N` and `strideX` parameters determine which elements in `cx` are + accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N < 1`, the function returns `-1`. + + Parameters + ---------- + N: integer + Number of indexed elements. + + cx: Complex64Array + Input array. + + strideX: integer + Index increment for `cx`. + + Returns + ------- + icx: integer + Index value. + + Examples + -------- + // Standard Usage: + > var cx; + > cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var icx = {{alias}}( cx.length, cx, 1 ) + 1 + + // Using `N` and `strideX` parameters: + > cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > icx = {{alias}}( 2, cx, 2 ) + 1 + + // Using view offsets: + > var cx0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + > var cx1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); + > icx = {{alias}}( 2, cx1, 1 ) + 1 + + +{{alias}}.ndarray( N, cx, strideX, offsetX ) + Finds the index of the first element having the maximum absolute value using + alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the `offsetX` parameter supports indexing semantics based on a + starting index. + + Parameters + ---------- + N: integer + Number of indexed elements. + + cx: Complex64Array + Input array. + + strideX: integer + Index increment for `cx`. + + offsetX: integer + Starting index of `cx`. + + Returns + ------- + icx: integer + Index value. + + Examples + -------- + // Standard Usage: + > var cx; + > cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var icx = {{alias}}.ndarray( cx.length, cx, 1, 0 ) + 1 + + // Using an index offset: + > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + > icx = {{alias}}.ndarray( 2, cx, 1, 1 ) + 1 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts new file mode 100644 index 000000000000..cd373f51c9cc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts @@ -0,0 +1,96 @@ +/* +* @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 { Complex64Array } from '@stdlib/types/array'; + +/** +* Interface describing `icamax`. +*/ +interface Routine { + /** + * Finds the index of the first element having maximum |Re(.)| + |Im(.)|. + * + * @param N - number of indexed elements + * @param cx - input array + * @param strideX - stride length for `cx` + * @returns index value + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + * + * var icx = icamax( cx.length, cx, 1 ); + * // returns 1 + */ + ( N: number, zx: Complex64Array, strideX: number ): number; + + /** + * Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param cx - input array + * @param strideX - stride length for `zx` + * @param offsetX - starting index for `zx` + * @returns index value + * + * @example + * var Complex64Array = require( '@stdlib/array/complex64' ); + * + * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + * + * var icx = icamax.ndarray( cx.length, cx, 1, 0 ); + * // returns 1 + */ + ndarray( N: number, zx: Complex64Array, strideX: number, offsetX: number ): number; +} + +/** +* Finds the index of the first element having maximum |Re(.)| + |Im(.)| +* +* @param N - number of indexed elements +* @param zx - input array +* @param strideX - stride length for `cx` +* @returns index value +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var icx = icamax( cx.length, cx, 1 ); +* // returns 1 +* +* @example +* var Complex64Array = require( '@stdlib/array/complex64' ); +* +* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* +* var icx = icamax.ndarray( cx.length, cx, 1, 0 ); +* // returns 1 +*/ +declare var icamax: Routine; + + +// EXPORTS // + +export = icamax; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts new file mode 100644 index 000000000000..01112bfa7612 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts @@ -0,0 +1,158 @@ +/* +* @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. +*/ + +import Complex64Array = require( '@stdlib/array/complex64' ); +import icamax = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const cx = new Complex64Array( 10 ); + + icamax( cx.length, cx, 1 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const cx = new Complex64Array( 10 ); + + icamax( '10', cx, 1 ); // $ExpectError + icamax( true, cx, 1 ); // $ExpectError + icamax( false, cx, 1 ); // $ExpectError + icamax( null, cx, 1 ); // $ExpectError + icamax( undefined, cx, 1 ); // $ExpectError + icamax( [], cx, 1 ); // $ExpectError + icamax( {}, cx, 1 ); // $ExpectError + icamax( ( x: number ): number => x, cx, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Complex64Array... +{ + const cx = new Complex64Array( 10 ); + + icamax( cx.length, 10, 1 ); // $ExpectError + icamax( cx.length, '10', 1 ); // $ExpectError + icamax( cx.length, true, 1 ); // $ExpectError + icamax( cx.length, false, 1 ); // $ExpectError + icamax( cx.length, null, 1 ); // $ExpectError + icamax( cx.length, undefined, 1 ); // $ExpectError + icamax( cx.length, [], 1 ); // $ExpectError + icamax( cx.length, {}, 1 ); // $ExpectError + icamax( cx.length, ( cx: number ): number => cx, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const cx = new Complex64Array( 10 ); + + icamax( cx.length, cx, '10' ); // $ExpectError + icamax( cx.length, cx, true ); // $ExpectError + icamax( cx.length, cx, false ); // $ExpectError + icamax( cx.length, cx, null ); // $ExpectError + icamax( cx.length, cx, undefined ); // $ExpectError + icamax( cx.length, cx, [] ); // $ExpectError + icamax( cx.length, cx, {} ); // $ExpectError + icamax( cx.length, cx, ( cx: number ): number => cx ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const cx = new Complex64Array( 10 ); + + icamax(); // $ExpectError + icamax( cx.length ); // $ExpectError + icamax( cx.length, cx ); // $ExpectError + icamax( cx.length, cx, 1, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a number... +{ + const cx = new Complex64Array( 10 ); + + icamax.ndarray( cx.length, cx, 1, 0 ); // $ExpectType number +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const cx = new Complex64Array( 10 ); + + icamax.ndarray( '10', cx, 1, 0 ); // $ExpectError + icamax.ndarray( true, cx, 1, 0 ); // $ExpectError + icamax.ndarray( false, cx, 1, 0 ); // $ExpectError + icamax.ndarray( null, cx, 1, 0 ); // $ExpectError + icamax.ndarray( undefined, cx, 1, 0 ); // $ExpectError + icamax.ndarray( [], cx, 1, 0 ); // $ExpectError + icamax.ndarray( {}, cx, 1, 0 ); // $ExpectError + icamax.ndarray( ( cx: number ): number => cx, cx, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a Complex64Array... +{ + const cx = new Complex64Array( 10 ); + + icamax.ndarray( cx.length, 10, 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, '10', 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, true, 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, false, 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, null, 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, undefined, 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, [], 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, {}, 1, 0 ); // $ExpectError + icamax.ndarray( cx.length, ( cx: number ): number => cx, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const cx = new Complex64Array( 10 ); + + icamax.ndarray( cx.length, cx, '10', 0 ); // $ExpectError + icamax.ndarray( cx.length, cx, true, 0 ); // $ExpectError + icamax.ndarray( cx.length, cx, false, 0 ); // $ExpectError + icamax.ndarray( cx.length, cx, null, 0 ); // $ExpectError + icamax.ndarray( cx.length, cx, undefined, 0 ); // $ExpectError + icamax.ndarray( cx.length, cx, [], 0 ); // $ExpectError + icamax.ndarray( cx.length, cx, {}, 0 ); // $ExpectError + icamax.ndarray( cx.length, cx, ( cx: number ): number => cx, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const cx = new Complex64Array( 10 ); + + icamax.ndarray( cx.length, cx, 1, '10' ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, true ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, false ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, null ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, undefined ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, [] ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, {} ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, ( cx: number ): number => cx ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const cx = new Complex64Array( 10 ); + + icamax.ndarray(); // $ExpectError + icamax.ndarray( cx.length ); // $ExpectError + icamax.ndarray( cx.length, cx ); // $ExpectError + icamax.ndarray( cx.length, cx, 1 ); // $ExpectError + icamax.ndarray( cx.length, cx, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js new file mode 100644 index 000000000000..2e4d15f86dd6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js @@ -0,0 +1,35 @@ +/** +* @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/base/discrete-uniform' ); +var filledarrayBy = require( '@stdlib/array/filled-by' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var icamax = require( '@stdlib/blas/base/icamax' ); + +function rand() { + return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); +} + +// Generate random input arrays: +var cx = filledarrayBy( 10, 'complex64', rand ); +console.log( cx.toString() ); + +var icx = icamax( cx.length, cx, 1 ); +console.log( icx ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js index fa992229e3ea..8b7538b34c28 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -27,7 +27,7 @@ var ndarray = require( './ndarray.js' ); // MAIN // /** -* Finds the index of the first element having maximum |Re(.)| + |Im(.)| +* Finds the index of the first element having maximum |Re(.)| + |Im(.)|. * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array @@ -37,10 +37,10 @@ var ndarray = require( './ndarray.js' ); * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); * -* var icx = ixamax( x.length, x, 1 ); -* // returns 4 +* var icx = icamax( x.length, x, 1 ); +* // returns 3 */ function icamax( N, x, strideX ) { var ox = stride2offset( N, strideX ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js index ed79329d4236..936b4bef2738 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 1 routine to find the index of the first element having maximum |Re(.)| + |Im(.)| +* BLAS level 1 routine to find the index of the first element having maximum |Re(.)| + |Im(.)|. * * @module @stdlib/blas/base/icamax * @@ -30,16 +30,16 @@ * var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * * var icx = icamax( x.length, x, 1 ); -* // returns 3 +* // returns 1 * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var icamax = require( '@stdlib/blas/base/icamax' ); * -* var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var icx = icamax.ndarray( x.length, x, 1, 0 ); -* // returns 3 +* var icx = icamax( cx.length, cx, 1, 0 ); +* // returns 1 */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js index 00e9db73f780..3b6b2efd442a 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js @@ -21,7 +21,7 @@ // MODULES // var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var icamax = require( './idamax.js' ); +var icamax = require( './icamax.js' ); var ndarray = require( './ndarray.js' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index f943b50b3d5a..15933d233483 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -26,7 +26,7 @@ var scabs1 = require( '@stdlib/blas/base/scabs1' ); // MAIN // /** -* Finds the index of the first element having maximum |Re(.)| + |Im(.)| +* Finds the index of the first element having maximum |Re(.)| + |Im(.)|. * * @param {PositiveInteger} N - number of indexed elements * @param {Complex64Array} cx - input array @@ -35,12 +35,12 @@ var scabs1 = require( '@stdlib/blas/base/scabs1' ); * @returns {integer} index value * * @example -* var Float64Array = require( '@stdlib/array/complex64' ); +* var Complex64Array = require( '@stdlib/array/complex64' ); * -* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var idx = idamax( x.length, x, 1, 0 ); -* // returns 4 +* var icx = icamax( cx.length, cx, 1, 0 ); +* // returns 1 */ function icamax( N, cx, strideX, offsetX ) { var cmax; @@ -56,16 +56,16 @@ function icamax( N, cx, strideX, offsetX ) { if ( N === 1 ) { return icx; } - cmax = scabs1( cx.get( offsetX ) ); - ix = offsetX + strideX; - for( i = 1; i < N; i++ ) { - v = scabs1( cx.get( ix ) ); - if ( v > cmax ) { + cmax = scabs1( cx.get( offsetX ) ); + ix = offsetX + strideX; + for ( i = 1; i < N; i++ ) { + v = scabs1( cx.get( ix ) ); + if ( v > cmax ) { icx = i; cmax = v; } - ix += strideX; - } + ix += strideX; + } return icx; } diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js new file mode 100644 index 000000000000..0e6364b733a3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js @@ -0,0 +1,182 @@ +/** +* @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 Complex64Array = require( '@stdlib/array/complex64' ); +var icamax = require( './../lib/icamax.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof icamax, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 3', function test( t ) { + t.strictEqual( icamax.length, 3, 'returns expected value' ); + t.end(); +}); + +tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 0.1, // 1 + -0.3, // 1 + 0.5, // 2 + -0.1, // 2 + -0.2, // 3 + 0.6, // 3 + -0.4, // 4 + 0.9 // 4 + ]); + expected = 3; + + icx = icamax( 4, x, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + x = new Complex64Array([ + 0.2, // 1 + -0.6, // 1 + 0.3, // 2 + 0.6, // 2 + 5.0, + 5.0 + ]); + expected = 1; + + icx = icamax( 2, x, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 1.0, + 2.0, + 3.0, + 4.0 + ]); + expected = -1; + + icx = icamax( 0, x, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 1.0, + 2.0, + 3.0, + 4.0 + ]); + expected = 0; + + icx = icamax( 1, x, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 0.1, // 1 + 4.0, // 1 + -0.3, + 6.0, + -0.5, // 2 + 7.0, // 2 + -0.1, + 3.0 + ]); + expected = 1; + + icx = icamax( 2, x, 2 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); + expected = 1; + + icx = icamax( x.length, x, -1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + // eslint-disable-next-line max-len + x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); + expected = 1; + + icx = icamax( 4, x, -2 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports view offsets', function test( t ) { + var expected; + var icx; + var x0; + var x1; + + x0 = new Complex64Array([ + 1.0, + 2.0, + 3.0, // 0 + 4.0, // 0 + 5.0, // 1 + 6.0, // 1 + 7.0, // 2 + 8.0 // 2 + ]); + x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + expected = 2; + + icx = icamax( 3, x1, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.js new file mode 100644 index 000000000000..d3c3bf918e60 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.js @@ -0,0 +1,82 @@ +/** +* @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 proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var icamax = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof icamax, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof icamax.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var icamax = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( icamax, mock, 'returns expected value' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var icamax; + var main; + + main = require( './../lib/icamax.js' ); + + icamax = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( icamax, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js new file mode 100644 index 000000000000..3fd6e9fe8c34 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -0,0 +1,202 @@ +/** +* @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 Complex64Array = require( '@stdlib/array/complex64' ); +var icamax = require( './../lib/ndarray.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof icamax, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( icamax.length, 4, 'returns expected value' ); + t.end(); +}); + +tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 0.1, // 1 + -0.3, // 1 + 0.5, // 2 + -0.1, // 2 + -0.2, // 3 + 0.6, // 3 + -0.4, // 4 + 0.9 // 4 + ]); + expected = 3; + + icx = icamax( 4, x, 1, 0 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + x = new Complex64Array([ + 0.2, // 1 + -0.6, // 1 + 0.3, // 2 + 0.6, // 2 + 5.0, + 5.0 + ]); + expected = 1; + + icx = icamax( 2, x, 1, 0 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 1.0, + 2.0, + 3.0, + 4.0 + ]); + expected = -1; + + icx = icamax( 0, x, 1, 0 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 1.0, + 2.0, + 3.0, + 4.0 + ]); + expected = 0; + + icx = icamax( 1, x, 1, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports accessing elements in reverse order', function test( t ) { + var icx; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); + + icx = icamax( x.length, x, -1, x.length-1 ); + t.strictEqual( icx, 1, 'returns expected value' ); + + icx = icamax( 2, x, -1, x.length-2 ); + t.strictEqual( icx, 0, 'returns expected value' ); + + // eslint-disable-next-line max-len + x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); + icx = icamax( 4, x, -2, x.length-1 ); + t.strictEqual( icx, 1, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a stride', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 0.1, // 1 + 4.0, // 1 + -0.3, + 6.0, + -0.5, // 2 + 7.0, // 2 + -0.1, + 3.0 + ]); + expected = 1; + + icx = icamax( 2, x, 2, 0 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` offset', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 1.0, + 2.0, + 3.0, // 0 + 4.0, // 0 + 5.0, // 1 + 6.0, // 1 + 7.0, // 2 + 8.0 // 2 + ]); + expected = 2; + + icx = icamax( 3, x, 1, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns', function test( t ) { + var expected; + var icx; + var x; + + x = new Complex64Array([ + 1.0, + 2.0, + 3.0, // 0 + 4.0, // 0 + 5.0, + 6.0, + 7.0, // 1 + 8.0 // 1 + ]); + expected = 1; + + icx = icamax( 2, x, 2, 1 ); + t.strictEqual( icx, expected, 'returns expected value' ); + + t.end(); +}); From f1afdc1a3bbab517ff6f4ddc8e93a1396f79f57b Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Tue, 11 Feb 2025 17:03:17 +0000 Subject: [PATCH 03/32] fix: resolve lint errors --- .../@stdlib/blas/base/icamax/benchmark/benchmark.js | 2 +- .../@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js | 2 +- lib/node_modules/@stdlib/blas/base/icamax/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js index b03e48e2c5d6..06b61e4ca535 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js @@ -102,4 +102,4 @@ function main() { } } -main(); \ No newline at end of file +main(); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js index efdfcf632f17..71d2a8f97a29 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js @@ -102,4 +102,4 @@ function main() { } } -main(); \ No newline at end of file +main(); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/package.json b/lib/node_modules/@stdlib/blas/base/icamax/package.json index b2b4c9f63742..86f035790f12 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/package.json +++ b/lib/node_modules/@stdlib/blas/base/icamax/package.json @@ -71,4 +71,4 @@ "complex", "complex64array" ] - } \ No newline at end of file + } From 0b7117db7b3dc008e924c6267984f80ee785f9e7 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Wed, 19 Feb 2025 06:00:11 +0000 Subject: [PATCH 04/32] chore: update copyright years --- lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js | 2 +- lib/node_modules/@stdlib/blas/base/icamax/lib/index.js | 2 +- lib/node_modules/@stdlib/blas/base/icamax/lib/main.js | 2 +- lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js index 8b7538b34c28..fac62d0bf6e8 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* 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. diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js index 936b4bef2738..5b03286183e8 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* 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. diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js index 3b6b2efd442a..d2170a733e24 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* 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. diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index 15933d233483..1e7e7564004a 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* 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. From aefb83af750cbe56f8556177d95d9d9d2c7a76b1 Mon Sep 17 00:00:00 2001 From: Aman Bhansali <92033532+aman-095@users.noreply.github.com> Date: Wed, 19 Feb 2025 11:56:26 +0530 Subject: [PATCH 05/32] Update package.json Check for the indentation and brackets. Signed-off-by: Aman Bhansali <92033532+aman-095@users.noreply.github.com> --- .../@stdlib/blas/base/icamax/package.json | 143 +++++++++--------- 1 file changed, 72 insertions(+), 71 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/package.json b/lib/node_modules/@stdlib/blas/base/icamax/package.json index 86f035790f12..8a96be766354 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/package.json +++ b/lib/node_modules/@stdlib/blas/base/icamax/package.json @@ -1,74 +1,75 @@ { - "name": "@stdlib/blas/base/icamax", - "version": "0.0.0", - "description": "Find the index of the first element having maximum |Re(.)| + |Im(.)|", - "license": "Apache-2.0", - "author": { + "name": "@stdlib/blas/base/icamax", + "version": "0.0.0", + "description": "Find the index of the first element having maximum |Re(.)| + |Im(.)|", + "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" - }, - "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", - "mathematics", - "math", - "blas", - "level 1", - "icamax", - "maximum", - "dcabs1", - "absolute", - "find", - "index", - "linear", - "algebra", - "subroutines", - "vector", - "array", - "ndarray", - "complex64", - "complex", - "complex64array" - ] - } + } + ], + "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", + "mathematics", + "math", + "blas", + "level 1", + "icamax", + "maximum", + "dcabs1", + "absolute", + "find", + "index", + "linear", + "algebra", + "subroutines", + "vector", + "array", + "ndarray", + "complex", + "complex64", + "complex64array" + ] +} + From ea43236efc1a2f5469299ac629614c05f09a6d52 Mon Sep 17 00:00:00 2001 From: Aman Bhansali <92033532+aman-095@users.noreply.github.com> Date: Wed, 19 Feb 2025 23:34:42 +0530 Subject: [PATCH 06/32] Update README.md Signed-off-by: Aman Bhansali <92033532+aman-095@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/README.md b/lib/node_modules/@stdlib/blas/base/icamax/README.md index c298298e82e6..ee823d308547 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/icamax/README.md @@ -20,7 +20,7 @@ limitations under the License. # icamax -> Finds the index of the first element having maximum |Re(.)| + |Im(.)|. +> Find the index of the first element having maximum |Re(.)| + |Im(.)|.
From ec7efeb718bb3ba8a25e5431d779ee4deab3d46c Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 20 Feb 2025 22:41:32 +0530 Subject: [PATCH 07/32] fix: resolved errors --- 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: na - 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: 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: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - 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/base/icamax/README.md | 2 +- .../blas/base/icamax/benchmark/benchmark.js | 11 +++---- .../icamax/benchmark/benchmark.ndarray.js | 11 +++---- .../@stdlib/blas/base/icamax/docs/repl.txt | 32 +++++++++---------- .../blas/base/icamax/docs/types/index.d.ts | 22 ++++++------- .../@stdlib/blas/base/icamax/lib/icamax.js | 14 ++++---- .../@stdlib/blas/base/icamax/lib/index.js | 6 ++-- 7 files changed, 47 insertions(+), 51 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/README.md b/lib/node_modules/@stdlib/blas/base/icamax/README.md index ee823d308547..d3176a853340 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/icamax/README.md @@ -161,7 +161,7 @@ console.log( icx ); [blas]: http://www.netlib.org/blas -[icamax]: https://netlib.org/lapack/explore-html/d0/da5/izamax_8f.html +[icamax]: https://www.netlib.org/lapack/explore-html/dd/d52/group__iamax_gafdf273dcc3f020e2aa5c716c1b3d7265.html [@stdlib/array/complex64]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex64 diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js index 06b61e4ca535..34e433e9ba81 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js @@ -46,9 +46,8 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx; + var cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); return benchmark; /** @@ -58,18 +57,18 @@ function createBenchmark( len ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var icx; + var idx; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - icx = icamax( cx.length, cx, 1 ); - if ( isnan( icx ) ) { + idx = icamax( cx.length, cx, 1 ); + if ( isnan( idx ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( icx ) ) { + if ( isnan( idx ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js index 71d2a8f97a29..cc0b4f6fac14 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js @@ -46,9 +46,8 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx; + var cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); - cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); return benchmark; /** @@ -58,18 +57,18 @@ function createBenchmark( len ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var icx; + var idx; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - icx = icamax( cx.length, cx, 1, 0 ); - if ( isnan( icx ) ) { + idx = icamax( cx.length, cx, 1, 0 ); + if ( isnan( idx ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( icx ) ) { + if ( isnan( idx ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt index d3652661db38..319a112f3286 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt @@ -1,8 +1,8 @@ -{{alias}}( N, cx, strideX ) +{{alias}}( N, cx, stride ) Finds the index of the first element having maximum |Re(.)| + |Im(.)|. - The `N` and `strideX` parameters determine which elements in `cx` are + The `N` and `stride` parameters determine which elements in `cx` are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use typed @@ -18,35 +18,34 @@ cx: Complex64Array Input array. - strideX: integer + stride: integer Index increment for `cx`. Returns ------- - icx: integer + idx: integer Index value. Examples -------- // Standard Usage: - > var cx; - > cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > var icx = {{alias}}( cx.length, cx, 1 ) + > var cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var idx = {{alias}}( cx.length, cx, 1 ) 1 - // Using `N` and `strideX` parameters: + // Using `N` and `stride` parameters: > cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > icx = {{alias}}( 2, cx, 2 ) + > idx = {{alias}}( 2, cx, 2 ) 1 // Using view offsets: > var cx0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); > var cx1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); - > icx = {{alias}}( 2, cx1, 1 ) + > idx = {{alias}}( 2, cx1, 1 ) 1 -{{alias}}.ndarray( N, cx, strideX, offsetX ) +{{alias}}.ndarray( N, cx, stride, offsetX ) Finds the index of the first element having the maximum absolute value using alternative indexing semantics. @@ -62,7 +61,7 @@ cx: Complex64Array Input array. - strideX: integer + stride: integer Index increment for `cx`. offsetX: integer @@ -70,20 +69,19 @@ Returns ------- - icx: integer + idx: integer Index value. Examples -------- // Standard Usage: - > var cx; - > cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > var icx = {{alias}}.ndarray( cx.length, cx, 1, 0 ) + > var cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var idx = {{alias}}.ndarray( cx.length, cx, 1, 0 ) 1 // Using an index offset: > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > icx = {{alias}}.ndarray( 2, cx, 1, 1 ) + > idx = {{alias}}.ndarray( 2, cx, 1, 1 ) 1 See Also diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts index cd373f51c9cc..2d3fd25fd6d6 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts @@ -31,7 +31,7 @@ interface Routine { * * @param N - number of indexed elements * @param cx - input array - * @param strideX - stride length for `cx` + * @param stride - stride length for `cx` * @returns index value * * @example @@ -39,18 +39,18 @@ interface Routine { * * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * - * var icx = icamax( cx.length, cx, 1 ); + * var idx = icamax( cx.length, cx, 1 ); * // returns 1 */ - ( N: number, zx: Complex64Array, strideX: number ): number; + ( N: number, cx: Complex64Array, stride: number ): number; /** * Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. * * @param N - number of indexed elements * @param cx - input array - * @param strideX - stride length for `zx` - * @param offsetX - starting index for `zx` + * @param stride - stride length for `cx` + * @param offset - starting index for `cx` * @returns index value * * @example @@ -58,18 +58,18 @@ interface Routine { * * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * - * var icx = icamax.ndarray( cx.length, cx, 1, 0 ); + * var idx = icamax.ndarray( cx.length, cx, 1, 0 ); * // returns 1 */ - ndarray( N: number, zx: Complex64Array, strideX: number, offsetX: number ): number; + ndarray( N: number, cx: Complex64Array, stride: number, offset: number ): number; } /** * Finds the index of the first element having maximum |Re(.)| + |Im(.)| * * @param N - number of indexed elements -* @param zx - input array -* @param strideX - stride length for `cx` +* @param cx - input array +* @param stride - stride length for `cx` * @returns index value * * @example @@ -77,7 +77,7 @@ interface Routine { * * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var icx = icamax( cx.length, cx, 1 ); +* var idx = icamax( cx.length, cx, 1 ); * // returns 1 * * @example @@ -85,7 +85,7 @@ interface Routine { * * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var icx = icamax.ndarray( cx.length, cx, 1, 0 ); +* var idx = icamax.ndarray( cx.length, cx, 1, 0 ); * // returns 1 */ declare var icamax: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js index fac62d0bf6e8..5233e64d98ca 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -30,21 +30,21 @@ var ndarray = require( './ndarray.js' ); * Finds the index of the first element having maximum |Re(.)| + |Im(.)|. * * @param {PositiveInteger} N - number of indexed elements -* @param {Float64Array} x - input array -* @param {integer} strideX - `x` stride length +* @param {Float64Array} cx - input array +* @param {integer} stride - `cx` stride length * @returns {integer} index value * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); * -* var icx = icamax( x.length, x, 1 ); +* var idx = icamax( cx.length, cx, 1 ); * // returns 3 */ -function icamax( N, x, strideX ) { - var ox = stride2offset( N, strideX ); - return ndarray( N, x, strideX, ox ); +function icamax( N, cx, stride ) { + var ox = stride2offset( N, stride ); + return ndarray( N, cx, stride, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js index 5b03286183e8..5fd17ec2a18d 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js @@ -27,9 +27,9 @@ * var Complex64Array = require( '@stdlib/array/complex64' ); * var icamax = require( '@stdlib/blas/base/icamax' ); * -* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var cx = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var icx = icamax( x.length, x, 1 ); +* var idx = icamax( cx.length, cx, 1 ); * // returns 1 * * @example @@ -38,7 +38,7 @@ * * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var icx = icamax( cx.length, cx, 1, 0 ); +* var idx = icamax.ndarray( cx.length, cx, 1, 0 ); * // returns 1 */ From 61c28cf7fb91a865d812b735e04e4422ca35e486 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 20 Feb 2025 23:05:50 +0530 Subject: [PATCH 08/32] fix: resolved errors --- 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: 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: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - 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/base/icamax/examples/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js index 2e4d15f86dd6..4575d483b0b2 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js @@ -31,5 +31,5 @@ function rand() { var cx = filledarrayBy( 10, 'complex64', rand ); console.log( cx.toString() ); -var icx = icamax( cx.length, cx, 1 ); -console.log( icx ); +var idx = icamax( cx.length, cx, 1 ); +console.log( idx ); From a6b105b6f53454fee95d1ed0d6a5642ae923d378 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 23 Apr 2025 10:23:37 +0530 Subject: [PATCH 09/32] chore: update implementation --- 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: passed - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/icamax/README.md | 40 ++--- .../blas/base/icamax/benchmark/benchmark.js | 10 +- .../icamax/benchmark/benchmark.ndarray.js | 10 +- .../@stdlib/blas/base/icamax/docs/repl.txt | 40 ++--- .../blas/base/icamax/docs/types/index.d.ts | 34 ++-- .../blas/base/icamax/docs/types/test.ts | 170 +++++++++--------- .../blas/base/icamax/examples/index.js | 10 +- .../@stdlib/blas/base/icamax/lib/icamax.js | 12 +- .../@stdlib/blas/base/icamax/lib/index.js | 8 +- .../@stdlib/blas/base/icamax/lib/ndarray.js | 26 +-- .../blas/base/icamax/test/test.icamax.js | 44 ++--- .../blas/base/icamax/test/test.ndarray.js | 54 +++--- 12 files changed, 229 insertions(+), 229 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/README.md b/lib/node_modules/@stdlib/blas/base/icamax/README.md index d3176a853340..98dd0b1d0c84 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/icamax/README.md @@ -30,33 +30,33 @@ limitations under the License. var icamax = require( '@stdlib/blas/base/icamax' ); ``` -#### icamax( N, cx, strideX ) +#### icamax( N, x, strideX ) Finds the index of the first element having maximum |Re(.)| + |Im(.)|. ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var icx = icamax( cx.length, cx, 1 ); +var y = icamax( x.length, x, 1 ); // returns 1 ``` The function has the following parameters: - **N**: number of indexed elements. -- **cx**: input [`Complex64Array`][@stdlib/array/complex64]. -- **strideX**: index increment for `cx`. +- **x**: input [`Complex64Array`][@stdlib/array/complex64]. +- **strideX**: index increment for `x`. -The `N` and `strideX` parameters determine which elements in `cx` are accessed at runtime. For example, to traverse every other value, +The `N` and `strideX` parameters determine which elements in `x` are accessed at runtime. For example, to traverse every other value, ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var icx = icamax( 2, cx, 2 ); +var y = icamax( 2, x, 2 ); // returns 1 ``` @@ -66,26 +66,26 @@ Note that indexing is relative to the first index. To introduce an offset, use [ var Complex64Array = require( '@stdlib/array/complex64' ); // Initial array: -var cx0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); +var x0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: -var cx1 = new Complex64Array( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element // Find index of element having the maximum absolute value: -var icx = icamax( 2, cx1, 1 ); +var y = icamax( 2, x1, 1 ); // returns 1 ``` -#### icamax.ndarray( N, cx, strideX, offset ) +#### icamax.ndarray( N, x, strideX, offset ) Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var icx = icamax.ndarray( cx.length, cx, 1, 0 ); +var y = icamax.ndarray( x.length, x, 1, 0 ); // returns 1 ``` @@ -98,9 +98,9 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); -var cx = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); +var x = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); -var icx = icamax.ndarray( 3, cx, 1, 1 ); +var y = icamax.ndarray( 3, x, 1, 1 ); // returns 2 ``` @@ -136,11 +136,11 @@ function rand() { } // Generate random input arrays: -var cx = filledarrayBy( 10, 'complex64', rand ); -console.log( cx.toString() ); +var x = filledarrayBy( 10, 'complex64', rand ); +console.log( x.toString() ); -var icx = icamax( cx.length, cx, 1 ); -console.log( icx ); +var y = icamax( x.length, x, 1 ); +console.log( y ); ```
diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js index 34e433e9ba81..44922eff4730 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js @@ -46,7 +46,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + var x = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); return benchmark; @@ -57,18 +57,18 @@ function createBenchmark( len ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var idx; + var y; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - idx = icamax( cx.length, cx, 1 ); - if ( isnan( idx ) ) { + y = icamax( x.length, x, 1 ); + if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( idx ) ) { + if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js index cc0b4f6fac14..93a496bec58f 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js @@ -46,7 +46,7 @@ var options = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var cx = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); + var x = new Complex64Array( uniform( len*2, -100.0, 100.0, options ) ); return benchmark; @@ -57,18 +57,18 @@ function createBenchmark( len ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var idx; + var y; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - idx = icamax( cx.length, cx, 1, 0 ); - if ( isnan( idx ) ) { + y = icamax( x.length, x, 1, 0 ); + if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( idx ) ) { + if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt index 319a112f3286..3ec82e6ec2df 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt @@ -1,8 +1,8 @@ -{{alias}}( N, cx, stride ) +{{alias}}( N, x, stride ) Finds the index of the first element having maximum |Re(.)| + |Im(.)|. - The `N` and `stride` parameters determine which elements in `cx` are + The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use typed @@ -15,37 +15,37 @@ N: integer Number of indexed elements. - cx: Complex64Array + x: Complex64Array Input array. stride: integer - Index increment for `cx`. + Index increment for `x`. Returns ------- - idx: integer + y: integer Index value. Examples -------- // Standard Usage: - > var cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > var idx = {{alias}}( cx.length, cx, 1 ) + > var x = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var y = {{alias}}( x.length, x, 1 ) 1 // Using `N` and `stride` parameters: - > cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > idx = {{alias}}( 2, cx, 2 ) + > x = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > y = {{alias}}( 2, x, 2 ) 1 // Using view offsets: > var cx0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > var cx1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); - > idx = {{alias}}( 2, cx1, 1 ) + > var x1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); + > y = {{alias}}( 2, x1, 1 ) 1 -{{alias}}.ndarray( N, cx, stride, offsetX ) +{{alias}}.ndarray( N, x, stride, offsetX ) Finds the index of the first element having the maximum absolute value using alternative indexing semantics. @@ -58,30 +58,30 @@ N: integer Number of indexed elements. - cx: Complex64Array + x: Complex64Array Input array. stride: integer - Index increment for `cx`. + Index increment for `x`. offsetX: integer - Starting index of `cx`. + Starting index of `x`. Returns ------- - idx: integer + y: integer Index value. Examples -------- // Standard Usage: - > var cx = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > var idx = {{alias}}.ndarray( cx.length, cx, 1, 0 ) + > var x = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); + > var y = {{alias}}.ndarray( x.length, x, 1, 0 ) 1 // Using an index offset: - > cx = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > idx = {{alias}}.ndarray( 2, cx, 1, 1 ) + > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + > y = {{alias}}.ndarray( 2, x, 1, 1 ) 1 See Also diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts index 2d3fd25fd6d6..76bea6820531 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts @@ -30,62 +30,62 @@ interface Routine { * Finds the index of the first element having maximum |Re(.)| + |Im(.)|. * * @param N - number of indexed elements - * @param cx - input array - * @param stride - stride length for `cx` + * @param x - input array + * @param stride - stride length for `x` * @returns index value * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * - * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + * var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * - * var idx = icamax( cx.length, cx, 1 ); + * var y = icamax( x.length, x, 1 ); * // returns 1 */ - ( N: number, cx: Complex64Array, stride: number ): number; + ( N: number, x: Complex64Array, stride: number ): number; /** * Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. * * @param N - number of indexed elements - * @param cx - input array - * @param stride - stride length for `cx` - * @param offset - starting index for `cx` + * @param x - input array + * @param stride - stride length for `x` + * @param offset - starting index for `x` * @returns index value * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * - * var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); + * var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * - * var idx = icamax.ndarray( cx.length, cx, 1, 0 ); + * var y = icamax.ndarray( x.length, x, 1, 0 ); * // returns 1 */ - ndarray( N: number, cx: Complex64Array, stride: number, offset: number ): number; + ndarray( N: number, x: Complex64Array, stride: number, offset: number ): number; } /** * Finds the index of the first element having maximum |Re(.)| + |Im(.)| * * @param N - number of indexed elements -* @param cx - input array -* @param stride - stride length for `cx` +* @param x - input array +* @param stride - stride length for `x` * @returns index value * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var idx = icamax( cx.length, cx, 1 ); +* var y = icamax( x.length, x, 1 ); * // returns 1 * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var idx = icamax.ndarray( cx.length, cx, 1, 0 ); +* var y = icamax.ndarray( x.length, x, 1, 0 ); * // returns 1 */ declare var icamax: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts index 01112bfa7612..a10158751a93 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/test.ts @@ -24,135 +24,135 @@ import icamax = require( './index' ); // The function returns a number... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); - icamax( cx.length, cx, 1 ); // $ExpectType number + icamax( x.length, x, 1 ); // $ExpectType number } // The compiler throws an error if the function is provided a first argument which is not a number... { - const cx = new Complex64Array( 10 ); - - icamax( '10', cx, 1 ); // $ExpectError - icamax( true, cx, 1 ); // $ExpectError - icamax( false, cx, 1 ); // $ExpectError - icamax( null, cx, 1 ); // $ExpectError - icamax( undefined, cx, 1 ); // $ExpectError - icamax( [], cx, 1 ); // $ExpectError - icamax( {}, cx, 1 ); // $ExpectError - icamax( ( x: number ): number => x, cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + + icamax( '10', x, 1 ); // $ExpectError + icamax( true, x, 1 ); // $ExpectError + icamax( false, x, 1 ); // $ExpectError + icamax( null, x, 1 ); // $ExpectError + icamax( undefined, x, 1 ); // $ExpectError + icamax( [], x, 1 ); // $ExpectError + icamax( {}, x, 1 ); // $ExpectError + icamax( ( x: number ): number => x, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a Complex64Array... { - const cx = new Complex64Array( 10 ); - - icamax( cx.length, 10, 1 ); // $ExpectError - icamax( cx.length, '10', 1 ); // $ExpectError - icamax( cx.length, true, 1 ); // $ExpectError - icamax( cx.length, false, 1 ); // $ExpectError - icamax( cx.length, null, 1 ); // $ExpectError - icamax( cx.length, undefined, 1 ); // $ExpectError - icamax( cx.length, [], 1 ); // $ExpectError - icamax( cx.length, {}, 1 ); // $ExpectError - icamax( cx.length, ( cx: number ): number => cx, 1 ); // $ExpectError + const x = new Complex64Array( 10 ); + + icamax( x.length, 10, 1 ); // $ExpectError + icamax( x.length, '10', 1 ); // $ExpectError + icamax( x.length, true, 1 ); // $ExpectError + icamax( x.length, false, 1 ); // $ExpectError + icamax( x.length, null, 1 ); // $ExpectError + icamax( x.length, undefined, 1 ); // $ExpectError + icamax( x.length, [], 1 ); // $ExpectError + icamax( x.length, {}, 1 ); // $ExpectError + icamax( x.length, ( x: number ): number => x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a number... { - const cx = new Complex64Array( 10 ); - - icamax( cx.length, cx, '10' ); // $ExpectError - icamax( cx.length, cx, true ); // $ExpectError - icamax( cx.length, cx, false ); // $ExpectError - icamax( cx.length, cx, null ); // $ExpectError - icamax( cx.length, cx, undefined ); // $ExpectError - icamax( cx.length, cx, [] ); // $ExpectError - icamax( cx.length, cx, {} ); // $ExpectError - icamax( cx.length, cx, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + + icamax( x.length, x, '10' ); // $ExpectError + icamax( x.length, x, true ); // $ExpectError + icamax( x.length, x, false ); // $ExpectError + icamax( x.length, x, null ); // $ExpectError + icamax( x.length, x, undefined ); // $ExpectError + icamax( x.length, x, [] ); // $ExpectError + icamax( x.length, x, {} ); // $ExpectError + icamax( x.length, x, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); icamax(); // $ExpectError - icamax( cx.length ); // $ExpectError - icamax( cx.length, cx ); // $ExpectError - icamax( cx.length, cx, 1, 10 ); // $ExpectError + icamax( x.length ); // $ExpectError + icamax( x.length, x ); // $ExpectError + icamax( x.length, x, 1, 10 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a number... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); - icamax.ndarray( cx.length, cx, 1, 0 ); // $ExpectType number + icamax.ndarray( x.length, x, 1, 0 ); // $ExpectType number } // The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... { - const cx = new Complex64Array( 10 ); - - icamax.ndarray( '10', cx, 1, 0 ); // $ExpectError - icamax.ndarray( true, cx, 1, 0 ); // $ExpectError - icamax.ndarray( false, cx, 1, 0 ); // $ExpectError - icamax.ndarray( null, cx, 1, 0 ); // $ExpectError - icamax.ndarray( undefined, cx, 1, 0 ); // $ExpectError - icamax.ndarray( [], cx, 1, 0 ); // $ExpectError - icamax.ndarray( {}, cx, 1, 0 ); // $ExpectError - icamax.ndarray( ( cx: number ): number => cx, cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + + icamax.ndarray( '10', x, 1, 0 ); // $ExpectError + icamax.ndarray( true, x, 1, 0 ); // $ExpectError + icamax.ndarray( false, x, 1, 0 ); // $ExpectError + icamax.ndarray( null, x, 1, 0 ); // $ExpectError + icamax.ndarray( undefined, x, 1, 0 ); // $ExpectError + icamax.ndarray( [], x, 1, 0 ); // $ExpectError + icamax.ndarray( {}, x, 1, 0 ); // $ExpectError + icamax.ndarray( ( x: number ): number => x, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a second argument which is not a Complex64Array... { - const cx = new Complex64Array( 10 ); - - icamax.ndarray( cx.length, 10, 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, '10', 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, true, 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, false, 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, null, 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, undefined, 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, [], 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, {}, 1, 0 ); // $ExpectError - icamax.ndarray( cx.length, ( cx: number ): number => cx, 1, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + + icamax.ndarray( x.length, 10, 1, 0 ); // $ExpectError + icamax.ndarray( x.length, '10', 1, 0 ); // $ExpectError + icamax.ndarray( x.length, true, 1, 0 ); // $ExpectError + icamax.ndarray( x.length, false, 1, 0 ); // $ExpectError + icamax.ndarray( x.length, null, 1, 0 ); // $ExpectError + icamax.ndarray( x.length, undefined, 1, 0 ); // $ExpectError + icamax.ndarray( x.length, [], 1, 0 ); // $ExpectError + icamax.ndarray( x.length, {}, 1, 0 ); // $ExpectError + icamax.ndarray( x.length, ( x: number ): number => x, 1, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... { - const cx = new Complex64Array( 10 ); - - icamax.ndarray( cx.length, cx, '10', 0 ); // $ExpectError - icamax.ndarray( cx.length, cx, true, 0 ); // $ExpectError - icamax.ndarray( cx.length, cx, false, 0 ); // $ExpectError - icamax.ndarray( cx.length, cx, null, 0 ); // $ExpectError - icamax.ndarray( cx.length, cx, undefined, 0 ); // $ExpectError - icamax.ndarray( cx.length, cx, [], 0 ); // $ExpectError - icamax.ndarray( cx.length, cx, {}, 0 ); // $ExpectError - icamax.ndarray( cx.length, cx, ( cx: number ): number => cx, 0 ); // $ExpectError + const x = new Complex64Array( 10 ); + + icamax.ndarray( x.length, x, '10', 0 ); // $ExpectError + icamax.ndarray( x.length, x, true, 0 ); // $ExpectError + icamax.ndarray( x.length, x, false, 0 ); // $ExpectError + icamax.ndarray( x.length, x, null, 0 ); // $ExpectError + icamax.ndarray( x.length, x, undefined, 0 ); // $ExpectError + icamax.ndarray( x.length, x, [], 0 ); // $ExpectError + icamax.ndarray( x.length, x, {}, 0 ); // $ExpectError + icamax.ndarray( x.length, x, ( x: number ): number => x, 0 ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... { - const cx = new Complex64Array( 10 ); - - icamax.ndarray( cx.length, cx, 1, '10' ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, true ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, false ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, null ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, undefined ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, [] ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, {} ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, ( cx: number ): number => cx ); // $ExpectError + const x = new Complex64Array( 10 ); + + icamax.ndarray( x.length, x, 1, '10' ); // $ExpectError + icamax.ndarray( x.length, x, 1, true ); // $ExpectError + icamax.ndarray( x.length, x, 1, false ); // $ExpectError + icamax.ndarray( x.length, x, 1, null ); // $ExpectError + icamax.ndarray( x.length, x, 1, undefined ); // $ExpectError + icamax.ndarray( x.length, x, 1, [] ); // $ExpectError + icamax.ndarray( x.length, x, 1, {} ); // $ExpectError + icamax.ndarray( x.length, x, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... { - const cx = new Complex64Array( 10 ); + const x = new Complex64Array( 10 ); icamax.ndarray(); // $ExpectError - icamax.ndarray( cx.length ); // $ExpectError - icamax.ndarray( cx.length, cx ); // $ExpectError - icamax.ndarray( cx.length, cx, 1 ); // $ExpectError - icamax.ndarray( cx.length, cx, 1, 0, 10 ); // $ExpectError + icamax.ndarray( x.length ); // $ExpectError + icamax.ndarray( x.length, x ); // $ExpectError + icamax.ndarray( x.length, x, 1 ); // $ExpectError + icamax.ndarray( x.length, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js index 4575d483b0b2..f39a862b53eb 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js @@ -21,15 +21,15 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var filledarrayBy = require( '@stdlib/array/filled-by' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var icamax = require( '@stdlib/blas/base/icamax' ); +var icamax = require( './../lib' ); function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } // Generate random input arrays: -var cx = filledarrayBy( 10, 'complex64', rand ); -console.log( cx.toString() ); +var x = filledarrayBy( 10, 'complex64', rand ); +console.log( x.toString() ); -var idx = icamax( cx.length, cx, 1 ); -console.log( idx ); +var y = icamax( x.length, x, 1 ); +console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js index 5233e64d98ca..7af00d8ebd62 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -30,21 +30,21 @@ var ndarray = require( './ndarray.js' ); * Finds the index of the first element having maximum |Re(.)| + |Im(.)|. * * @param {PositiveInteger} N - number of indexed elements -* @param {Float64Array} cx - input array -* @param {integer} stride - `cx` stride length +* @param {Float64Array} x - input array +* @param {integer} stride - `x` stride length * @returns {integer} index value * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); +* var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); * -* var idx = icamax( cx.length, cx, 1 ); +* var y = icamax( x.length, x, 1 ); * // returns 3 */ -function icamax( N, cx, stride ) { +function icamax( N, x, stride ) { var ox = stride2offset( N, stride ); - return ndarray( N, cx, stride, ox ); + return ndarray( N, x, stride, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js index 5fd17ec2a18d..984a4f444bd5 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js @@ -27,18 +27,18 @@ * var Complex64Array = require( '@stdlib/array/complex64' ); * var icamax = require( '@stdlib/blas/base/icamax' ); * -* var cx = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var y = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var idx = icamax( cx.length, cx, 1 ); +* var y = icamax( y.length, y, 1 ); * // returns 1 * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var icamax = require( '@stdlib/blas/base/icamax' ); * -* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var y = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var idx = icamax.ndarray( cx.length, cx, 1, 0 ); +* var y = icamax.ndarray( y.length, y, 1, 0 ); * // returns 1 */ diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index 1e7e7564004a..e1c7bfaf3c12 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -29,44 +29,44 @@ var scabs1 = require( '@stdlib/blas/base/scabs1' ); * Finds the index of the first element having maximum |Re(.)| + |Im(.)|. * * @param {PositiveInteger} N - number of indexed elements -* @param {Complex64Array} cx - input array -* @param {integer} strideX - `cx` stride length -* @param {NonNegativeInteger} offsetX - starting index for `cx` +* @param {Complex64Array} x - input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` * @returns {integer} index value * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * -* var cx = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var icx = icamax( cx.length, cx, 1, 0 ); +* var y = icamax( x.length, x, 1, 0 ); * // returns 1 */ -function icamax( N, cx, strideX, offsetX ) { +function icamax( N, x, strideX, offsetX ) { var cmax; - var icx; var ix; var v; + var y; var i; if ( N < 1 ) { return -1; } - icx = 0; + y = 0; if ( N === 1 ) { - return icx; + return y; } - cmax = scabs1( cx.get( offsetX ) ); + cmax = scabs1( x.get( offsetX ) ); ix = offsetX + strideX; for ( i = 1; i < N; i++ ) { - v = scabs1( cx.get( ix ) ); + v = scabs1( x.get( ix ) ); if ( v > cmax ) { - icx = i; + y = i; cmax = v; } ix += strideX; } - return icx; + return y; } diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js index 0e6364b733a3..ad55151c11d6 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js @@ -40,7 +40,7 @@ tape( 'the function has an arity of 3', function test( t ) { tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -55,8 +55,8 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 3; - icx = icamax( 4, x, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 4, x, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); x = new Complex64Array([ 0.2, // 1 @@ -68,15 +68,15 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 1; - icx = icamax( 2, x, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 2, x, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -87,15 +87,15 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', f ]); expected = -1; - icx = icamax( 0, x, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 0, x, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -106,15 +106,15 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', fun ]); expected = 0; - icx = icamax( 1, x, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 1, x, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying a stride', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -129,38 +129,38 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 1; - icx = icamax( 2, x, 2 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 2, x, 2 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying a negative stride', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); expected = 1; - icx = icamax( x.length, x, -1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( x.length, x, -1 ); + t.strictEqual( y, expected, 'returns expected value' ); // eslint-disable-next-line max-len x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); expected = 1; - icx = icamax( 4, x, -2 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 4, x, -2 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports view offsets', function test( t ) { var expected; - var icx; var x0; var x1; + var y; x0 = new Complex64Array([ 1.0, @@ -175,8 +175,8 @@ tape( 'the function supports view offsets', function test( t ) { x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); expected = 2; - icx = icamax( 3, x1, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 3, x1, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js index 3fd6e9fe8c34..ec94e3af819e 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -40,7 +40,7 @@ tape( 'the function has an arity of 4', function test( t ) { tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -55,8 +55,8 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 3; - icx = icamax( 4, x, 1, 0 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 4, x, 1, 0 ); + t.strictEqual( y, expected, 'returns expected value' ); x = new Complex64Array([ 0.2, // 1 @@ -68,15 +68,15 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 1; - icx = icamax( 2, x, 1, 0 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 2, x, 1, 0 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -87,15 +87,15 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', f ]); expected = -1; - icx = icamax( 0, x, 1, 0 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 0, x, 1, 0 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -106,35 +106,35 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', fun ]); expected = 0; - icx = icamax( 1, x, 1, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 1, x, 1, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports accessing elements in reverse order', function test( t ) { - var icx; + var y; var x; x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); - icx = icamax( x.length, x, -1, x.length-1 ); - t.strictEqual( icx, 1, 'returns expected value' ); + y = icamax( x.length, x, -1, x.length-1 ); + t.strictEqual( y, 1, 'returns expected value' ); - icx = icamax( 2, x, -1, x.length-2 ); - t.strictEqual( icx, 0, 'returns expected value' ); + y = icamax( 2, x, -1, x.length-2 ); + t.strictEqual( y, 0, 'returns expected value' ); // eslint-disable-next-line max-len x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); - icx = icamax( 4, x, -2, x.length-1 ); - t.strictEqual( icx, 1, 'returns expected value' ); + y = icamax( 4, x, -2, x.length-1 ); + t.strictEqual( y, 1, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying a stride', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -149,15 +149,15 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 1; - icx = icamax( 2, x, 2, 0 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 2, x, 2, 0 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying an `x` offset', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -172,15 +172,15 @@ tape( 'the function supports specifying an `x` offset', function test( t ) { ]); expected = 2; - icx = icamax( 3, x, 1, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 3, x, 1, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports complex access patterns', function test( t ) { var expected; - var icx; + var y; var x; x = new Complex64Array([ @@ -195,8 +195,8 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); expected = 1; - icx = icamax( 2, x, 2, 1 ); - t.strictEqual( icx, expected, 'returns expected value' ); + y = icamax( 2, x, 2, 1 ); + t.strictEqual( y, expected, 'returns expected value' ); t.end(); }); From eb6d0b0999751f9131e1bdd949ca69a9bb5bcd7f Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 23 Apr 2025 10:31:11 +0530 Subject: [PATCH 10/32] chore: update variable name Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt index 3ec82e6ec2df..b614f1902bd5 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt @@ -39,8 +39,8 @@ 1 // Using view offsets: - > var cx0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > var x1 = new {{alias:@stdlib/array/complex64}}( cx0.buffer, cx0.BYTES_PER_ELEMENT*1 ); + > var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); + > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); > y = {{alias}}( 2, x1, 1 ) 1 From 117f26e3923fc64c5dc4a4552287b43ff2b72e25 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Thu, 12 Jun 2025 23:04:57 +0530 Subject: [PATCH 11/32] chore: update implementation Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index e1c7bfaf3c12..6abe97be047d 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -49,17 +49,17 @@ function icamax( N, x, strideX, offsetX ) { var y; var i; - if ( N < 1 ) { - return -1; + if ( N < 1 || strideX <= 0 ) { + return y; } y = 0; if ( N === 1 ) { return y; } - cmax = scabs1( x.get( offsetX ) ); + cmax = scabs1( x[ offsetX ] ); ix = offsetX + strideX; for ( i = 1; i < N; i++ ) { - v = scabs1( x.get( ix ) ); + v = scabs1( x[ ix ] ); if ( v > cmax ) { y = i; cmax = v; From a0e1f2e8836fe33421687cba704e56106e87ee84 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Thu, 12 Jun 2025 23:16:49 +0530 Subject: [PATCH 12/32] chore: update implementation Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index 6abe97be047d..e1c7bfaf3c12 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -49,17 +49,17 @@ function icamax( N, x, strideX, offsetX ) { var y; var i; - if ( N < 1 || strideX <= 0 ) { - return y; + if ( N < 1 ) { + return -1; } y = 0; if ( N === 1 ) { return y; } - cmax = scabs1( x[ offsetX ] ); + cmax = scabs1( x.get( offsetX ) ); ix = offsetX + strideX; for ( i = 1; i < N; i++ ) { - v = scabs1( x[ ix ] ); + v = scabs1( x.get( ix ) ); if ( v > cmax ) { y = i; cmax = v; From ff254705c2e12e95a716ea6e752dd852d4cc9a50 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Thu, 12 Jun 2025 23:28:55 +0530 Subject: [PATCH 13/32] chore: add ndarray example Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/examples/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js index f39a862b53eb..5b20e118ee99 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js @@ -33,3 +33,7 @@ console.log( x.toString() ); var y = icamax( x.length, x, 1 ); console.log( y ); + +var y = icamax.ndarray( x.length, x, 1, 0 ); +console.log( y ); + From 2486f5f25732233a945159696eeb8a42ee60ade1 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Thu, 12 Jun 2025 23:38:35 +0530 Subject: [PATCH 14/32] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/examples/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js index 5b20e118ee99..e39157208c65 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js @@ -34,6 +34,5 @@ console.log( x.toString() ); var y = icamax( x.length, x, 1 ); console.log( y ); -var y = icamax.ndarray( x.length, x, 1, 0 ); +y = icamax.ndarray( x.length, x, 1, 0 ); console.log( y ); - From c218d9410b625fe931c0e168b79f5edc7457229c Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:23:34 +0530 Subject: [PATCH 15/32] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index e1c7bfaf3c12..105a1e6377e7 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -43,7 +43,7 @@ var scabs1 = require( '@stdlib/blas/base/scabs1' ); * // returns 1 */ function icamax( N, x, strideX, offsetX ) { - var cmax; + var max; var ix; var v; var y; @@ -56,13 +56,13 @@ function icamax( N, x, strideX, offsetX ) { if ( N === 1 ) { return y; } - cmax = scabs1( x.get( offsetX ) ); + max = scabs1( x.get( offsetX ) ); ix = offsetX + strideX; for ( i = 1; i < N; i++ ) { v = scabs1( x.get( ix ) ); - if ( v > cmax ) { + if ( v > max ) { y = i; - cmax = v; + max = v; } ix += strideX; } From cfa22e83feee59b49c869b0291ad650e096e9097 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:32:24 +0530 Subject: [PATCH 16/32] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../blas/base/icamax/test/test.icamax.js | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js index ad55151c11d6..9e35e0e59488 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js @@ -44,14 +44,14 @@ tape( 'the function finds the index of the element with the maximum absolute val var x; x = new Complex64Array([ - 0.1, // 1 - -0.3, // 1 - 0.5, // 2 - -0.1, // 2 - -0.2, // 3 - 0.6, // 3 - -0.4, // 4 - 0.9 // 4 + 0.1, // 0 + -0.3, // 0 + 0.5, // 1 + -0.1, // 1 + -0.2, // 2 + 0.6, // 2 + -0.4, // 3 + 0.9 // 3 ]); expected = 3; @@ -59,10 +59,10 @@ tape( 'the function finds the index of the element with the maximum absolute val t.strictEqual( y, expected, 'returns expected value' ); x = new Complex64Array([ - 0.2, // 1 - -0.6, // 1 - 0.3, // 2 - 0.6, // 2 + 0.2, // 0 + -0.6, // 0 + 0.3, // 1 + 0.6, // 1 5.0, 5.0 ]); @@ -118,12 +118,12 @@ tape( 'the function supports specifying a stride', function test( t ) { var x; x = new Complex64Array([ - 0.1, // 1 - 4.0, // 1 + 0.1, // 0 + 4.0, // 0 -0.3, 6.0, - -0.5, // 2 - 7.0, // 2 + -0.5, // 1 + 7.0, // 1 -0.1, 3.0 ]); From 4e71757ba930c22c3736058bea6707b2d1a2f4fc Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:35:10 +0530 Subject: [PATCH 17/32] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../blas/base/icamax/test/test.ndarray.js | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js index ec94e3af819e..35da215bff02 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -44,14 +44,14 @@ tape( 'the function finds the index of the element with the maximum absolute val var x; x = new Complex64Array([ - 0.1, // 1 - -0.3, // 1 - 0.5, // 2 - -0.1, // 2 - -0.2, // 3 - 0.6, // 3 - -0.4, // 4 - 0.9 // 4 + 0.1, // 0 + -0.3, // 0 + 0.5, // 1 + -0.1, // 1 + -0.2, // 2 + 0.6, // 2 + -0.4, // 3 + 0.9 // 3 ]); expected = 3; @@ -59,10 +59,10 @@ tape( 'the function finds the index of the element with the maximum absolute val t.strictEqual( y, expected, 'returns expected value' ); x = new Complex64Array([ - 0.2, // 1 - -0.6, // 1 - 0.3, // 2 - 0.6, // 2 + 0.2, // 0 + -0.6, // 0 + 0.3, // 1 + 0.6, // 1 5.0, 5.0 ]); @@ -138,12 +138,12 @@ tape( 'the function supports specifying a stride', function test( t ) { var x; x = new Complex64Array([ - 0.1, // 1 - 4.0, // 1 + 0.1, // 0 + 4.0, // 0 -0.3, 6.0, - -0.5, // 2 - 7.0, // 2 + -0.5, // 1 + 7.0, // 1 -0.1, 3.0 ]); From 66ef6c584220c5a2d647c8a6499dede593f1e422 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 27 Jun 2025 12:31:44 +0530 Subject: [PATCH 18/32] chore: clean-up --- 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: na - 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 --- --- .../@stdlib/blas/base/icamax/benchmark/benchmark.js | 6 +++--- .../@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js index 44922eff4730..5147e7907ddf 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js @@ -22,7 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var pkg = require( './../package.json' ).name; @@ -63,12 +63,12 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { y = icamax( x.length, x, 1 ); - if ( isnan( y ) ) { + if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( y ) ) { + if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js index 93a496bec58f..8ac351a2c6d5 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js @@ -22,7 +22,7 @@ var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/array/uniform' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pow = require( '@stdlib/math/base/special/pow' ); var Complex64Array = require( '@stdlib/array/complex64' ); var pkg = require( './../package.json' ).name; @@ -63,12 +63,12 @@ function createBenchmark( len ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { y = icamax( x.length, x, 1, 0 ); - if ( isnan( y ) ) { + if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnan( y ) ) { + if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); From 939fff69159e98e6bd7df8bebb04b5847e039d94 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 27 Jun 2025 12:43:21 +0530 Subject: [PATCH 19/32] chore: clean-up --- 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 --- --- .../@stdlib/blas/base/icamax/docs/repl.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt index b614f1902bd5..e72e4c437b81 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt @@ -1,8 +1,8 @@ -{{alias}}( N, x, stride ) +{{alias}}( N, x, strideX ) Finds the index of the first element having maximum |Re(.)| + |Im(.)|. - The `N` and `stride` parameters determine which elements in `x` are + The `N` and `strideX` parameters determine which elements in `x` are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use typed @@ -18,7 +18,7 @@ x: Complex64Array Input array. - stride: integer + strideX: integer Index increment for `x`. Returns @@ -33,7 +33,7 @@ > var y = {{alias}}( x.length, x, 1 ) 1 - // Using `N` and `stride` parameters: + // Using `N` and `strideX` parameters: > x = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); > y = {{alias}}( 2, x, 2 ) 1 @@ -45,8 +45,8 @@ 1 -{{alias}}.ndarray( N, x, stride, offsetX ) - Finds the index of the first element having the maximum absolute value using +{{alias}}.ndarray( N, x, strideX, offsetX ) + Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. While typed array views mandate a view offset based on the underlying @@ -61,7 +61,7 @@ x: Complex64Array Input array. - stride: integer + strideX: integer Index increment for `x`. offsetX: integer From aed923add48a72a1288986eeb7c4ee16fb8154c3 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 27 Jun 2025 12:45:56 +0530 Subject: [PATCH 20/32] chore: clean-up --- 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 --- --- lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js index 7af00d8ebd62..38eb78e15073 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -31,7 +31,7 @@ var ndarray = require( './ndarray.js' ); * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array -* @param {integer} stride - `x` stride length +* @param {integer} strideX - `x` stride length * @returns {integer} index value * * @example @@ -42,9 +42,9 @@ var ndarray = require( './ndarray.js' ); * var y = icamax( x.length, x, 1 ); * // returns 3 */ -function icamax( N, x, stride ) { - var ox = stride2offset( N, stride ); - return ndarray( N, x, stride, ox ); +function icamax( N, x, strideX ) { + var ox = stride2offset( N, strideX ); + return ndarray( N, x, strideX, ox ); } From 9ec9c5c5ca04e416eb8eb35d8a03d331d532561d Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 27 Jun 2025 12:50:23 +0530 Subject: [PATCH 21/32] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/README.md b/lib/node_modules/@stdlib/blas/base/icamax/README.md index 98dd0b1d0c84..fbd106c260bd 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/icamax/README.md @@ -76,7 +76,7 @@ var y = icamax( 2, x1, 1 ); // returns 1 ``` -#### icamax.ndarray( N, x, strideX, offset ) +#### icamax.ndarray( N, x, strideX, offsetX ) Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. From 54132e0b712ce0b2496d27be8e5d949478f541b9 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 27 Jun 2025 12:50:37 +0530 Subject: [PATCH 22/32] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/icamax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/README.md b/lib/node_modules/@stdlib/blas/base/icamax/README.md index fbd106c260bd..cdbc7150ccb5 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/icamax/README.md @@ -93,7 +93,7 @@ The function has the following additional parameters: - **offsetX**: starting index. -While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to start from the second index, +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to start from the second index, ```javascript var Complex64Array = require( '@stdlib/array/complex64' ); From 9d0ba9e374530e19a3be41117729afd367e21a16 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:08:59 +0530 Subject: [PATCH 23/32] chore: change y to idx --- 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: passed - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/icamax/README.md | 16 +++--- .../blas/base/icamax/benchmark/benchmark.js | 8 +-- .../icamax/benchmark/benchmark.ndarray.js | 8 +-- .../@stdlib/blas/base/icamax/docs/repl.txt | 14 ++--- .../blas/base/icamax/docs/types/index.d.ts | 8 +-- .../blas/base/icamax/examples/index.js | 8 +-- .../@stdlib/blas/base/icamax/lib/icamax.js | 2 +- .../@stdlib/blas/base/icamax/lib/index.js | 8 +-- .../@stdlib/blas/base/icamax/lib/ndarray.js | 12 ++--- .../blas/base/icamax/test/test.icamax.js | 44 +++++++-------- .../blas/base/icamax/test/test.ndarray.js | 54 +++++++++---------- 11 files changed, 91 insertions(+), 91 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/README.md b/lib/node_modules/@stdlib/blas/base/icamax/README.md index cdbc7150ccb5..96326bff2677 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/icamax/README.md @@ -39,7 +39,7 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var y = icamax( x.length, x, 1 ); +var idx = icamax( x.length, x, 1 ); // returns 1 ``` @@ -56,7 +56,7 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var y = icamax( 2, x, 2 ); +var idx = icamax( 2, x, 2 ); // returns 1 ``` @@ -71,8 +71,8 @@ var x0 = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); // Create an offset view: var x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -// Find index of element having the maximum absolute value: -var y = icamax( 2, x1, 1 ); +// Find index of element having the maximum |Re(.)| + |Im(.)|: +var idx = icamax( 2, x1, 1 ); // returns 1 ``` @@ -85,7 +85,7 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); -var y = icamax.ndarray( x.length, x, 1, 0 ); +var idx = icamax.ndarray( x.length, x, 1, 0 ); // returns 1 ``` @@ -100,7 +100,7 @@ var Complex64Array = require( '@stdlib/array/complex64' ); var x = new Complex64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 ] ); -var y = icamax.ndarray( 3, x, 1, 1 ); +var idx = icamax.ndarray( 3, x, 1, 1 ); // returns 2 ``` @@ -139,8 +139,8 @@ function rand() { var x = filledarrayBy( 10, 'complex64', rand ); console.log( x.toString() ); -var y = icamax( x.length, x, 1 ); -console.log( y ); +var idx = icamax( x.length, x, 1 ); +console.log( idx ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js index 5147e7907ddf..4017200256ec 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.js @@ -57,18 +57,18 @@ function createBenchmark( len ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var y; + var idx; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = icamax( x.length, x, 1 ); - if ( isnanf( y ) ) { + idx = icamax( x.length, x, 1 ); + if ( isnanf( idx ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( y ) ) { + if ( isnanf( idx ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js index 8ac351a2c6d5..f78028194a7e 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/benchmark/benchmark.ndarray.js @@ -57,18 +57,18 @@ function createBenchmark( len ) { * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { - var y; + var idx; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = icamax( x.length, x, 1, 0 ); - if ( isnanf( y ) ) { + idx = icamax( x.length, x, 1, 0 ); + if ( isnanf( idx ) ) { b.fail( 'should not return NaN' ); } } b.toc(); - if ( isnanf( y ) ) { + if ( isnanf( idx ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt index e72e4c437b81..22e50e7da7bc 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/repl.txt @@ -23,25 +23,25 @@ Returns ------- - y: integer + idx: integer Index value. Examples -------- // Standard Usage: > var x = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > var y = {{alias}}( x.length, x, 1 ) + > var idx = {{alias}}( x.length, x, 1 ) 1 // Using `N` and `strideX` parameters: > x = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > y = {{alias}}( 2, x, 2 ) + > idx = {{alias}}( 2, x, 2 ) 1 // Using view offsets: > var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - > y = {{alias}}( 2, x1, 1 ) + > idx = {{alias}}( 2, x1, 1 ) 1 @@ -69,19 +69,19 @@ Returns ------- - y: integer + idx: integer Index value. Examples -------- // Standard Usage: > var x = new {{alias:@stdlib/array/complex64}}( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 ] ); - > var y = {{alias}}.ndarray( x.length, x, 1, 0 ) + > var idx = {{alias}}.ndarray( x.length, x, 1, 0 ) 1 // Using an index offset: > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] ); - > y = {{alias}}.ndarray( 2, x, 1, 1 ) + > idx = {{alias}}.ndarray( 2, x, 1, 1 ) 1 See Also diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts index 76bea6820531..910ed4c96f15 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts @@ -39,7 +39,7 @@ interface Routine { * * var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * - * var y = icamax( x.length, x, 1 ); + * var idx = icamax( x.length, x, 1 ); * // returns 1 */ ( N: number, x: Complex64Array, stride: number ): number; @@ -58,7 +58,7 @@ interface Routine { * * var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * - * var y = icamax.ndarray( x.length, x, 1, 0 ); + * var idx = icamax.ndarray( x.length, x, 1, 0 ); * // returns 1 */ ndarray( N: number, x: Complex64Array, stride: number, offset: number ): number; @@ -77,7 +77,7 @@ interface Routine { * * var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var y = icamax( x.length, x, 1 ); +* var idx = icamax( x.length, x, 1 ); * // returns 1 * * @example @@ -85,7 +85,7 @@ interface Routine { * * var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var y = icamax.ndarray( x.length, x, 1, 0 ); +* var idx = icamax.ndarray( x.length, x, 1, 0 ); * // returns 1 */ declare var icamax: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js index e39157208c65..1101185f6723 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js @@ -31,8 +31,8 @@ function rand() { var x = filledarrayBy( 10, 'complex64', rand ); console.log( x.toString() ); -var y = icamax( x.length, x, 1 ); -console.log( y ); +var idx = icamax( x.length, x, 1 ); +console.log( idx ); -y = icamax.ndarray( x.length, x, 1, 0 ); -console.log( y ); +idx = icamax.ndarray( x.length, x, 1, 0 ); +console.log( idx ); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js index 38eb78e15073..eeea38f4616f 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -39,7 +39,7 @@ var ndarray = require( './ndarray.js' ); * * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); * -* var y = icamax( x.length, x, 1 ); +* var idx = icamax( x.length, x, 1 ); * // returns 3 */ function icamax( N, x, strideX ) { diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js index 984a4f444bd5..35a480e590cb 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/index.js @@ -27,18 +27,18 @@ * var Complex64Array = require( '@stdlib/array/complex64' ); * var icamax = require( '@stdlib/blas/base/icamax' ); * -* var y = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var y = icamax( y.length, y, 1 ); +* var idx = icamax( x.length, x, 1 ); * // returns 1 * * @example * var Complex64Array = require( '@stdlib/array/complex64' ); * var icamax = require( '@stdlib/blas/base/icamax' ); * -* var y = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); +* var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var y = icamax.ndarray( y.length, y, 1, 0 ); +* var idx = icamax.ndarray( x.length, x, 1, 0 ); * // returns 1 */ diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index 105a1e6377e7..ccf79d2a369c 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -39,34 +39,34 @@ var scabs1 = require( '@stdlib/blas/base/scabs1' ); * * var x = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * -* var y = icamax( x.length, x, 1, 0 ); +* var idx = icamax( x.length, x, 1, 0 ); * // returns 1 */ function icamax( N, x, strideX, offsetX ) { var max; + var idx; var ix; var v; - var y; var i; if ( N < 1 ) { return -1; } - y = 0; + idx = 0; if ( N === 1 ) { - return y; + return idx; } max = scabs1( x.get( offsetX ) ); ix = offsetX + strideX; for ( i = 1; i < N; i++ ) { v = scabs1( x.get( ix ) ); if ( v > max ) { - y = i; + idx = i; max = v; } ix += strideX; } - return y; + return idx; } diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js index 9e35e0e59488..ea71ed2c9dda 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js @@ -40,7 +40,7 @@ tape( 'the function has an arity of 3', function test( t ) { tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -55,8 +55,8 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 3; - y = icamax( 4, x, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 4, x, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); x = new Complex64Array([ 0.2, // 0 @@ -68,15 +68,15 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 1; - y = icamax( 2, x, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 2, x, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -87,15 +87,15 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', f ]); expected = -1; - y = icamax( 0, x, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 0, x, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -106,15 +106,15 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', fun ]); expected = 0; - y = icamax( 1, x, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 1, x, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying a stride', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -129,38 +129,38 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 1; - y = icamax( 2, x, 2 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 2, x, 2 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying a negative stride', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); expected = 1; - y = icamax( x.length, x, -1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( x.length, x, -1 ); + t.strictEqual( idx, expected, 'returns expected value' ); // eslint-disable-next-line max-len x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); expected = 1; - y = icamax( 4, x, -2 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 4, x, -2 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports view offsets', function test( t ) { var expected; + var idx; var x0; var x1; - var y; x0 = new Complex64Array([ 1.0, @@ -175,8 +175,8 @@ tape( 'the function supports view offsets', function test( t ) { x1 = new Complex64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); expected = 2; - y = icamax( 3, x1, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 3, x1, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js index 35da215bff02..4a16a574d409 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -40,7 +40,7 @@ tape( 'the function has an arity of 4', function test( t ) { tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -55,8 +55,8 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 3; - y = icamax( 4, x, 1, 0 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 4, x, 1, 0 ); + t.strictEqual( idx, expected, 'returns expected value' ); x = new Complex64Array([ 0.2, // 0 @@ -68,15 +68,15 @@ tape( 'the function finds the index of the element with the maximum absolute val ]); expected = 1; - y = icamax( 2, x, 1, 0 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 2, x, 1, 0 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -87,15 +87,15 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', f ]); expected = -1; - y = icamax( 0, x, 1, 0 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 0, x, 1, 0 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -106,35 +106,35 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', fun ]); expected = 0; - y = icamax( 1, x, 1, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 1, x, 1, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports accessing elements in reverse order', function test( t ) { - var y; + var idx; var x; x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); - y = icamax( x.length, x, -1, x.length-1 ); - t.strictEqual( y, 1, 'returns expected value' ); + idx = icamax( x.length, x, -1, x.length-1 ); + t.strictEqual( idx, 1, 'returns expected value' ); - y = icamax( 2, x, -1, x.length-2 ); - t.strictEqual( y, 0, 'returns expected value' ); + idx = icamax( 2, x, -1, x.length-2 ); + t.strictEqual( idx, 0, 'returns expected value' ); // eslint-disable-next-line max-len x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); - y = icamax( 4, x, -2, x.length-1 ); - t.strictEqual( y, 1, 'returns expected value' ); + idx = icamax( 4, x, -2, x.length-1 ); + t.strictEqual( idx, 1, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying a stride', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -149,15 +149,15 @@ tape( 'the function supports specifying a stride', function test( t ) { ]); expected = 1; - y = icamax( 2, x, 2, 0 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 2, x, 2, 0 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports specifying an `x` offset', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -172,15 +172,15 @@ tape( 'the function supports specifying an `x` offset', function test( t ) { ]); expected = 2; - y = icamax( 3, x, 1, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 3, x, 1, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports complex access patterns', function test( t ) { var expected; - var y; + var idx; var x; x = new Complex64Array([ @@ -195,8 +195,8 @@ tape( 'the function supports complex access patterns', function test( t ) { ]); expected = 1; - y = icamax( 2, x, 2, 1 ); - t.strictEqual( y, expected, 'returns expected value' ); + idx = icamax( 2, x, 2, 1 ); + t.strictEqual( idx, expected, 'returns expected value' ); t.end(); }); From 2e8d355115df3c43856c6d7cb68d96353569702c Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:11:07 +0530 Subject: [PATCH 24/32] chore: add appropriate statements --- 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: na - task: lint_javascript_tests status: passed - 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 --- --- lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js | 2 +- lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js index ea71ed2c9dda..83d3b7fd452d 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js @@ -38,7 +38,7 @@ tape( 'the function has an arity of 3', function test( t ) { t.end(); }); -tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { +tape( 'the function finds the index of the element with the maximum |Re(.)| + |Im(.)|', function test( t ) { var expected; var idx; var x; diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js index 4a16a574d409..c0aa5909eba7 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -38,7 +38,7 @@ tape( 'the function has an arity of 4', function test( t ) { t.end(); }); -tape( 'the function finds the index of the element with the maximum absolute value', function test( t ) { +tape( 'the function finds the index of the element with the maximum |Re(.)| + |Im(.)|', function test( t ) { var expected; var idx; var x; From c2fa56c5674dc857f42d74ef7179b0180ead8827 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:14:14 +0530 Subject: [PATCH 25/32] test: add negative stride --- 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: na - task: lint_javascript_tests status: passed - 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 --- --- .../blas/base/icamax/test/test.ndarray.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js index c0aa5909eba7..05fb477eff68 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -155,6 +155,27 @@ tape( 'the function supports specifying a stride', function test( t ) { t.end(); }); +tape( 'the function supports specifying a negative stride', function test( t ) { + var expected; + var idx; + var x; + + x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); + expected = 1; + + idx = icamax( x.length, x, -1, 2 ); + t.strictEqual( idx, expected, 'returns expected value' ); + + // eslint-disable-next-line max-len + x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); + expected = 1; + + idx = icamax( 4, x, -2, 6 ); + t.strictEqual( idx, expected, 'returns expected value' ); + + t.end(); +}); + tape( 'the function supports specifying an `x` offset', function test( t ) { var expected; var idx; From d793db6b581ef0bde746c583a4c6c692cea6be1d Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:36:59 +0530 Subject: [PATCH 26/32] docs: update jsdoc --- 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: 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/icamax/docs/types/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts index 910ed4c96f15..df8d0704a839 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/icamax/docs/types/index.d.ts @@ -31,7 +31,7 @@ interface Routine { * * @param N - number of indexed elements * @param x - input array - * @param stride - stride length for `x` + * @param strideX - stride length for `x` * @returns index value * * @example @@ -42,14 +42,14 @@ interface Routine { * var idx = icamax( x.length, x, 1 ); * // returns 1 */ - ( N: number, x: Complex64Array, stride: number ): number; + ( N: number, x: Complex64Array, strideX: number ): number; /** * Finds the index of the first element having maximum |Re(.)| + |Im(.)| using alternative indexing semantics. * * @param N - number of indexed elements * @param x - input array - * @param stride - stride length for `x` + * @param strideX - stride length for `x` * @param offset - starting index for `x` * @returns index value * @@ -61,7 +61,7 @@ interface Routine { * var idx = icamax.ndarray( x.length, x, 1, 0 ); * // returns 1 */ - ndarray( N: number, x: Complex64Array, stride: number, offset: number ): number; + ndarray( N: number, x: Complex64Array, strideX: number, offset: number ): number; } /** @@ -69,7 +69,7 @@ interface Routine { * * @param N - number of indexed elements * @param x - input array -* @param stride - stride length for `x` +* @param strideX - stride length for `x` * @returns index value * * @example From e4f78afff2f12136085d4d1b98242a0e8a8e14ec Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:37:51 +0530 Subject: [PATCH 27/32] chore: update comment --- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/icamax/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js index 1101185f6723..016dec014ed0 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/examples/index.js @@ -27,7 +27,7 @@ function rand() { return new Complex64( discreteUniform( 0, 10 ), discreteUniform( -5, 5 ) ); } -// Generate random input arrays: +// Generate random input array: var x = filledarrayBy( 10, 'complex64', rand ); console.log( x.toString() ); From ce669930fde2e0e4ac3c3590f04d626b5776eae2 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:38:45 +0530 Subject: [PATCH 28/32] chore: reducing variable --- 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 --- --- lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js index eeea38f4616f..ed583413280a 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/icamax.js @@ -43,8 +43,7 @@ var ndarray = require( './ndarray.js' ); * // returns 3 */ function icamax( N, x, strideX ) { - var ox = stride2offset( N, strideX ); - return ndarray( N, x, strideX, ox ); + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); } From d7fb24e49fcb3e08b06f8b80e5b50d75afeb7e73 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:40:08 +0530 Subject: [PATCH 29/32] chore: add appropriate keyword --- 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: passed - task: lint_repl_help status: na - 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 --- --- lib/node_modules/@stdlib/blas/base/icamax/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/package.json b/lib/node_modules/@stdlib/blas/base/icamax/package.json index 8a96be766354..d029d6d6c3fe 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/package.json +++ b/lib/node_modules/@stdlib/blas/base/icamax/package.json @@ -57,7 +57,7 @@ "level 1", "icamax", "maximum", - "dcabs1", + "scabs1", "absolute", "find", "index", From 99d56c1633755f31e56bcccaae2d43becb1e32a1 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:42:04 +0530 Subject: [PATCH 30/32] test: remove duplicate --- 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: na - task: lint_javascript_tests status: passed - 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 --- --- .../blas/base/icamax/test/test.ndarray.js | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js index 05fb477eff68..fbb28b374330 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -112,26 +112,6 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', fun t.end(); }); -tape( 'the function supports accessing elements in reverse order', function test( t ) { - var idx; - var x; - - x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); - - idx = icamax( x.length, x, -1, x.length-1 ); - t.strictEqual( idx, 1, 'returns expected value' ); - - idx = icamax( 2, x, -1, x.length-2 ); - t.strictEqual( idx, 0, 'returns expected value' ); - - // eslint-disable-next-line max-len - x = new Complex64Array( [ 0.1, 4.0, 999.0, 999.0, -0.3, 6.0, 999.0, 999.0, -0.5, 7.0, 999.0, 999.0, -0.1, 3.0 ] ); - idx = icamax( 4, x, -2, x.length-1 ); - t.strictEqual( idx, 1, 'returns expected value' ); - - t.end(); -}); - tape( 'the function supports specifying a stride', function test( t ) { var expected; var idx; From 9f4ecb66c795f4194eee8521119097bbea065101 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:43:19 +0530 Subject: [PATCH 31/32] refactor: reduce variable --- 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 --- --- lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js index ccf79d2a369c..347e0bfbf895 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/lib/ndarray.js @@ -46,7 +46,6 @@ function icamax( N, x, strideX, offsetX ) { var max; var idx; var ix; - var v; var i; if ( N < 1 ) { @@ -59,10 +58,9 @@ function icamax( N, x, strideX, offsetX ) { max = scabs1( x.get( offsetX ) ); ix = offsetX + strideX; for ( i = 1; i < N; i++ ) { - v = scabs1( x.get( ix ) ); - if ( v > max ) { + if ( scabs1( x.get( ix ) ) > max ) { idx = i; - max = v; + max = scabs1( x.get( ix ) ); } ix += strideX; } From dcd48eb3b88f87543eeacf8a643c14f617a9c9a6 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 18 Jul 2025 11:49:11 +0530 Subject: [PATCH 32/32] chore: add appropriate parameter value --- 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: na - task: lint_javascript_tests status: passed - 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 --- --- lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js | 2 +- lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js index 83d3b7fd452d..93cdc7529be7 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.icamax.js @@ -143,7 +143,7 @@ tape( 'the function supports specifying a negative stride', function test( t ) { x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); expected = 1; - idx = icamax( x.length, x, -1 ); + idx = icamax( 3, x, -1 ); t.strictEqual( idx, expected, 'returns expected value' ); // eslint-disable-next-line max-len diff --git a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js index fbb28b374330..98c03f39b4ac 100644 --- a/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/icamax/test/test.ndarray.js @@ -143,7 +143,7 @@ tape( 'the function supports specifying a negative stride', function test( t ) { x = new Complex64Array( [ 3.0, -4.0, 1.0, 15.0, 4.0, 3.0 ] ); expected = 1; - idx = icamax( x.length, x, -1, 2 ); + idx = icamax( 3, x, -1, 2 ); t.strictEqual( idx, expected, 'returns expected value' ); // eslint-disable-next-line max-len