From f609398b9500204cf2fc95d6fea15a159f8fa47e Mon Sep 17 00:00:00 2001
From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com>
Date: Wed, 6 Aug 2025 18:38:50 +0000
Subject: [PATCH] feat: add ndarray/base/nullary-strided1d-dispatch
---
.../base/nullary-strided1d-dispatch/README.md | 230 +++++++++++
.../benchmark/benchmark.assign.js | 124 ++++++
.../benchmark/benchmark.js | 100 +++++
.../nullary-strided1d-dispatch/docs/repl.txt | 106 +++++
.../docs/types/index.d.ts | 377 ++++++++++++++++++
.../docs/types/test.ts | 357 +++++++++++++++++
.../examples/index.js | 76 ++++
.../lib/defaults.json | 3 +
.../nullary-strided1d-dispatch/lib/index.js | 68 ++++
.../lib/index_of_types.js | 108 +++++
.../nullary-strided1d-dispatch/lib/main.js | 317 +++++++++++++++
.../lib/validate.js | 90 +++++
.../nullary-strided1d-dispatch/package.json | 64 +++
.../nullary-strided1d-dispatch/test/test.js | 35 ++
14 files changed, 2055 insertions(+)
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/README.md
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.assign.js
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.js
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/repl.txt
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/index.d.ts
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/test.ts
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/examples/index.js
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/defaults.json
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index.js
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index_of_types.js
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/main.js
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/validate.js
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/package.json
create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/test/test.js
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/README.md b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/README.md
new file mode 100644
index 000000000000..64a190885acc
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/README.md
@@ -0,0 +1,230 @@
+
+
+# NullaryStrided1dDispatch
+
+> Constructor for applying a strided function to an output ndarray.
+
+
+
+## Usage
+
+```javascript
+var NullaryStrided1dDispatch = require( '@stdlib/ndarray/base/nullary-strided1d-dispatch' );
+```
+
+#### NullaryStrided1dDispatch( table, odtypes, policies\[, options] )
+
+Returns an interface for applying a strided function to an output ndarray.
+
+```javascript
+var base = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+
+var table = {
+ 'default': base
+};
+
+var dtypes = [ 'float64', 'float32', 'generic' ];
+var policies = {
+ 'output': 'same',
+};
+
+var nullary = new NullaryStrided1dDispatch( table, [ dtypes ], policies );
+```
+
+The constructor has the following parameters:
+
+- **table**: strided function dispatch table. Must have the following properties:
+
+ - **default**: default strided function which should be invoked when provided ndarrays have data types which do not have a corresponding specialized implementation.
+
+ A dispatch table may have the following additional properties:
+
+ - **types**: one-dimensional list of ndarray data types describing specialized output ndarray argument signatures. Only the output ndarray argument data types should be specified. Additional ndarray argument data types should be omitted and are not considered during dispatch. The length of `types` must equal the number of strided functions specified by `fcns`.
+ - **fcns**: list of strided functions which are specific to specialized output ndarray argument signatures.
+
+- **odtypes**: list of supported output data types.
+
+- **policies**: dispatch policies. Must have the following properties:
+
+ - **output**: output data type [policy][@stdlib/ndarray/output-dtype-policies].
+
+- **options**: function options (_optional_).
+
+The constructor supports the following options:
+
+- **strictTraversalOrder**: boolean specifying whether the order of element traversal must match the memory layout order of an input ndarray. Default: `false`.
+
+#### NullaryStrided1dDispatch.prototype.assign( x\[, ...args]\[, options] )
+
+Applies a strided function and assigns results to a provided output ndarray.
+
+```javascript
+var base = require( '@stdlib/blas/ext/base/gsorthp' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+var dtypes = require( '@stdlib/ndarray/dtypes' );
+var ndarray = require( '@stdlib/ndarray/base/ctor' );
+
+var odt = dtypes( 'all' );
+var policies = {
+ 'output': 'same',
+};
+
+var table = {
+ 'default': base
+};
+var nullary = new NullaryStrided1dDispatch( table, [ odt ], policies );
+
+var xbuf = [ -1.0, 2.0, -3.0 ];
+var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+
+var o = scalar2ndarray( 1.0, {
+ 'dtype': 'generic'
+});
+
+var out = unary.assign( x, o );
+// returns
+
+var arr = ndarray2array( x );
+// returns [ -3.0, -1.0, 2.0 ]
+
+var bool = ( out === x );
+// returns true
+```
+
+The method has the following parameters:
+
+- **x**: output ndarray.
+- **args**: additional input ndarray arguments (_optional_).
+- **options**: function options (_optional_).
+
+The method accepts the following options:
+
+- **dims**: list of dimensions over which to perform an operation.
+
+
+
+
+
+
+
+## Notes
+
+- A strided function should have the following signature:
+
+ ```text
+ f( arrays )
+ ```
+
+ where
+
+ - **arrays**: array containing an an output ndarray, followed by any additional ndarray arguments.
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+```javascript
+var dsorthp = require( '@stdlib/blas/ext/base/ndarray/dsorthp' );
+var ssorthp = require( '@stdlib/blas/ext/base/ndarray/ssorthp' );
+var base = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var dtypes = require( '@stdlib/ndarray/dtypes' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var NullaryStrided1dDispatch = require( './../lib' );
+
+// Define the supported output data types:
+var odt = dtypes( 'all' );
+
+// Define dispatch policies:
+var policies = {
+ 'output': 'same'
+};
+
+// Define a dispatch table:
+var table = {
+ 'types': [
+ 'float64',
+ 'float32'
+ ],
+ 'fcns': [
+ dsorthp,
+ ssorthp
+ ],
+ 'default': base
+};
+
+// Create an interface for performing operation:
+var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+
+// Generate an array of random numbers:
+var xbuf = discreteUniform( 25, -10, 10, {
+ 'dtype': 'float64'
+});
+
+// Wrap in an ndarray:
+var x = new ndarray( 'float64', xbuf, [ 5, 5 ], [ 5, 1 ], 0, 'row-major' );
+console.log( ndarray2array( x ) );
+
+var o = scalar2ndarray( 1.0, {
+ 'dtype': 'generic'
+});
+
+// Perform operation:
+sorthp.assign( x, o, {
+ 'dims': [ 0 ]
+});
+
+// Print the results:
+console.log( ndarray2array( x ) );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[@stdlib/ndarray/output-dtype-policies]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/output-dtype-policies
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.assign.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.assign.js
new file mode 100644
index 000000000000..65f367fee591
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.assign.js
@@ -0,0 +1,124 @@
+/**
+* @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 isnan = require( '@stdlib/math/base/assert/is-nan' );
+var pow = require( '@stdlib/math/base/special/pow' );
+var dtypes = require( '@stdlib/array/dtypes' );
+var uniform = require( '@stdlib/random/array/uniform' );
+var zerosLike = require( '@stdlib/ndarray/zeros-like' );
+var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+var ndarray = require( '@stdlib/ndarray/base/ctor' );
+var gsorthp = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+var pkg = require( './../package.json' ).name;
+var NullaryStrided1dDispatch = require( './../lib' );
+
+
+// FUNCTIONS //
+
+/**
+* Creates a benchmark function.
+*
+* @private
+* @param {PositiveInteger} len - array length
+* @returns {Function} benchmark function
+*/
+function createBenchmark( len ) {
+ var policies;
+ var nullary;
+ var table;
+ var dt;
+ var x;
+ var o;
+
+ table = {
+ 'default': gsorthp
+ };
+ dt = dtypes( 'all' );
+ policies = {
+ 'output': 'same'
+ };
+ nullary = new NullaryStrided1dDispatch( table, [ dt ], policies );
+
+ x = uniform( len, -50.0, 50.0, {
+ 'dtype': 'float64'
+ });
+ x = new ndarray( 'float64', x, [ len ], [ 1 ], 0, 'row-major' );
+
+ o = scalar2ndarray( 1.0, {
+ 'dtype': 'generic'
+ });
+
+ return benchmark;
+
+ /**
+ * Benchmark function.
+ *
+ * @private
+ * @param {Benchmark} b - benchmark instance
+ */
+ function benchmark( b ) {
+ var o;
+ var i;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ o = nullary.assign( x, o );
+ if ( typeof o !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( isnan( o.get( i%len ) ) ) {
+ 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+':assign:len='+len, f );
+ }
+}
+
+main();
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.js
new file mode 100644
index 000000000000..a02557bb17af
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/benchmark/benchmark.js
@@ -0,0 +1,100 @@
+/**
+* @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 gsorthp = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+var pkg = require( './../package.json' ).name;
+var NullaryStrided1dDispatch = require( './../lib' );
+
+
+// MAIN //
+
+bench( pkg+'::new', function benchmark( b ) {
+ var policies;
+ var dtypes;
+ var table;
+ var v;
+ var i;
+
+ table = {
+ 'default': gsorthp
+ };
+ dtypes = [
+ 'float64',
+ 'float32',
+ 'generic'
+ ];
+ policies = {
+ 'output': 'same'
+ };
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = new NullaryStrided1dDispatch( table, [ dtypes ], policies );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !( v instanceof NullaryStrided1dDispatch ) ) {
+ b.fail( 'should return an instance' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::no_new', function benchmark( b ) {
+ var policies;
+ var dtypes;
+ var table;
+ var fcn;
+ var v;
+ var i;
+
+ table = {
+ 'default': gsorthp
+ };
+ dtypes = [
+ 'float64',
+ 'float32',
+ 'generic'
+ ];
+ policies = {
+ 'output': 'same'
+ };
+
+ fcn = NullaryStrided1dDispatch;
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = fcn( table, [ dtypes ], dtypes, policies );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !( v instanceof NullaryStrided1dDispatch ) ) {
+ b.fail( 'should return an instance' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/repl.txt
new file mode 100644
index 000000000000..dfca7960635d
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/repl.txt
@@ -0,0 +1,106 @@
+
+{{alias}}( table, odtypes, policies[, options] )
+ Returns an ndarray function interface for applying a strided function to an
+ output ndarray.
+
+ Parameters
+ ----------
+ table: Object
+ Dispatch table containing strided functions. The table object must have
+ the following property:
+
+ - default: default strided function to invoke when provided ndarrays
+ have data types which do not have a corresponding specialized
+ implementation.
+
+ The table may having the following additional properties:
+
+ - types: one-dimensional list of ndarray data types describing
+ specialized output ndarray argument signatures.
+ - fcns: list of strided functions which are specific to specialized
+ output ndarray argument signatures.
+
+ A strided function should have the following signature:
+
+ f( arrays )
+
+ where
+
+ - arrays: array containing an output ndarray, followed by any additional
+ ndarray arguments.
+
+ odtypes: Array>
+ List containing lists of supported output array data types for each
+ output ndarray argument.
+
+ policies: Object
+ Dispatch policies. Must have the following properties:
+
+ - output: output data type policy.
+
+ options: Object (optional)
+ Function options.
+
+ options.strictTraversalOrder: boolean (optional)
+ Boolean specifying whether the order of element traversal must match the
+ memory layout order of an input ndarray.
+
+ Returns
+ -------
+ out: Object
+ Instance having methods for applying a strided function.
+
+ Examples
+ --------
+ > var dts = [ 'float64', 'float32', 'generic' ];
+ > var p = { 'output': 'same' };
+ > var t = { 'default': {{alias:@stdlib/blas/ext/base/ndarray/gsorthp}} };
+ > var out = new {{alias}}( t, [ dts ], p );
+
+{{alias}}.prototype.assign( x[, ...args][, options] )
+ Applies a strided function and assigns results to a provided output ndarray.
+
+ Parameters
+ ----------
+ x: ndarray
+ Output array.
+
+ args: ...ndarray (optional)
+ Additional ndarray arguments.
+
+ options: Object (optional)
+ Function options.
+
+ options.dims: Array (optional)
+ List of dimensions over which to perform operation. If not provided, the
+ function performs the operation over all elements in a provided input
+ ndarray.
+
+ Returns
+ -------
+ out: ndarray
+ Output array.
+
+ Examples
+ --------
+ > var dts = [ 'float64', 'float32', 'generic' ];
+ > var p = { 'output': 'same' };
+ > var t = { 'default': {{alias:@stdlib/blas/ext/base/gsorthp}} };
+ > var f = new {{alias}}( t, [ dts ], p );
+ > var buf = [ -1.0, 2.0, -3.0, -4.0 ];
+ > var dt = 'generic';
+ > var sh = [ buf.length ];
+ > var sx = [ 1 ];
+ > var ox = 0;
+ > var ord = 'row-major';
+ > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, buf, sh, sx, ox, ord );
+ > var o = {{alias:@stdlib/ndarray/from-scalar}}( 1.0 );
+ > var out = f.assign( x, o )
+
+ > var bool = ( out === x )
+ true
+ > {{alias:@stdlib/ndarray/to-array}}( x )
+ [ -4.0, -3.0, -1.0, 2.0 ]
+
+ See Also
+ --------
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/index.d.ts
new file mode 100644
index 000000000000..85aa52f1b02c
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/index.d.ts
@@ -0,0 +1,377 @@
+/*
+* @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 { ArrayLike } from '@stdlib/types/array';
+import { OutputPolicy, DataType, typedndarray } from '@stdlib/types/ndarray';
+
+/**
+* Output array.
+*/
+type OutputArray = typedndarray;
+
+/**
+* Input array.
+*/
+type InputArray = typedndarray;
+
+/**
+* Interface defining "base" options.
+*/
+interface BaseOptions {
+ /**
+ * List of dimensions over which to perform an operation.
+ */
+ dims?: ArrayLike;
+}
+
+/**
+* Interface defining constructor options.
+*/
+interface ConstructorOptions {
+ /**
+ * Boolean specifying whether the order of element traversal must match the memory layout of an input ndarray.
+ */
+ strictTraversalOrder?: boolean;
+}
+
+/**
+* Strided function.
+*
+* @param arrays - output ndarray
+* @param options - function options
+* @returns result
+*/
+type Nullary = ( arrays: [ typedndarray ], options?: unknown ) => typedndarray;
+
+/**
+* Strided function.
+*
+* @param arrays - output ndarrays
+* @param options - function options
+* @returns result
+*/
+type NullaryWithAdditionalArrays = ( arrays: [ typedndarray, ...Array> ], options?: unknown ) => typedndarray;
+
+/**
+* Base dispatch table.
+*/
+interface BaseDispatchTable {
+ /**
+ * Default strided function.
+ */
+ default: Nullary | NullaryWithAdditionalArrays;
+}
+
+/**
+* Dispatch table.
+*/
+interface DispatchTable extends BaseDispatchTable {
+ /**
+ * One-dimensional list of ndarray data types describing specialized output ndarray argument signatures.
+ */
+ types: ArrayLike;
+
+ /**
+ * List of strided functions which are specific to specialized output ndarray argument signatures.
+ */
+ fcns: ArrayLike | NullaryWithAdditionalArrays>;
+}
+
+/**
+* Dispatch policies.
+*/
+interface Policies {
+ /**
+ * Output data type policy.
+ */
+ output: OutputPolicy;
+}
+
+/**
+* Class for applying a strided function to an output ndarray.
+*/
+declare class NullaryStrided1dDispatch {
+ /**
+ * Constructor for applying a strided function to an output ndarray.
+ *
+ * @param table - dispatch table
+ * @param odtypes - list containing lists of supported output data types for each ndarray argument
+ * @param policies - dispatch policies
+ * @param options - function options
+ * @returns instance
+ *
+ * @example
+ * var base = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+ * var dtypes = require( '@stdlib/ndarray/dtypes' );
+ * var ndarray2array = require( '@stdlib/ndarray/to-array' );
+ * var ndarray = require( '@stdlib/ndarray/base/ctor' );
+ *
+ * var odt = dtypes( 'all' );
+ * var policies = {
+ * 'output': 'same'
+ * };
+ *
+ * var table = {
+ * 'default': base
+ * };
+ * var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+ *
+ * var xbuf = [ -1.0, 2.0, -3.0 ];
+ * var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+ *
+ * var o = scalar2ndarray( 1.0, {
+ * 'dtype': 'generic'
+ * });
+ *
+ * var out = sorthp.assign( x, o );
+ * // returns
+ *
+ * var arr = ndarray2array( x );
+ * // returns [ -3.0, -1.0, 2.0 ]
+ *
+ * var bool = ( out === x );
+ * // returns true
+ */
+ constructor( table: DispatchTable | BaseDispatchTable, odtypes: ArrayLike>, policies: Policies, options?: ConstructorOptions );
+
+ /**
+ * Applies a strided function and assigns results to a provided output ndarray.
+ *
+ * @param x - output ndarray
+ * @param options - function options
+ * @returns output ndarray
+ *
+ * @example
+ * var base = require( '@stdlib/blas/ext/base/ndarray/sorthp' );
+ * var dtypes = require( '@stdlib/ndarray/dtypes' );
+ * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+ * var ndarray2array = require( '@stdlib/ndarray/to-array' );
+ * var ndarray = require( '@stdlib/ndarray/base/ctor' );
+ *
+ * var odt = dtypes( 'all' );
+ * var policies = {
+ * 'output': 'same'
+ * };
+ *
+ * var table = {
+ * 'default': base
+ * };
+ * var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+ *
+ * var xbuf = [ -1.0, 2.0, -3.0 ];
+ * var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+ *
+ * var o = scalar2ndarray( 1.0, {
+ * 'dtype': 'generic'
+ * });
+ *
+ * var out = sorthp.assign( x, o );
+ * // returns
+ *
+ * var arr = ndarray2array( x );
+ * // returns [ -3.0, -1.0, 2.0 ]
+ *
+ * var bool = ( out === x );
+ * // returns true
+ */
+ assign = OutputArray>( x: U, options?: BaseOptions ): U;
+
+ /**
+ * Applies a strided function and assigns results to a provided output ndarray.
+ *
+ * @param x - output ndarray
+ * @param o - additional ndarray argument
+ * @param args - output ndarray, additional ndarray arguments, and function options
+ * @returns output ndarray
+ *
+ * @example
+ * var base = require( '@stdlib/blas/ext/base/ndarray/sorthp' );
+ * var dtypes = require( '@stdlib/ndarray/dtypes' );
+ * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+ * var ndarray2array = require( '@stdlib/ndarray/to-array' );
+ * var ndarray = require( '@stdlib/ndarray/base/ctor' );
+ *
+ * var odt = dtypes( 'all' );
+ * var policies = {
+ * 'output': 'same'
+ * };
+ *
+ * var table = {
+ * 'default': base
+ * };
+ * var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+ *
+ * var xbuf = [ -1.0, 2.0, -3.0 ];
+ * var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+ *
+ * var o = scalar2ndarray( 1.0, {
+ * 'dtype': 'generic'
+ * });
+ *
+ * var out = sorthp.assign( x, o );
+ * // returns
+ *
+ * var arr = ndarray2array( x );
+ * // returns [ -3.0, -1.0, 2.0 ]
+ *
+ * var bool = ( out === x );
+ * // returns true
+ */
+ assign = OutputArray, V = unknown>( x: U, y: InputArray | U, ...args: Array | U | BaseOptions> ): U;
+}
+
+/**
+* Interface defining a constructor which is both "newable" and "callable".
+*/
+interface NullaryStrided1dDispatchConstructor {
+ /**
+ * Constructor for applying a strided function to an output ndarray.
+ *
+ * @param table - dispatch table
+ * @param odtypes - list containing lists of supported output data types for each ndarray argument
+ * @param policies - dispatch policies
+ * @param options - function options
+ * @returns instance
+ *
+ * @example
+ * var base = require( '@stdlib/blas/ext/base/ndarray/sorthp' );
+ * var dtypes = require( '@stdlib/ndarray/dtypes' );
+ * var ndarray2array = require( '@stdlib/ndarray/to-array' );
+ * var ndarray = require( '@stdlib/ndarray/base/ctor' );
+ *
+ * var odt = dtypes( 'all' );
+ * var policies = {
+ * 'output': 'same'
+ * };
+ *
+ * var table = {
+ * 'default': base
+ * };
+ * var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+ *
+ * var xbuf = [ -1.0, 2.0, -3.0 ];
+ * var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+ *
+ * var o = scalar2ndarray( 1.0, {
+ * 'dtype': 'generic'
+ * });
+ *
+ * var out = sorthp.assign( x, o );
+ * // returns
+ *
+ * var arr = ndarray2array( x );
+ * // returns [ -3.0, -1.0, 2.0 ]
+ *
+ * var bool = ( out === x );
+ * // returns true
+ */
+ new( table: DispatchTable | BaseDispatchTable, odtypes: ArrayLike>, policies: Policies, options?: ConstructorOptions ): NullaryStrided1dDispatch;
+
+ /**
+ * Constructor for applying a strided function to an output ndarray.
+ *
+ * @param table - dispatch table
+ * @param odtypes - list containing lists of supported output data types for each ndarray argument
+ * @param policies - dispatch policies
+ * @param options - function options
+ * @returns instance
+ *
+ * @example
+ * var base = require( '@stdlib/blas/ext/base/ndarray/sorthp' );
+ * var dtypes = require( '@stdlib/ndarray/dtypes' );
+ * var ndarray2array = require( '@stdlib/ndarray/to-array' );
+ * var ndarray = require( '@stdlib/ndarray/base/ctor' );
+ *
+ * var odt = dtypes( 'all' );
+ * var policies = {
+ * 'output': 'same'
+ * };
+ *
+ * var table = {
+ * 'default': base
+ * };
+ * var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+ *
+ * var xbuf = [ -1.0, 2.0, -3.0 ];
+ * var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+ *
+ * var o = scalar2ndarray( 1.0, {
+ * 'dtype': 'generic'
+ * });
+ *
+ * var out = sorthp.assign( x );
+ * // returns
+ *
+ * var arr = ndarray2array( x );
+ * // returns [ -3.0, -1.0, 2.0 ]
+ *
+ * var bool = ( out === x );
+ * // returns true
+ */
+ ( table: DispatchTable | BaseDispatchTable, odtypes: ArrayLike>, policies: Policies, options?: ConstructorOptions ): NullaryStrided1dDispatch;
+}
+
+/**
+* Constructor for applying a strided function to an output ndarray.
+*
+* @param table - dispatch table
+* @param odtypes - list containing lists of supported input data types for each ndarray argument
+* @param policies - dispatch policies
+* @param options - function options
+* @returns instance
+*
+* @example
+* var base = require( '@stdlib/blas/ext/base/ndarray/sorthp' );
+* var dtypes = require( '@stdlib/ndarray/dtypes' );
+* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+* var ndarray = require( '@stdlib/ndarray/base/ctor' );
+*
+* var odt = dtypes( 'all' );
+* var policies = {
+* 'output': 'same'
+* };
+*
+* var table = {
+* 'default': base
+* };
+* var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+*
+* var xbuf = [ -1.0, 2.0, -3.0 ];
+* var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+*
+* var o = scalar2ndarray( 1.0, {
+* 'dtype': 'generic'
+* });
+*
+* var y = sorthp.assign( x, o );
+* // returns
+*
+* var arr = ndarray2array( y );
+* // returns [ -1.0, 2.0, 2.0 ]
+*/
+declare var ctor: NullaryStrided1dDispatchConstructor;
+
+
+// EXPORTS //
+
+export = ctor;
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/test.ts
new file mode 100644
index 000000000000..451a91706e65
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/docs/types/test.ts
@@ -0,0 +1,357 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/* eslint-disable @typescript-eslint/no-unused-expressions, space-in-parens */
+
+///
+
+import { DataType, OutputPolicy } from '@stdlib/types/ndarray';
+import gsorthp = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+import zeros = require( '@stdlib/ndarray/zeros' );
+import NullaryStrided1dDispatch = require( './index' );
+
+
+// TESTS //
+
+// The function returns an instance for applying a nullary function...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies ); // $ExpectType NullaryStrided1dDispatch
+
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, {} ); // $ExpectType NullaryStrided1dDispatch
+
+ const nullary = NullaryStrided1dDispatch;
+ nullary( table, [ dtypes ], policies ); // $ExpectType NullaryStrided1dDispatch
+ nullary( table, [ dtypes ], policies, {} ); // $ExpectType NullaryStrided1dDispatch
+}
+
+// The compiler throws an error if the function is provided a first argument which is not a dispatch table...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+
+ new NullaryStrided1dDispatch( '5', [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( 5, [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( true, [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( false, [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( null, [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( void 0, [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( 'abc', [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( [], [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( {}, [ dtypes ], policies ); // $ExpectError
+ new NullaryStrided1dDispatch( ( x: number, y: number ): number => x + y, [ dtypes ], policies ); // $ExpectError
+
+ new NullaryStrided1dDispatch( '5', [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( 5, [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( true, [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( false, [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( null, [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( void 0, [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( 'abc', [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( [], [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( {}, [ dtypes ], policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( ( x: number, y: number ): number => x + y, [ dtypes ], policies, {} ); // $ExpectError
+
+ const nullary = NullaryStrided1dDispatch;
+ nullary( '5', [ dtypes ], policies ); // $ExpectError
+ nullary( 5, [ dtypes ], policies ); // $ExpectError
+ nullary( true, [ dtypes ], policies ); // $ExpectError
+ nullary( false, [ dtypes ], policies ); // $ExpectError
+ nullary( null, [ dtypes ], policies ); // $ExpectError
+ nullary( void 0, [ dtypes ], policies ); // $ExpectError
+ nullary( 'abc', [ dtypes ], policies ); // $ExpectError
+ nullary( [], [ dtypes ], policies ); // $ExpectError
+ nullary( {}, [ dtypes ], policies ); // $ExpectError
+ nullary( ( x: number, y: number ): number => x + y, [ dtypes ], policies ); // $ExpectError
+
+ nullary( '5', [ dtypes ], policies, {} ); // $ExpectError
+ nullary( 5, [ dtypes ], policies, {} ); // $ExpectError
+ nullary( true, [ dtypes ], policies, {} ); // $ExpectError
+ nullary( false, [ dtypes ], policies, {} ); // $ExpectError
+ nullary( null, [ dtypes ], policies, {} ); // $ExpectError
+ nullary( void 0, [ dtypes ], policies, {} ); // $ExpectError
+ nullary( 'abc', [ dtypes ], policies, {} ); // $ExpectError
+ nullary( [], [ dtypes ], policies, {} ); // $ExpectError
+ nullary( {}, [ dtypes ], policies, {} ); // $ExpectError
+ nullary( ( x: number, y: number ): number => x + y, [ dtypes ], policies, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a a list of data type lists...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+
+ new NullaryStrided1dDispatch( table, '5', policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, 5, policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, true, policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, false, policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, null, policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, void 0, policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, 'abc', policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, {}, policies ); // $ExpectError
+ new NullaryStrided1dDispatch( table, ( x: number ): number => x, policies ); // $ExpectError
+
+ new NullaryStrided1dDispatch( table, '5', policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, 5, policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, true, policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, false, policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, null, policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, void 0, policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, 'abc', policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, {}, policies, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, ( x: number ): number => x, policies, {} ); // $ExpectError
+
+ const nullary = NullaryStrided1dDispatch;
+ nullary( table, '5', policies ); // $ExpectError
+ nullary( table, 5, policies ); // $ExpectError
+ nullary( table, true, policies ); // $ExpectError
+ nullary( table, false, policies ); // $ExpectError
+ nullary( table, null, policies ); // $ExpectError
+ nullary( table, void 0, policies ); // $ExpectError
+ nullary( table, 'abc', policies ); // $ExpectError
+ nullary( table, {}, policies ); // $ExpectError
+ nullary( table, ( x: number ): number => x, policies ); // $ExpectError
+
+ nullary( table, '5', policies, {} ); // $ExpectError
+ nullary( table, 5, policies, {} ); // $ExpectError
+ nullary( table, true, policies, {} ); // $ExpectError
+ nullary( table, false, policies, {} ); // $ExpectError
+ nullary( table, null, policies, {} ); // $ExpectError
+ nullary( table, void 0, policies, {} ); // $ExpectError
+ nullary( table, 'abc', policies, {} ); // $ExpectError
+ nullary( table, {}, policies, {} ); // $ExpectError
+ nullary( table, ( x: number ): number => x, policies, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not valid policy object...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+
+ new NullaryStrided1dDispatch( table, [ dtypes ], '5' ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], 5 ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], true ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], false ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], null ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], void 0 ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], 'abc' ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], ( x: number ): number => x ); // $ExpectError
+
+ new NullaryStrided1dDispatch( table, [ dtypes ], '5', {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], 5, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], true, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], false, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], null, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], void 0, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], 'abc', {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], {}, {} ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], ( x: number ): number => x, {} ); // $ExpectError
+
+ const nullary = NullaryStrided1dDispatch;
+ nullary( table, [ dtypes ], '5' ); // $ExpectError
+ nullary( table, [ dtypes ], 5 ); // $ExpectError
+ nullary( table, [ dtypes ], true ); // $ExpectError
+ nullary( table, [ dtypes ], false ); // $ExpectError
+ nullary( table, [ dtypes ], null ); // $ExpectError
+ nullary( table, [ dtypes ], void 0 ); // $ExpectError
+ nullary( table, [ dtypes ], 'abc' ); // $ExpectError
+ nullary( table, [ dtypes ], {} ); // $ExpectError
+ nullary( table, [ dtypes ], ( x: number ): number => x ); // $ExpectError
+
+ nullary( table, [ dtypes ], '5', {} ); // $ExpectError
+ nullary( table, [ dtypes ], 5, {} ); // $ExpectError
+ nullary( table, [ dtypes ], true, {} ); // $ExpectError
+ nullary( table, [ dtypes ], false, {} ); // $ExpectError
+ nullary( table, [ dtypes ], null, {} ); // $ExpectError
+ nullary( table, [ dtypes ], void 0, {} ); // $ExpectError
+ nullary( table, [ dtypes ], 'abc', {} ); // $ExpectError
+ nullary( table, [ dtypes ], {}, {} ); // $ExpectError
+ nullary( table, [ dtypes ], ( x: number ): number => x, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a fifth argument which is an object...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, '5' ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, 5 ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, true ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, false ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, null ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, 'abc' ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, ( x: number ): number => x ); // $ExpectError
+
+ const nullary = NullaryStrided1dDispatch;
+ nullary( table, [ dtypes ], policies, '5' ); // $ExpectError
+ nullary( table, [ dtypes ], policies, 5 ); // $ExpectError
+ nullary( table, [ dtypes ], policies, true ); // $ExpectError
+ nullary( table, [ dtypes ], policies, false ); // $ExpectError
+ nullary( table, [ dtypes ], policies, null ); // $ExpectError
+ nullary( table, [ dtypes ], policies, 'abc' ); // $ExpectError
+ nullary( table, [ dtypes ], policies, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+
+ new NullaryStrided1dDispatch(); // $ExpectError
+ new NullaryStrided1dDispatch( table ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ] ); // $ExpectError
+ new NullaryStrided1dDispatch( table, [ dtypes ], policies, {}, {} ); // $ExpectError
+
+ const nullary = NullaryStrided1dDispatch;
+ nullary(); // $ExpectError
+ nullary( table ); // $ExpectError
+ nullary( table, [ dtypes ] ); // $ExpectError
+ nullary( table, [ dtypes ], policies, {}, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a first argument which is not an ndarray...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+ const x = zeros( [ 2, 2 ], {
+ 'dtype': 'float64'
+ });
+
+ const f1 = new NullaryStrided1dDispatch( table, [ dtypes ], policies );
+ f1.assign( '5', x ); // $ExpectError
+ f1.assign( 5, x ); // $ExpectError
+ f1.assign( true, x ); // $ExpectError
+ f1.assign( false, x ); // $ExpectError
+ f1.assign( null, x ); // $ExpectError
+ f1.assign( void 0, x ); // $ExpectError
+ f1.assign( {}, x ); // $ExpectError
+ f1.assign( ( x: number ): number => x, x ); // $ExpectError
+
+ f1.assign( '5', x, {} ); // $ExpectError
+ f1.assign( 5, x, {} ); // $ExpectError
+ f1.assign( true, x, {} ); // $ExpectError
+ f1.assign( false, x, {} ); // $ExpectError
+ f1.assign( null, x, {} ); // $ExpectError
+ f1.assign( void 0, x, {} ); // $ExpectError
+ f1.assign( {}, x, {} ); // $ExpectError
+ f1.assign( ( x: number ): number => x, x, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided a second argument which is not an ndarray...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+ const x = zeros( [ 2, 2 ], {
+ 'dtype': 'float64'
+ });
+
+ const f1 = new NullaryStrided1dDispatch( table, [ dtypes ], policies );
+ f1.assign( x, '5' ); // $ExpectError
+ f1.assign( x, 5 ); // $ExpectError
+ f1.assign( x, true ); // $ExpectError
+ f1.assign( x, false ); // $ExpectError
+ f1.assign( x, null ); // $ExpectError
+ f1.assign( x, void 0 ); // $ExpectError
+ f1.assign( x, ( x: number ): number => x ); // $ExpectError
+
+ f1.assign( x, '5', {} ); // $ExpectError
+ f1.assign( x, 5, {} ); // $ExpectError
+ f1.assign( x, true, {} ); // $ExpectError
+ f1.assign( x, false, {} ); // $ExpectError
+ f1.assign( x, null, {} ); // $ExpectError
+ f1.assign( x, void 0, {} ); // $ExpectError
+ f1.assign( x, ( x: number ): number => x, {} ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided an invalid `dims` option...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+ const x = zeros( [ 2, 2 ], {
+ 'dtype': 'float64'
+ });
+
+ const f1 = new NullaryStrided1dDispatch( table, [ dtypes ], policies );
+ f1.assign( x, x, { 'dims': '5' } ); // $ExpectError
+ f1.assign( x, x, { 'dims': 5 } ); // $ExpectError
+ f1.assign( x, x, { 'dims': true } ); // $ExpectError
+ f1.assign( x, x, { 'dims': false } ); // $ExpectError
+ f1.assign( x, x, { 'dims': null } ); // $ExpectError
+ f1.assign( x, x, { 'dims': {} } ); // $ExpectError
+ f1.assign( x, x, { 'dims': ( x: number ): number => x } ); // $ExpectError
+}
+
+// The compiler throws an error if the `assign` method is provided an unsupported number of arguments...
+{
+ const dtypes: Array = [ 'float64', 'float32', 'generic' ];
+ const table = {
+ 'default': gsorthp
+ };
+ const policies = {
+ 'output': 'same' as OutputPolicy
+ };
+ const x = zeros( [ 2, 2 ], {
+ 'dtype': 'float64'
+ });
+
+ const f1 = new NullaryStrided1dDispatch( table, [ dtypes ], policies );
+ f1.assign(); // $ExpectError
+ f1.assign( x ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/examples/index.js
new file mode 100644
index 000000000000..2347f1c5b567
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/examples/index.js
@@ -0,0 +1,76 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/* eslint-disable array-element-newline */
+
+'use strict';
+
+var dsorthp = require( '@stdlib/blas/ext/base/ndarray/dsorthp' );
+var ssorthp = require( '@stdlib/blas/ext/base/ndarray/ssorthp' );
+var base = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
+var dtypes = require( '@stdlib/ndarray/dtypes' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var NullaryStrided1dDispatch = require( './../lib' );
+
+// Define the supported output data types:
+var odt = dtypes( 'all' );
+
+// Define dispatch policies:
+var policies = {
+ 'output': 'same'
+};
+
+// Define a dispatch table:
+var table = {
+ 'types': [
+ 'float64',
+ 'float32'
+ ],
+ 'fcns': [
+ dsorthp,
+ ssorthp
+ ],
+ 'default': base
+};
+
+// Create an interface for performing operation:
+var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+
+// Generate an array of random numbers:
+var xbuf = discreteUniform( 25, -10, 10, {
+ 'dtype': 'float64'
+});
+
+// Wrap in an ndarray:
+var x = new ndarray( 'float64', xbuf, [ 5, 5 ], [ 5, 1 ], 0, 'row-major' );
+console.log( ndarray2array( x ) );
+
+var o = scalar2ndarray( 1.0, {
+ 'dtype': 'generic'
+});
+
+// Perform operation:
+sorthp.assign( x, o, {
+ 'dims': [ 0 ]
+});
+
+// Print the results:
+console.log( ndarray2array( x ) );
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/defaults.json b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/defaults.json
new file mode 100644
index 000000000000..d8cc9c72ad33
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/defaults.json
@@ -0,0 +1,3 @@
+{
+ "dims": null
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index.js
new file mode 100644
index 000000000000..d7169baaf70d
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index.js
@@ -0,0 +1,68 @@
+/**
+* @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';
+
+/**
+* Constructor for applying a strided function to an output ndarray.
+*
+* @module @stdlib/ndarray/base/nullary-strided1d-dispatch
+*
+* @example
+* var base = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+* var dtypes = require( '@stdlib/ndarray/dtypes' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+* var ndarray = require( '@stdlib/ndarray/base/ctor' );
+* var NullaryStrided1dDispatch = require( '@stdlib/ndarray/base/nullary-strided1d-dispatch' );
+*
+* var odt = dtypes( 'all' );
+* var policies = {
+* 'output': 'same'
+* };
+*
+* var table = {
+* 'default': base
+* };
+* var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+*
+* var xbuf = [ -1.0, 2.0, -3.0 ];
+* var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+*
+* var o = scalar2ndarray( 1.0, {
+* 'dtype': 'generic'
+* });
+*
+* var out = sorthp.apply( x );
+* // returns
+*
+* var arr = ndarray2array( x );
+* // returns [ -3.0, -1.0, 2.0 ]
+*
+* var bool = ( out === x );
+* // returns true
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index_of_types.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index_of_types.js
new file mode 100644
index 000000000000..428c5551ce81
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/index_of_types.js
@@ -0,0 +1,108 @@
+/**
+* @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';
+
+// MAIN //
+
+/**
+* Returns the first row index at which a given one-dimensional array of types can be found in a two-dimensional reference array of types (or `-1` if not found).
+*
+* ## Notes
+*
+* - The intended use case for this function is for type dispatch (i.e., given a set of array data types, find a matching interface according the interface's accepted array data types).
+* - The function assumes that `x` is stored in row-major order.
+* - The function assumes that the number of indexed elements in `y` equals the number of columns in `x`.
+* - The function returns a row index. To convert to a linear index, multiply `strideX1` by the return value.
+*
+* @private
+* @param {NonNegativeInteger} N - number of rows in `x` (size of first dimension)
+* @param {NonNegativeInteger} M - number of columns in `x` (size of second dimension)
+* @param {ArrayLikeObject} x - input two-dimensional reference array
+* @param {integer} strideX1 - `x` stride length along first dimension
+* @param {integer} strideX2 - `x` stride length along second dimension
+* @param {NonNegativeInteger} offsetX - `x` starting index
+* @param {ArrayLikeObject} y - search array
+* @param {integer} strideY - `y` stride length
+* @param {NonNegativeInteger} offsetY - `y` starting index
+* @returns {integer} row index (if found) and `-1` otherwise
+*
+* @example
+* // Define a reference array to search:
+* var types = [
+* 'float64', 'float64', 'float64',
+* 'float32', 'float32', 'float32',
+* 'uint32', 'uint32', 'float64',
+* 'int32', 'int32', 'float64',
+* 'uint16', 'uint16', 'float64',
+* 'int16', 'int16', 'float64',
+* 'uint8', 'uint8', 'float64',
+* 'int8', 'int8', 'float64'
+* ];
+*
+* // Define reference array dimensions:
+* var N = 8; // rows
+* var M = 3; // columns
+*
+* // Define a search array:
+* y1 = [
+* 'float32', 'float32', 'float32',
+* ];
+*
+* // Find the list of types:
+* var r1 = indexOfTypes( N, M, types, M, 1, 0, y1, 1, 0 );
+* // returns 1
+*
+// Define a search array:
+* y2 = [
+* 'float32', 'float32', 'float64',
+* ];
+*
+* // Find the list of types:
+* var r2 = indexOfTypes( N, M, types, M, 1, 0, y2, 1, 0 );
+* // returns -1
+*/
+function indexOfTypes( N, M, x, strideX1, strideX2, offsetX, y, strideY, offsetY ) { // eslint-disable-line max-len
+ var ix;
+ var iy;
+ var i;
+ var j;
+
+ // Search for the first row which matches `y`...
+ ix = offsetX;
+ for ( i = 0; i < N; i++ ) {
+ iy = offsetY;
+ for ( j = 0; j < M; j++ ) {
+ if ( x[ ix+(j*strideX2) ] !== y[ iy ] ) {
+ break;
+ }
+ iy += strideY;
+ }
+ // If we successfully iterated over all columns, then that means we've found a match...
+ if ( j === M ) {
+ return i;
+ }
+ ix += strideX1;
+ }
+ return -1;
+}
+
+
+// EXPORTS //
+
+module.exports = indexOfTypes;
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/main.js
new file mode 100644
index 000000000000..f486c94f4843
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/main.js
@@ -0,0 +1,317 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/* eslint-disable no-restricted-syntax, no-invalid-this */
+
+'use strict';
+
+// MODULES //
+
+var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
+var hasProp = require( '@stdlib/assert/has-property' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var isObject = require( '@stdlib/assert/is-object' );
+var isFunction = require( '@stdlib/assert/is-function' );
+var isCollection = require( '@stdlib/assert/is-collection' );
+var isEmptyCollection = require( '@stdlib/assert/is-empty-collection' );
+var isFunctionArray = require( '@stdlib/assert/is-function-array' );
+var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' );
+var isOutputDataTypePolicy = require( '@stdlib/ndarray/base/assert/is-output-data-type-policy' );
+var contains = require( '@stdlib/array/base/assert/contains' );
+var nullaryStrided1d = require( '@stdlib/ndarray/base/nullary-strided1d' );
+var resolveEnum = require( '@stdlib/ndarray/base/dtype-resolve-enum' );
+var ndims = require( '@stdlib/ndarray/ndims' );
+var getDType = require( '@stdlib/ndarray/base/dtype' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var join = require( '@stdlib/array/base/join' );
+var copy = require( '@stdlib/array/base/copy' );
+var everyBy = require( '@stdlib/array/base/every-by' );
+var objectAssign = require( '@stdlib/object/assign' );
+var format = require( '@stdlib/string/format' );
+var defaults = require( './defaults.json' );
+var validate = require( './validate.js' );
+var indexOfTypes = require( './index_of_types.js' );
+
+
+// FUNCTIONS //
+
+/**
+* Returns a list of data type enumeration constants.
+*
+* @private
+* @param {Collection} types - list of types
+* @returns {IntegerArray} list of data type enumeration constants
+*/
+function types2enums( types ) {
+ var out;
+ var i;
+
+ out = [];
+ for ( i = 0; i < types.length; i++ ) {
+ out.push( resolveEnum( types[ i ] ) ); // note: we're assuming that `types[i]` is a known data type; otherwise, the resolved enum will be `null`
+ }
+ return out;
+}
+
+
+// MAIN //
+
+/**
+* Constructor for applying a strided function to an output ndarray.
+*
+* @constructor
+* @param {Object} table - dispatch table
+* @param {Function} table.default - default strided function
+* @param {StringArray} [table.types=[]] - one-dimensional list of ndarray data types describing specialized output ndarray argument signatures
+* @param {ArrayLikeObject} [table.fcns=[]] - list of strided functions which are specific to specialized output ndarray argument signatures
+* @param {ArrayLikeObject} odtypes - list containing lists of supported output data types for each ndarray argument
+* @param {Object} policies - policies
+* @param {string} policies.output - output data type policy
+* @param {Options} [options] - function options
+* @param {boolean} [options.strictTraversalOrder=false] - boolean specifying whether to require that element traversal match the memory layout of an output ndarray
+* @throws {TypeError} first argument must be an object having valid properties
+* @throws {Error} first argument must be an object having valid properties
+* @throws {TypeError} second argument must be an array containing arrays of supported data types
+* @throws {TypeError} fourth argument must be an object having supported policies
+* @throws {TypeError} options argument must be an object
+* @throws {TypeError} must provide valid options
+* @returns {NullaryStrided1dDispatch} instance
+*
+* @example
+* var base = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+* var dtypes = require( '@stdlib/ndarray/dtypes' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+* var ndarray = require( '@stdlib/ndarray/base/ctor' );
+*
+* var odt = dtypes( 'all' );
+* var policies = {
+* 'output': 'same'
+* };
+*
+* var table = {
+* 'default': base
+* };
+* var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+*
+* var xbuf = [ -1.0, 2.0, -3.0 ];
+* var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+*
+* var o = scalar2ndarray( 1.0, {
+* 'dtype': 'generic'
+* });
+*
+* sorthp.apply( x, o );
+*
+* var arr = ndarray2array( x );
+* // returns [ -3.0, -1.0, 2.0 ]
+*/
+function NullaryStrided1dDispatch( table, odtypes, policies, options ) {
+ var dt;
+ var i;
+ if ( !( this instanceof NullaryStrided1dDispatch ) ) {
+ if ( arguments.length > 3 ) {
+ return new NullaryStrided1dDispatch( table, odtypes, policies, options ); // eslint-disable-line max-len
+ }
+ return new NullaryStrided1dDispatch( table, odtypes, policies );
+ }
+ if ( !isObject( table ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', table ) );
+ }
+ if ( !isFunction( table.default ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an object having a "default" property and an associated method.' ) );
+ }
+ if ( hasProp( table, 'types' ) && !isCollection( table.types ) && !isEmptyCollection( table.types ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an object having a "types" property whose associated value is an array-like object.' ) );
+ }
+ if ( hasProp( table, 'fcns' ) && !isFunctionArray( table.fcns ) && !isEmptyCollection( table.fcns ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an object having a "fcns" property whose associated value is an array-like object containing functions.' ) );
+ }
+ if ( !isCollection( odtypes ) ) {
+ throw new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', odtypes ) );
+ }
+ for ( i = 0; i < odtypes.length; i++ ) {
+ dt = odtypes[ i ];
+ if (
+ !isCollection( dt ) ||
+ dt.length < 1 ||
+ !everyBy( dt, isDataType )
+ ) {
+ throw new TypeError( format( 'invalid argument. Second argument must contain arrays of data types. Value: `%s`.', odtypes ) );
+ }
+ }
+ if ( !isObject( policies ) ) {
+ throw new TypeError( format( 'invalid argument. Fourth argument must be an object. Value: `%s`.', table ) );
+ }
+ if ( !isOutputDataTypePolicy( policies.output ) ) {
+ throw new TypeError( format( 'invalid argument. Fourth argument must be an object having a supported output data type policy. Value: `%s`.', policies.output ) );
+ }
+ this._table = {
+ 'default': table.default,
+ 'types': ( table.types ) ? types2enums( table.types ) : [], // note: convert to enums (i.e., integers) to ensure faster comparisons
+ 'fcns': ( table.fcns ) ? copy( table.fcns ) : []
+ };
+ if ( this._table.types.length !== this._table.fcns.length ) {
+ throw new Error( 'invalid argument. First argument specifies an unexpected number of types. A pair of input and output ndarray data types must be specified for each provided strided function.' );
+ }
+ this._odtypes = odtypes;
+ this._policies = {
+ 'output': policies.output,
+ 'casting': 'none'
+ };
+ if ( arguments.length > 3 ) {
+ this._apply = nullaryStrided1d.factory( options ); // note: delegate options validation to factory method
+ } else {
+ this._apply = nullaryStrided1d;
+ }
+ return this;
+}
+
+/**
+* Applies a strided function and assigns results to a provided output ndarray.
+*
+* @name assign
+* @memberof NullaryStrided1dDispatch.prototype
+* @type {Function}
+* @param {ndarrayLike} x - output ndarray
+* @param {...ndarrayLike} [args] - additional ndarray arguments
+* @param {Options} [options] - function options
+* @param {IntegerArray} [options.dims] - list of dimensions over which to perform an operation
+* @throws {TypeError} first argument must be an ndarray
+* @throws {TypeError} first argument must have a supported data type
+* @throws {TypeError} options argument must be an object
+* @throws {RangeError} dimension indices must not exceed input ndarray bounds
+* @throws {RangeError} number of dimension indices must not exceed the number of input ndarray dimensions
+* @throws {Error} must provide valid options
+* @returns {ndarrayLike} output ndarray
+*
+* @example
+* var base = require( '@stdlib/blas/ext/base/ndarray/gsorthp' );
+* var dtypes = require( '@stdlib/ndarray/dtypes' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+* var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
+* var ndarray = require( '@stdlib/ndarray/base/ctor' );
+*
+* var odt = dtypes( 'all' );
+* var policies = {
+* 'output': 'same'
+* };
+*
+* var table = {
+* 'default': base
+* };
+* var sorthp = new NullaryStrided1dDispatch( table, [ odt ], policies );
+*
+* var xbuf = [ -1.0, 2.0, -3.0 ];
+* var x = new ndarray( 'generic', xbuf, [ xbuf.length ], [ 1 ], 0, 'row-major' );
+*
+* var o = scalar2ndarray( 1.0, {
+* 'dtype': 'generic'
+* });
+*
+* var out = sorthp.assign( x, o );
+* // returns
+*
+* var arr = ndarray2array( x );
+* // returns [ -3.0, -1.0, 2.0 ]
+*
+* var bool = ( out === x );
+* // returns true
+*/
+setReadOnly( NullaryStrided1dDispatch.prototype, 'assign', function assign( x ) {
+ var options;
+ var dtypes;
+ var nargs;
+ var opts;
+ var args;
+ var arr;
+ var err;
+ var flg;
+ var xdt;
+ var dt;
+ var N;
+ var f;
+ var i;
+
+ nargs = arguments.length;
+ if ( !isndarrayLike( x ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
+ }
+ // Validate the output ndarray data type...
+ xdt = getDType( x );
+ if ( !contains( this._odtypes[ 0 ], xdt ) ) {
+ throw new TypeError( format( 'invalid argument. First argument must have one of the following data types: "%s". Data type: `%s`.', join( this._odtypes[ 0 ], '", "' ), xdt ) );
+ }
+ args = [ x ];
+
+ // Resolve additional ndarray arguments...
+ for ( i = 1; i < nargs; i++ ) {
+ arr = arguments[ i ];
+ if ( !isndarrayLike( arr ) ) {
+ break;
+ }
+ args.push( arr );
+ }
+ // If we processed all but the last argument, assume that the last argument is an options argument...
+ if ( i === nargs-1 ) {
+ options = arguments[ i ];
+ flg = true;
+ }
+ // Otherwise, if we have more than one argument remaining, then at least one argument is not an ndarray but should be...
+ else if ( i < nargs-1 ) {
+ throw new TypeError( format( 'invalid argument. Argument %d must be an ndarray-like object. Value: `%s`.', i, arguments[ i ] ) );
+ }
+
+ // Verify that additional ndarray arguments have expected dtypes...
+ for ( i = 1; i < args.length; i++ ) {
+ dt = getDType( args[ i ] );
+ if ( !contains( this._odtypes[ 0 ], dt ) ) {
+ throw new TypeError( format( 'invalid argument. Argument %d must have one of the following data types: "%s". Data type: `%s`.', i, join( this._odtypes[ i ], '", "' ), dt ) );
+ }
+ }
+ // Validate any provided options...
+ N = ndims( x );
+ opts = objectAssign( {}, defaults );
+ if ( flg ) {
+ err = validate( opts, N, this._odtypes, options );
+ if ( err ) {
+ throw err;
+ }
+ }
+ // When a list of dimensions is not provided, apply the strided function across all dimensions...
+ if ( opts.dims === null ) {
+ opts.dims = zeroTo( N );
+ }
+ // Resolve the lower-level strided function satisfying the output ndarray data type:
+ dtypes = [ resolveEnum( xdt ) ];
+ i = indexOfTypes( this._table.fcns.length, 1, this._table.types, 1, 1, 0, dtypes, 1, 0 ); // eslint-disable-line max-len
+ if ( i >= 0 ) {
+ f = this._table.fcns[ i ];
+ } else {
+ f = this._table.default;
+ }
+ // Perform operation:
+ this._apply( f, args, opts.dims ); // note: we assume that this lower-level function handles further validation of the output ndarray (e.g., expected shape, etc)
+
+ return x;
+});
+
+
+// EXPORTS //
+
+module.exports = NullaryStrided1dDispatch;
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/validate.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/validate.js
new file mode 100644
index 000000000000..92b7fe8a2636
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/lib/validate.js
@@ -0,0 +1,90 @@
+/**
+* @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 isObject = require( '@stdlib/assert/is-plain-object' );
+var hasOwnProp = require( '@stdlib/assert/has-own-property' );
+var isIntegerArray = require( '@stdlib/assert/is-integer-array' ).primitives;
+var isEmptyCollection = require( '@stdlib/assert/is-empty-collection' );
+var normalizeIndices = require( '@stdlib/ndarray/base/to-unique-normalized-indices' );
+var join = require( '@stdlib/array/base/join' );
+var contains = require( '@stdlib/array/base/assert/contains' );
+var format = require( '@stdlib/string/format' );
+
+
+// MAIN //
+
+/**
+* Validates function options.
+*
+* @private
+* @param {Object} opts - destination object
+* @param {NonNegativeInteger} ndims - number of input ndarray dimensions
+* @param {Array} dtypes - list of supported output data types
+* @param {Options} options - function options
+* @param {IntegerArray} [options.dims] - list of dimensions over which to perform a reduction
+* @param {string} [options.dtype] - output ndarray data type
+* @returns {(Error|null)} null or an error object
+*
+* @example
+* var dtypes = [ 'float64', 'float32', 'generic' ];
+*
+* var opts = {};
+* var options = {
+* 'dims': [ 0 ]
+* };
+* var err = validate( opts, 3, dtypes, options );
+* if ( err ) {
+* throw err;
+* }
+*/
+function validate( opts, ndims, dtypes, options ) {
+ var tmp;
+ if ( !isObject( options ) ) {
+ return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
+ }
+ if ( hasOwnProp( options, 'dims' ) ) {
+ opts.dims = options.dims;
+ if ( !isIntegerArray( opts.dims ) && !isEmptyCollection( opts.dims ) ) {
+ return new TypeError( format( 'invalid option. `%s` option must be an array of integers. Option: `%s`.', 'dims', opts.dims ) );
+ }
+ tmp = normalizeIndices( opts.dims, ndims-1 );
+ if ( tmp === null ) {
+ return new RangeError( format( 'invalid option. `%s` option contains an out-of-bounds dimension index. Option: [%s].', 'dims', join( opts.dims, ',' ) ) );
+ }
+ if ( tmp.length !== opts.dims.length ) {
+ return new Error( format( 'invalid option. `%s` option contains duplicate indices. Option: [%s].', 'dims', join( opts.dims, ',' ) ) );
+ }
+ opts.dims = tmp;
+ }
+ if ( hasOwnProp( options, 'dtype' ) ) {
+ opts.dtype = options.dtype;
+ if ( !contains( dtypes, opts.dtype ) ) {
+ return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'dtype', join( dtypes, '", "' ), opts.dtype ) );
+ }
+ }
+ return null;
+}
+
+
+// EXPORTS //
+
+module.exports = validate;
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/package.json b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/package.json
new file mode 100644
index 000000000000..ea61864acf1f
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "@stdlib/ndarray/base/nullary-strided1d-dispatch",
+ "version": "0.0.0",
+ "description": "Constructor for applying a strided function to an output ndarray.",
+ "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",
+ "tools",
+ "ndarray",
+ "array",
+ "strided",
+ "vector",
+ "cumulative",
+ "aggregate",
+ "aggregation",
+ "apply",
+ "call"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/test/test.js b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/test/test.js
new file mode 100644
index 000000000000..6e3a3542c64c
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/nullary-strided1d-dispatch/test/test.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';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var NullaryStrided1dDispatch = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof NullaryStrided1dDispatch, 'function', 'main export is a function' );
+ t.end();
+});
+
+// FIXME: add tests