From d48d8293a26da02a82c4e27ef4ac5b004b86a919 Mon Sep 17 00:00:00 2001 From: headlessNode Date: Sun, 19 Jul 2026 19:20:48 +0500 Subject: [PATCH 01/13] feat: add blas/ext/base/ndarray/dindex-of-not-equal --- 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_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: passed - 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 --- --- .../ndarray/dindex-of-not-equal/README.md | 139 +++++++++++ .../benchmark/benchmark.js | 109 +++++++++ .../ndarray/dindex-of-not-equal/docs/repl.txt | 35 +++ .../dindex-of-not-equal/docs/types/index.d.ts | 56 +++++ .../dindex-of-not-equal/docs/types/test.ts | 64 +++++ .../dindex-of-not-equal/examples/index.js | 38 +++ .../ndarray/dindex-of-not-equal/lib/index.js | 48 ++++ .../ndarray/dindex-of-not-equal/lib/main.js | 67 ++++++ .../ndarray/dindex-of-not-equal/package.json | 68 ++++++ .../ndarray/dindex-of-not-equal/test/test.js | 227 ++++++++++++++++++ 10 files changed, 851 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json create mode 100644 lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/test/test.js diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md new file mode 100644 index 000000000000..b147c19e3870 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md @@ -0,0 +1,139 @@ + + +# dindexOfNotEqual + +> Return the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. + +
+ +
+ + + +
+ +## Usage + +```javascript +var dindexOfNotEqual = require( '@stdlib/blas/ext/base/ndarray/dindex-of-not-equal' ); +``` + +#### dindexOfNotEqual( arrays ) + +Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. + +```javascript +var vector = require( '@stdlib/ndarray/vector/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + +var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); + +var searchElement = scalar2ndarray( 1.0, { + 'dtype': 'float64' +}); + +var idx = dindexOfNotEqual( [ x, searchElement ] ); +// returns 2 +``` + +The function has the following parameters: + +- **arrays**: array-like object containing the following ndarrays: + + - a one-dimensional input ndarray. + - a zero-dimensional ndarray containing the search element. + +If the function is unable to find an element which is not equal to a specified search element, the function returns `-1`. + +```javascript +var vector = require( '@stdlib/ndarray/vector/ctor' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); + +var x = vector( [ 1.0, 1.0, 1.0 ], 'float64' ); + +var searchElement = scalar2ndarray( 1.0, { + 'dtype': 'float64' +}); + +var idx = dindexOfNotEqual( [ x, searchElement ] ); +// returns -1 +``` + +
+ + + +
+ +## Notes + +- When searching for a search element, the function checks for inequality using the strict inequality operator `!==`. As a consequence, `NaN` values are considered distinct from all values (including other `NaN` values), and `-0` and `+0` are considered the same. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/discrete-uniform' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var ndarraylike2scalar = require( '@stdlib/ndarray/ndarraylike2scalar' ); +var dindexOfNotEqual = require( '@stdlib/blas/ext/base/ndarray/dindex-of-not-equal' ); + +var opts = { + 'dtype': 'float64' +}; + +var x = discreteUniform( [ 10 ], -100, 100, opts ); +console.log( ndarray2array( x ) ); + +var searchElement = scalar2ndarray( 80.0, opts ); +console.log( 'Search Element:', ndarraylike2scalar( searchElement ) ); + +var idx = dindexOfNotEqual( [ x, searchElement ] ); +console.log( idx ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/benchmark/benchmark.js new file mode 100644 index 000000000000..28913ccee710 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/benchmark/benchmark.js @@ -0,0 +1,109 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 zeros = require( '@stdlib/ndarray/zeros' ); +var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var pow = require( '@stdlib/math/base/special/pow' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dindexOfNotEqual = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var searchElement; + var x; + + x = zeros( [ len ], options ); + searchElement = scalar2ndarray( 0.0, options ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = dindexOfNotEqual( [ x, searchElement ] ); + if ( out !== out ) { + b.fail( 'should return an integer' ); + } + } + b.toc(); + if ( !isInteger( out ) ) { + b.fail( 'should return an integer' ); + } + 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( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt new file mode 100644 index 000000000000..c6f03ba62db2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt @@ -0,0 +1,35 @@ + +{{alias}}( arrays ) + Returns the first index of an element in a one-dimensional ndarray which is + not equal to a specified search element. + + When searching for a search element, the function checks for inequality + using the strict inequality operator `!==`. As a consequence, `NaN` values + are considered distinct from all values (including other `NaN` values), and + `-0` and `+0` are considered the same. + + If unable to find an element which is not equal to a specified search + element, the function returns `-1`. + + Parameters + ---------- + arrays: ArrayLikeObject + Array-like object containing the following ndarrays: + + - a one-dimensional input ndarray. + - a zero-dimensional ndarray containing the search element. + + Returns + ------- + out: integer + Index. + + Examples + -------- + > var x = {{alias:@stdlib/ndarray/vector/ctor}}( [ 1.0, 1.0, 3.0 ], 'float64' ); + > var v = {{alias:@stdlib/ndarray/from-scalar}}( 1.0, { 'dtype': 'float64' } ); + > {{alias}}( [ x, v ] ) + 2 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts new file mode 100644 index 000000000000..8d2210575dd3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts @@ -0,0 +1,56 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 { typedndarray } from '@stdlib/types/ndarray'; + +/** +* Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +* +* ## Notes +* +* - The function expects the following ndarrays: +* +* - a one-dimensional input ndarray. +* - a zero-dimensional ndarray containing the search element. +* +* @param arrays - array-like object containing ndarrays +* @returns index +* +* @example +* var vector = require( '@stdlib/ndarray/vector/ctor' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* +* var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); +* +* var searchElement = scalar2ndarray( 1.0, { +* 'dtype': 'float64' +* }); +* +* var v = dindexOfNotEqual( [ x, searchElement ] ); +* // returns 2 +*/ +declare function dindexOfNotEqual( arrays: [ typedndarray, typedndarray ] ): number; + + +// EXPORTS // + +export = dindexOfNotEqual; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/test.ts new file mode 100644 index 000000000000..762ef435b2e5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/test.ts @@ -0,0 +1,64 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable space-in-parens */ + +import zeros = require( '@stdlib/ndarray/zeros' ); +import scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +import dindexOfNotEqual = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + const searchElement = scalar2ndarray( 0.0, { + 'dtype': 'float64' + }); + + dindexOfNotEqual( [ x, searchElement ] ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not an array of ndarrays... +{ + dindexOfNotEqual( '10' ); // $ExpectError + dindexOfNotEqual( 10 ); // $ExpectError + dindexOfNotEqual( true ); // $ExpectError + dindexOfNotEqual( false ); // $ExpectError + dindexOfNotEqual( null ); // $ExpectError + dindexOfNotEqual( undefined ); // $ExpectError + dindexOfNotEqual( [] ); // $ExpectError + dindexOfNotEqual( {} ); // $ExpectError + dindexOfNotEqual( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = zeros( [ 10 ], { + 'dtype': 'float64' + }); + const searchElement = scalar2ndarray( 0.0, { + 'dtype': 'float64' + }); + + dindexOfNotEqual(); // $ExpectError + dindexOfNotEqual( [ x, searchElement ], {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js new file mode 100644 index 000000000000..bbbd9ffc8b72 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/discrete-uniform' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray2array = require( '@stdlib/ndarray/to-array' ); +var ndarraylike2scalar = require( '@stdlib/ndarray/ndarraylike2scalar' ); +var dindexOfNotEqual = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; + +var x = discreteUniform( [ 10 ], -100, 100, opts ); +console.log( ndarray2array( x ) ); + +var searchElement = scalar2ndarray( 80.0, opts ); +console.log( 'Search Element:', ndarraylike2scalar( searchElement ) ); + +var idx = dindexOfNotEqual( [ x, searchElement ] ); +console.log( idx ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js new file mode 100644 index 000000000000..f22e9bf32c33 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +/** +* Return the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +* +* @module @stdlib/blas/ext/base/ndarray/dindex-of-not-equal +* +* @example +* var vector = require( '@stdlib/ndarray/vector/ctor' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* var dindexOfNotEqual = require( '@stdlib/blas/ext/base/ndarray/dindex-of-not-equal' ); +* +* var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); +* +* var searchElement = scalar2ndarray( 1.0, { +* 'dtype': 'float64' +* }); +* +* var v = dindexOfNotEqual( [ x, searchElement ] ); +* // returns 2 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js new file mode 100644 index 000000000000..82b2641cd43c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js @@ -0,0 +1,67 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); +var getStride = require( '@stdlib/ndarray/base/stride' ); +var getOffset = require( '@stdlib/ndarray/base/offset' ); +var getData = require( '@stdlib/ndarray/base/data-buffer' ); +var strided = require( '@stdlib/blas/ext/base/dindex-of-not-equal' ).ndarray; +var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); + + +// MAIN // + +/** +* Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +* +* ## Notes +* +* - The function expects the following ndarrays: +* +* - a one-dimensional input ndarray. +* - a zero-dimensional ndarray containing the search element. +* +* @param {ArrayLikeObject} arrays - array-like object containing ndarrays +* @returns {integer} index +* +* @example +* var vector = require( '@stdlib/ndarray/vector/ctor' ); +* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +* +* var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); +* +* var searchElement = scalar2ndarray( 1.0, { +* 'dtype': 'float64' +* }); +* +* var v = dindexOfNotEqual( [ x, searchElement ] ); +* // returns 2 +*/ +function dindexOfNotEqual( arrays ) { + var x = arrays[ 0 ]; + return strided( numelDimension( x, 0 ), ndarraylike2scalar( arrays[ 1 ] ), getData( x ), getStride( x, 0 ), getOffset( x ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dindexOfNotEqual; diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json new file mode 100644 index 000000000000..12fb5664a878 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/ext/base/ndarray/dindex-of-not-equal", + "version": "0.0.0", + "description": "Return the first index of an element in a one-dimensional ndarray which is not equal to a specified search element.", + "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", + "extended", + "array", + "index", + "search", + "get", + "not equal", + "unequal", + "float64", + "ndarray" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/test/test.js new file mode 100644 index 000000000000..37ffcc7b8f96 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/test/test.js @@ -0,0 +1,227 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 Float64Array = require( '@stdlib/array/float64' ); +var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); +var ndarray = require( '@stdlib/ndarray/base/ctor' ); +var dindexOfNotEqual = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Returns a one-dimensional ndarray. +* +* @private +* @param {Float64Array} buffer - underlying data buffer +* @param {NonNegativeInteger} length - number of indexed elements +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - index offset +* @returns {ndarray} one-dimensional ndarray +*/ +function vector( buffer, length, stride, offset ) { + return new ndarray( 'float64', buffer, [ length ], [ stride ], offset, 'row-major' ); +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dindexOfNotEqual, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns the index of the first element in a one-dimensional ndarray which is not equal to a provided search element', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ), 6, 1, 0 ); + + searchElement = scalar2ndarray( 1.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 2, 'returns expected value' ); + + searchElement = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 0, 'returns expected value' ); + + searchElement = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 0, 'returns expected value' ); + + searchElement = scalar2ndarray( 4.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `-1` if every element in a one-dimensional ndarray is equal to a provided search element', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ 2.0, 2.0, 2.0 ] ), 3, 1, 0 ); + searchElement = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, -1, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function considers `NaN` elements to be not equal to a provided search element', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ 1.0, NaN, 1.0 ] ), 3, 1, 0 ); + searchElement = scalar2ndarray( 1.0, { + 'dtype': 'float64' + }); + + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 1, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the index of the first element if a provided search element is `NaN`', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ NaN, 1.0 ] ), 2, 1, 0 ); + searchElement = scalar2ndarray( NaN, { + 'dtype': 'float64' + }); + + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function considers `-0` and `+0` to be equal', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ -0.0, 0.0 ] ), 2, 1, 0 ); + searchElement = scalar2ndarray( 0.0, { + 'dtype': 'float64' + }); + + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, -1, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-unit strides', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ 2.0, 9.0, 2.0, 9.0, 3.0, 9.0 ] ), 3, 2, 0 ); + + searchElement = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 2, 'returns expected value' ); + + searchElement = scalar2ndarray( 9.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having negative strides', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ 2.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ), 6, -1, 5 ); + + searchElement = scalar2ndarray( 3.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 2, 'returns expected value' ); + + searchElement = scalar2ndarray( 1.0, { + 'dtype': 'float64' + }); + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports one-dimensional ndarrays having non-zero offsets', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ), 3, 1, 3 ); + searchElement = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, 1, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `-1` if provided an empty one-dimensional ndarray', function test( t ) { + var searchElement; + var actual; + var x; + + x = vector( new Float64Array( [] ), 0, 1, 0 ); + searchElement = scalar2ndarray( 2.0, { + 'dtype': 'float64' + }); + + actual = dindexOfNotEqual( [ x, searchElement ] ); + t.strictEqual( actual, -1, 'returns expected value' ); + + t.end(); +}); From 0e6a9e6c44c11a814308d38f55b5a3a81f94e319 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 19 Jul 2026 14:39:02 -0700 Subject: [PATCH 02/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/README.md | 4 ++-- .../ext/base/ndarray/dindex-of-not-equal/examples/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md index b147c19e3870..f276047d57b8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md @@ -108,10 +108,10 @@ var opts = { 'dtype': 'float64' }; -var x = discreteUniform( [ 10 ], -100, 100, opts ); +var x = discreteUniform( [ 10 ], 0, 2, opts ); console.log( ndarray2array( x ) ); -var searchElement = scalar2ndarray( 80.0, opts ); +var searchElement = scalar2ndarray( 0, opts ); console.log( 'Search Element:', ndarraylike2scalar( searchElement ) ); var idx = dindexOfNotEqual( [ x, searchElement ] ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js index bbbd9ffc8b72..c2c2f793c424 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/examples/index.js @@ -28,10 +28,10 @@ var opts = { 'dtype': 'float64' }; -var x = discreteUniform( [ 10 ], -100, 100, opts ); +var x = discreteUniform( [ 10 ], 0, 2, opts ); console.log( ndarray2array( x ) ); -var searchElement = scalar2ndarray( 80.0, opts ); +var searchElement = scalar2ndarray( 0, opts ); console.log( 'Search Element:', ndarraylike2scalar( searchElement ) ); var idx = dindexOfNotEqual( [ x, searchElement ] ); From 841b97d3d51495d95a0e557499a49135ef167c4e Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 19 Jul 2026 14:42:04 -0700 Subject: [PATCH 03/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../base/ndarray/dindex-of-not-equal/docs/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts index 8d2210575dd3..c98bafe6abbb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts @@ -20,7 +20,7 @@ /// -import { typedndarray } from '@stdlib/types/ndarray'; +import { float64ndarray } from '@stdlib/types/ndarray'; /** * Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. @@ -48,7 +48,7 @@ import { typedndarray } from '@stdlib/types/ndarray'; * var v = dindexOfNotEqual( [ x, searchElement ] ); * // returns 2 */ -declare function dindexOfNotEqual( arrays: [ typedndarray, typedndarray ] ): number; +declare function dindexOfNotEqual( arrays: [ float64ndarray, float64ndarray ] ): number; // EXPORTS // From 95affdd4da664c99ea471d98221c3e2ce5871418 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 19 Jul 2026 14:48:22 -0700 Subject: [PATCH 04/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../base/ndarray/dindex-of-not-equal/docs/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts index c98bafe6abbb..e6ec46d778fb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts @@ -20,7 +20,7 @@ /// -import { float64ndarray } from '@stdlib/types/ndarray'; +import { float64ndarray, typedndarray } from '@stdlib/types/ndarray'; /** * Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. @@ -48,7 +48,7 @@ import { float64ndarray } from '@stdlib/types/ndarray'; * var v = dindexOfNotEqual( [ x, searchElement ] ); * // returns 2 */ -declare function dindexOfNotEqual( arrays: [ float64ndarray, float64ndarray ] ): number; +declare function dindexOfNotEqual( arrays: [ float64ndarray, typedndarray ] ): number; // EXPORTS // From a11d3b08831aa1a4351a9d326c5ddfbf99eb5172 Mon Sep 17 00:00:00 2001 From: headlessNode Date: Tue, 21 Jul 2026 09:52:51 +0500 Subject: [PATCH 05/13] docs: apply suggestions from code review --- 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_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - 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: 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: passed - task: lint_license_headers status: passed --- --- .../blas/ext/base/ndarray/dindex-of-not-equal/README.md | 4 ++-- .../blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt | 4 ++-- .../base/ndarray/dindex-of-not-equal/docs/types/index.d.ts | 2 +- .../blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js | 2 +- .../blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md index f276047d57b8..7fe115141104 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md @@ -20,7 +20,7 @@ limitations under the License. # dindexOfNotEqual -> Return the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +> Return the first index of an element in a one-dimensional double-precision floating-point ndarray which is not equal to a specified search element.
@@ -38,7 +38,7 @@ var dindexOfNotEqual = require( '@stdlib/blas/ext/base/ndarray/dindex-of-not-equ #### dindexOfNotEqual( arrays ) -Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +Returns the first index of an element in a one-dimensional double-precision floating-point ndarray which is not equal to a specified search element. ```javascript var vector = require( '@stdlib/ndarray/vector/ctor' ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt index c6f03ba62db2..e9c4d961c5ae 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt @@ -1,7 +1,7 @@ {{alias}}( arrays ) - Returns the first index of an element in a one-dimensional ndarray which is - not equal to a specified search element. + Returns the first index of an element in a one-dimensional double-precision + floating-point ndarray which is not equal to a specified search element. When searching for a search element, the function checks for inequality using the strict inequality operator `!==`. As a consequence, `NaN` values diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts index e6ec46d778fb..5e07971338e2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts @@ -23,7 +23,7 @@ import { float64ndarray, typedndarray } from '@stdlib/types/ndarray'; /** -* Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +* Returns the first index of an element in a one-dimensional double-precision floating-point ndarray which is not equal to a specified search element. * * ## Notes * diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js index f22e9bf32c33..ca05dcd2ac06 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Return the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +* Return the first index of an element in a one-dimensional double-precision floating-point ndarray which is not equal to a specified search element. * * @module @stdlib/blas/ext/base/ndarray/dindex-of-not-equal * diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js index 82b2641cd43c..be5eeac84687 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js @@ -31,7 +31,7 @@ var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); // MAIN // /** -* Returns the first index of an element in a one-dimensional ndarray which is not equal to a specified search element. +* Returns the first index of an element in a one-dimensional double-precision floating-point ndarray which is not equal to a specified search element. * * ## Notes * From bc1bc8c07b3afc7644e4b496aba56ac20e3b7142 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:40:54 -0700 Subject: [PATCH 06/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt index e9c4d961c5ae..2cbbfc86bec4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt @@ -26,7 +26,7 @@ Examples -------- - > var x = {{alias:@stdlib/ndarray/vector/ctor}}( [ 1.0, 1.0, 3.0 ], 'float64' ); + > var x = {{alias:@stdlib/ndarray/vector/float64}}( [ 1.0, 1.0, 3.0 ] ); > var v = {{alias:@stdlib/ndarray/from-scalar}}( 1.0, { 'dtype': 'float64' } ); > {{alias}}( [ x, v ] ) 2 From 04460077b25bd06e339d311c24764627030cd915 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:43:02 -0700 Subject: [PATCH 07/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/README.md | 8 ++++---- .../ext/base/ndarray/dindex-of-not-equal/lib/index.js | 4 ++-- .../blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md index 7fe115141104..6a9f796cd0ae 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md @@ -41,10 +41,10 @@ var dindexOfNotEqual = require( '@stdlib/blas/ext/base/ndarray/dindex-of-not-equ Returns the first index of an element in a one-dimensional double-precision floating-point ndarray which is not equal to a specified search element. ```javascript -var vector = require( '@stdlib/ndarray/vector/ctor' ); +var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); +var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); var searchElement = scalar2ndarray( 1.0, { 'dtype': 'float64' @@ -64,10 +64,10 @@ The function has the following parameters: If the function is unable to find an element which is not equal to a specified search element, the function returns `-1`. ```javascript -var vector = require( '@stdlib/ndarray/vector/ctor' ); +var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var x = vector( [ 1.0, 1.0, 1.0 ], 'float64' ); +var x = Float64Vector( [ 1.0, 1.0, 1.0 ] ); var searchElement = scalar2ndarray( 1.0, { 'dtype': 'float64' diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js index ca05dcd2ac06..565db15b4aed 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js @@ -24,11 +24,11 @@ * @module @stdlib/blas/ext/base/ndarray/dindex-of-not-equal * * @example -* var vector = require( '@stdlib/ndarray/vector/ctor' ); +* var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * var dindexOfNotEqual = require( '@stdlib/blas/ext/base/ndarray/dindex-of-not-equal' ); * -* var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); +* var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); * * var searchElement = scalar2ndarray( 1.0, { * 'dtype': 'float64' diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js index be5eeac84687..8f9007ba4b20 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js @@ -44,10 +44,10 @@ var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); * @returns {integer} index * * @example -* var vector = require( '@stdlib/ndarray/vector/ctor' ); +* var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * -* var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); +* var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); * * var searchElement = scalar2ndarray( 1.0, { * 'dtype': 'float64' From c5432097da3efff50d4b0ec91a12bc5aea3dad2f Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:43:37 -0700 Subject: [PATCH 08/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../base/ndarray/dindex-of-not-equal/docs/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts index 5e07971338e2..137b6eb40966 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts @@ -36,10 +36,10 @@ import { float64ndarray, typedndarray } from '@stdlib/types/ndarray'; * @returns index * * @example -* var vector = require( '@stdlib/ndarray/vector/ctor' ); +* var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * -* var x = vector( [ 1.0, 1.0, 3.0 ], 'float64' ); +* var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); * * var searchElement = scalar2ndarray( 1.0, { * 'dtype': 'float64' From 5ebd89d2ec4de54506e5cabee215f1737cd32002 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:44:51 -0700 Subject: [PATCH 09/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js index 8f9007ba4b20..3338b3190a27 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js @@ -24,8 +24,8 @@ var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' ); var getStride = require( '@stdlib/ndarray/base/stride' ); var getOffset = require( '@stdlib/ndarray/base/offset' ); var getData = require( '@stdlib/ndarray/base/data-buffer' ); -var strided = require( '@stdlib/blas/ext/base/dindex-of-not-equal' ).ndarray; var ndarraylike2scalar = require( '@stdlib/ndarray/base/ndarraylike2scalar' ); +var strided = require( '@stdlib/blas/ext/base/dindex-of-not-equal' ).ndarray; // MAIN // From 5e6e7442db3ab5e051dd17f7dedda7ad5e7920d2 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:45:21 -0700 Subject: [PATCH 10/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json index 12fb5664a878..92d7919e9294 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/ext/base/ndarray/dindex-of-not-equal", "version": "0.0.0", - "description": "Return the first index of an element in a one-dimensional ndarray which is not equal to a specified search element.", + "description": "Return the first index of an element in a one-dimensional double-precision floating-point ndarray which is not equal to a specified search element.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From b86313bc7b25e01ee62397cb4931c7013c3d771c Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:45:47 -0700 Subject: [PATCH 11/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json index 92d7919e9294..8df975edf33f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json @@ -58,7 +58,7 @@ "array", "index", "search", - "get", + "find", "not equal", "unequal", "float64", From 22d5095cb7191fd2e8f928f9c0453a6cf1fdba8e Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:46:15 -0700 Subject: [PATCH 12/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json index 8df975edf33f..a722eb7d655f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/package.json @@ -59,7 +59,7 @@ "index", "search", "find", - "not equal", + "equal", "unequal", "float64", "ndarray" From 17a0400cfe3c6b71825f8378620839593a178a2a Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 21 Jul 2026 14:54:06 -0700 Subject: [PATCH 13/13] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../blas/ext/base/ndarray/dindex-of-not-equal/README.md | 4 ++-- .../blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt | 2 +- .../base/ndarray/dindex-of-not-equal/docs/types/index.d.ts | 2 +- .../blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js | 2 +- .../blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md index 6a9f796cd0ae..c65caf575761 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/README.md @@ -44,7 +44,7 @@ Returns the first index of an element in a one-dimensional double-precision floa var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); +var x = new Float64Vector( [ 1.0, 1.0, 3.0 ] ); var searchElement = scalar2ndarray( 1.0, { 'dtype': 'float64' @@ -67,7 +67,7 @@ If the function is unable to find an element which is not equal to a specified s var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); -var x = Float64Vector( [ 1.0, 1.0, 1.0 ] ); +var x = new Float64Vector( [ 1.0, 1.0, 1.0 ] ); var searchElement = scalar2ndarray( 1.0, { 'dtype': 'float64' diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt index 2cbbfc86bec4..c1b0cf95e56c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/repl.txt @@ -26,7 +26,7 @@ Examples -------- - > var x = {{alias:@stdlib/ndarray/vector/float64}}( [ 1.0, 1.0, 3.0 ] ); + > var x = new {{alias:@stdlib/ndarray/vector/float64}}( [ 1.0, 1.0, 3.0 ] ); > var v = {{alias:@stdlib/ndarray/from-scalar}}( 1.0, { 'dtype': 'float64' } ); > {{alias}}( [ x, v ] ) 2 diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts index 137b6eb40966..b8a73d6fc028 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/docs/types/index.d.ts @@ -39,7 +39,7 @@ import { float64ndarray, typedndarray } from '@stdlib/types/ndarray'; * var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * -* var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); +* var x = new Float64Vector( [ 1.0, 1.0, 3.0 ] ); * * var searchElement = scalar2ndarray( 1.0, { * 'dtype': 'float64' diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js index 565db15b4aed..0c1cba106c48 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/index.js @@ -28,7 +28,7 @@ * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * var dindexOfNotEqual = require( '@stdlib/blas/ext/base/ndarray/dindex-of-not-equal' ); * -* var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); +* var x = new Float64Vector( [ 1.0, 1.0, 3.0 ] ); * * var searchElement = scalar2ndarray( 1.0, { * 'dtype': 'float64' diff --git a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js index 3338b3190a27..ab4dae461cdb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/ndarray/dindex-of-not-equal/lib/main.js @@ -47,7 +47,7 @@ var strided = require( '@stdlib/blas/ext/base/dindex-of-not-equal' ).ndarray; * var Float64Vector = require( '@stdlib/ndarray/vector/float64' ); * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' ); * -* var x = Float64Vector( [ 1.0, 1.0, 3.0 ] ); +* var x = new Float64Vector( [ 1.0, 1.0, 3.0 ] ); * * var searchElement = scalar2ndarray( 1.0, { * 'dtype': 'float64'