diff --git a/.github/.keepalive b/.github/.keepalive
new file mode 100644
index 00000000..1d9ae5ac
--- /dev/null
+++ b/.github/.keepalive
@@ -0,0 +1 @@
+2024-01-01T05:40:33.444Z
diff --git a/base/lib/index.js b/base/lib/index.js
index c19dc3a8..b26c406d 100644
--- a/base/lib/index.js
+++ b/base/lib/index.js
@@ -517,15 +517,6 @@ setReadOnly( ns, 'nullaryBlockSize', require( './../../base/nullary-tiling-block
*/
setReadOnly( ns, 'numel', require( './../../base/numel' ) );
-/**
-* @name numelDimension
-* @memberof ns
-* @readonly
-* @type {Function}
-* @see {@link module:@stdlib/ndarray/base/numel-dimension}
-*/
-setReadOnly( ns, 'numelDimension', require( './../../base/numel-dimension' ) );
-
/**
* @name offset
* @memberof ns
diff --git a/base/numel-dimension/README.md b/base/numel-dimension/README.md
deleted file mode 100644
index 4e499937..00000000
--- a/base/numel-dimension/README.md
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-# numelDimension
-
-> Return the size (i.e., number of elements) of a specified dimension for a provided [ndarray][@stdlib/ndarray/base/ctor].
-
-
-
-
-
-
-
-
-
-
-
-## Usage
-
-```javascript
-var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' );
-```
-
-#### numelDimension( x, dim )
-
-Returns the size (i.e., number of elements) of a specified dimension for a provided [ndarray][@stdlib/ndarray/base/ctor].
-
-```javascript
-var zeros = require( '@stdlib/ndarray/zeros' );
-
-var x = zeros( [ 4, 2, 3 ] );
-// returns
-
-var d = numelDimension( x, 0 );
-// returns 4
-```
-
-The function accepts the following arguments:
-
-- **x**: input ndarray.
-- **dim**: dimension index. If provided an integer less than zero, the dimension index is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## Examples
-
-
-
-
-
-```javascript
-var zeros = require( '@stdlib/ndarray/zeros' );
-var slice = require( '@stdlib/ndarray/slice' );
-var E = require( '@stdlib/slice/multi' );
-var S = require( '@stdlib/slice/ctor' );
-var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' );
-
-// Create an array:
-var x = zeros( [ 10, 10, 10, 10 ] );
-// returns
-
-// Define some slices:
-var slices = [
- // :,:,:,:
- E( null, null, null, null ),
-
- // 5:10,4,2:4,::-1
- E( S( 5, 10 ), 4, S( 2, 4 ), S( null, null, -1 ) ),
-
- // :,:,2,:
- E( null, null, 2, null ),
-
- // 1,2,3,:
- E( 1, 2, 3, null ),
-
- // 1,3,::2,4::2
- E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) )
-];
-
-// Resolve the size of the first dimension for each slice...
-var s;
-var i;
-for ( i = 0; i < slices.length; i++ ) {
- s = slice( x, slices[ i ] );
- console.log( '(%s) => %d', s.shape.join( ',' ), numelDimension( s, 0 ) );
-}
-```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[@stdlib/ndarray/base/ctor]: https://github.com/stdlib-js/ndarray/tree/main/base/ctor
-
-
-
-
diff --git a/base/numel-dimension/benchmark/benchmark.js b/base/numel-dimension/benchmark/benchmark.js
deleted file mode 100644
index 0c90362a..00000000
--- a/base/numel-dimension/benchmark/benchmark.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 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( './../../../zeros' );
-var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
-var pkg = require( './../package.json' ).name;
-var numelDimension = require( './../lib' );
-
-
-// MAIN //
-
-bench( pkg, function benchmark( b ) {
- var values;
- var out;
- var i;
-
- values = [
- zeros( [ 10, 10, 10, 1 ] ),
- zeros( [ 5, 5, 5, 1, 1 ] ),
- zeros( [ 3, 4, 5 ] )
- ];
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = numelDimension( values[ i%values.length ], i%2 );
- 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();
-});
diff --git a/base/numel-dimension/docs/repl.txt b/base/numel-dimension/docs/repl.txt
deleted file mode 100644
index ac8bdc26..00000000
--- a/base/numel-dimension/docs/repl.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-
-{{alias}}( x, dim )
- Returns the size (i.e., number of elements) of a specified dimension for a
- provided ndarray.
-
- Parameters
- ----------
- x: ndarray
- Input ndarray.
-
- dim: integer
- Dimension index. If less than zero, the index is resolved relative to
- the last dimension, with the last dimension corresponding to the value
- `-1`.
-
- Returns
- -------
- out: integer
- Dimension size.
-
- Examples
- --------
- > var out = {{alias}}( {{alias:@stdlib/ndarray/zeros}}( [ 4, 2, 3 ] ), 0 )
- 4
-
- See Also
- --------
-
diff --git a/base/numel-dimension/docs/types/index.d.ts b/base/numel-dimension/docs/types/index.d.ts
deleted file mode 100644
index c3730da9..00000000
--- a/base/numel-dimension/docs/types/index.d.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-* @license Apache-2.0
-*
-* Copyright (c) 2023 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 { ndarray } from '@stdlib/types/ndarray';
-
-/**
-* Returns the size (i.e., number of elements) of a specified dimension for a provided ndarray.
-*
-* @param x - input ndarray
-* @param dim - dimension index
-* @returns dimension size
-*
-* @example
-* var zeros = require( `@stdlib/ndarray/zeros` );
-*
-* var d = numelDimension( zeros( [ 4, 2, 3 ] ), 0 );
-* // returns 4
-*/
-declare function numelDimension( x: ndarray, dim: number ): number;
-
-
-// EXPORTS //
-
-export = numelDimension;
diff --git a/base/numel-dimension/docs/types/test.ts b/base/numel-dimension/docs/types/test.ts
deleted file mode 100644
index ee4f9215..00000000
--- a/base/numel-dimension/docs/types/test.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-* @license Apache-2.0
-*
-* Copyright (c) 2023 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-import zeros = require( './../../../../zeros' );
-import numelDimension = require( './index' );
-
-
-// TESTS //
-
-// The function returns a number...
-{
- numelDimension( zeros( [ 3, 2, 1 ] ), 0 ); // $ExpectType number
-}
-
-// The compiler throws an error if the function is provided a first argument which is not an ndarray...
-{
- numelDimension( '5', 0 ); // $ExpectError
- numelDimension( 5, 0 ); // $ExpectError
- numelDimension( true, 0 ); // $ExpectError
- numelDimension( false, 0 ); // $ExpectError
- numelDimension( null, 0 ); // $ExpectError
- numelDimension( undefined, 0 ); // $ExpectError
- numelDimension( [ '1', '2' ], 0 ); // $ExpectError
- numelDimension( {}, 0 ); // $ExpectError
- numelDimension( ( x: number ): number => x, 0 ); // $ExpectError
-}
-
-// The compiler throws an error if the function is provided a second argument which is not a number...
-{
- numelDimension( zeros( [ 3, 2, 1 ] ), '5' ); // $ExpectError
- numelDimension( zeros( [ 3, 2, 1 ] ), true ); // $ExpectError
- numelDimension( zeros( [ 3, 2, 1 ] ), false ); // $ExpectError
- numelDimension( zeros( [ 3, 2, 1 ] ), null ); // $ExpectError
- numelDimension( zeros( [ 3, 2, 1 ] ), undefined ); // $ExpectError
- numelDimension( zeros( [ 3, 2, 1 ] ), [ '1', '2' ] ); // $ExpectError
- numelDimension( zeros( [ 3, 2, 1 ] ), {} ); // $ExpectError
- numelDimension( zeros( [ 3, 2, 1 ] ), ( x: number ): number => x ); // $ExpectError
-}
-
-// The compiler throws an error if the function is provided an unsupported number of arguments...
-{
- numelDimension(); // $ExpectError
- numelDimension( zeros( [ 2, 2 ] ) ); // $ExpectError
- numelDimension( zeros( [ 2, 2 ] ), 0, {} ); // $ExpectError
-}
diff --git a/base/numel-dimension/examples/index.js b/base/numel-dimension/examples/index.js
deleted file mode 100644
index d35884d6..00000000
--- a/base/numel-dimension/examples/index.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 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 new-cap */
-
-'use strict';
-
-var zeros = require( './../../../zeros' );
-var slice = require( './../../../slice' );
-var E = require( '@stdlib/slice/multi' );
-var S = require( '@stdlib/slice/ctor' );
-var numelDimension = require( './../lib' );
-
-// Create an array:
-var x = zeros( [ 10, 10, 10, 10 ] );
-// returns
-
-// Define some slices:
-var slices = [
- // :,:,:,:
- E( null, null, null, null ),
-
- // 5:10,4,2:4,::-1
- E( S( 5, 10 ), 4, S( 2, 4 ), S( null, null, -1 ) ),
-
- // :,:,2,:
- E( null, null, 2, null ),
-
- // 1,2,3,:
- E( 1, 2, 3, null ),
-
- // 1,3,::2,4::2
- E( 1, 3, S( null, null, 2 ), S( 4, null, 2 ) )
-];
-
-// Resolve the size of the first dimension for each slice...
-var s;
-var i;
-for ( i = 0; i < slices.length; i++ ) {
- s = slice( x, slices[ i ] );
- console.log( '(%s) => %d', s.shape.join( ',' ), numelDimension( s, 0 ) );
-}
diff --git a/base/numel-dimension/lib/index.js b/base/numel-dimension/lib/index.js
deleted file mode 100644
index 19b24607..00000000
--- a/base/numel-dimension/lib/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 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 size (i.e., number of elements) of a specified dimension for a provided ndarray.
-*
-* @module @stdlib/ndarray/base/numel-dimension
-*
-* @example
-* var zeros = require( '@stdlib/ndarray/zeros' );
-* var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' );
-*
-* var d = numelDimension( zeros( [ 4, 2, 3 ] ), 0 );
-* // returns 4
-*/
-
-// MODULES //
-
-var main = require( './main.js' );
-
-
-// EXPORTS //
-
-module.exports = main;
diff --git a/base/numel-dimension/lib/main.js b/base/numel-dimension/lib/main.js
deleted file mode 100644
index 12333db4..00000000
--- a/base/numel-dimension/lib/main.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 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 normalizeIndex = require( './../../../base/normalize-index' );
-var ndims = require( './../../../base/ndims' );
-var getShape = require( './../../../base/shape' );
-var format = require( '@stdlib/string/format' );
-
-
-// MAIN //
-
-/**
-* Returns the size (i.e., number of elements) of a specified dimension for a provided ndarray.
-*
-* @param {ndarrayLike} x - input ndarray
-* @param {integer} dim - dimension index
-* @throws {TypeError} first argument must be an ndarray having one or more dimensions
-* @throws {RangeError} dimension index exceeds the number of dimensions
-* @returns {NonNegativeInteger} dimension size
-*
-* @example
-* var zeros = require( '@stdlib/ndarray/zeros' );
-*
-* var out = numelDimension( zeros( [ 4, 2, 3 ] ), 0 );
-* // returns 4
-*/
-function numelDimension( x, dim ) {
- var N;
- var d;
-
- // Retrieve array meta data:
- N = ndims( x );
-
- // Check whether we were provided a zero-dimensional array...
- if ( N === 0 ) {
- throw new TypeError( format( 'invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.', N ) );
- }
- // Normalize the dimension index:
- d = normalizeIndex( dim, N-1 );
- if ( d === -1 ) {
- throw new RangeError( format( 'invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.', N, dim ) );
- }
- // Return the dimension size:
- return getShape( x, false )[ d ];
-}
-
-
-// EXPORTS //
-
-module.exports = numelDimension;
diff --git a/base/numel-dimension/package.json b/base/numel-dimension/package.json
deleted file mode 100644
index ca2d84ce..00000000
--- a/base/numel-dimension/package.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "name": "@stdlib/ndarray/base/numel-dimension",
- "version": "0.0.0",
- "description": "Return the size (i.e., number of elements) of a specified dimension for a provided 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",
- "stdtypes",
- "types",
- "base",
- "ndarray",
- "shape",
- "size",
- "dim",
- "dimension",
- "numel",
- "length",
- "len",
- "multidimensional",
- "array",
- "utilities",
- "utility",
- "utils",
- "util"
- ],
- "__stdlib__": {}
-}
diff --git a/base/numel-dimension/test/test.js b/base/numel-dimension/test/test.js
deleted file mode 100644
index b47f04a3..00000000
--- a/base/numel-dimension/test/test.js
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2023 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 zeros = require( './../../../zeros' );
-var numelDimension = require( './../lib' );
-
-
-// TESTS //
-
-tape( 'main export is a function', function test( t ) {
- t.ok( true, __filename );
- t.strictEqual( typeof numelDimension, 'function', 'main export is a function' );
- t.end();
-});
-
-tape( 'the function throws an error if provided a zero-dimensional ndarray', function test( t ) {
- t.throws( badValue, TypeError, 'throws an error' );
- t.end();
-
- function badValue() {
- numelDimension( zeros( [] ), 0 );
- }
-});
-
-tape( 'the function throws an error if provided a dimension index which exceeds the number of dimensions (positive)', function test( t ) {
- t.throws( badValue, RangeError, 'throws an error' );
- t.end();
-
- function badValue() {
- numelDimension( zeros( [ 3, 3 ] ), 100 );
- }
-});
-
-tape( 'the function throws an error if provided a dimension index which exceeds the number of dimensions (negative)', function test( t ) {
- t.throws( badValue, RangeError, 'throws an error' );
- t.end();
-
- function badValue() {
- numelDimension( zeros( [ 3, 3 ] ), -100 );
- }
-});
-
-tape( 'the function returns an ndarray dimension size', function test( t ) {
- var expected;
- var values;
- var dims;
- var out;
- var i;
-
- values = [
- zeros( [ 3, 3, 3 ] ),
- zeros( [ 1, 1 ] ),
- zeros( [ 3, 3, 0, 3 ] ),
- zeros( [ 1, 2, 3, 4 ] ),
- zeros( [ 5 ] )
- ];
-
- dims = [
- 1,
- 0,
- 2,
- 3,
- 0
- ];
-
- expected = [
- values[ 0 ].shape[ dims[ 0 ] ],
- values[ 1 ].shape[ dims[ 1 ] ],
- values[ 2 ].shape[ dims[ 2 ] ],
- values[ 3 ].shape[ dims[ 3 ] ],
- values[ 4 ].shape[ dims[ 4 ] ]
- ];
-
- for ( i = 0; i < values.length; i++ ) {
- out = numelDimension( values[ i ], dims[ i ] );
- t.strictEqual( out, expected[ i ], 'returns expected value for shape '+values[ i ].shape.join( 'x' ) );
- }
- t.end();
-});
-
-tape( 'the function accepts minimal ndarray-like objects (shape)', function test( t ) {
- var expected;
- var values;
- var dims;
- var out;
- var i;
-
- values = [
- {
- 'shape': [ 3, 3, 3 ]
- },
- {
- 'shape': [ 1, 1 ]
- },
- {
- 'shape': [ 3, 3, 0, 3 ]
- },
- {
- 'shape': [ 1, 2, 3, 4 ]
- },
- {
- 'shape': [ 5 ]
- }
- ];
-
- dims = [
- 1,
- 0,
- 2,
- 3,
- 0
- ];
-
- expected = [
- 3,
- 1,
- 0,
- 4,
- 5
- ];
-
- for ( i = 0; i < values.length; i++ ) {
- out = numelDimension( values[ i ], dims[ i ] );
- t.strictEqual( out, expected[ i ], 'returns expected value for shape '+values[ i ].shape.join( 'x' ) );
- }
- t.end();
-});
diff --git a/dist/index.js b/dist/index.js
index 0f48d394..cda060bb 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,4 +1,4 @@
-"use strict";var D=function(r,a){return function(){return a||r((a={exports:{}}).exports,a),a.exports}};var uv=D(function(BQ,nv){"use strict";function P5(r){var a,e,i,v;for(a=r.length,e=[],v=0;v=0;v--)e[v]=i,i*=r[v];return e}function C5(r){var a,e,i;for(a=[],e=1,i=0;i=0;v--)a[v]=i,i*=r[v];return a}function B5(r,a){var e,i;for(e=1,i=0;iv&&(i=!1),i||a)v=t;else return 0;return i&&a?3:i?1:2}qv.exports=J5});var De=D(function(JQ,hv){"use strict";var Z5=xv();hv.exports=Z5});var wv=D(function(ZQ,bv){"use strict";function X5(r){var a,e,i;if(a=r.length,a===0)return 0;for(e=1,i=0;i0?t+=o*(r[s]-1):o<0&&(v+=o*(r[s]-1))}return[v,t]}Zv.exports=xw});var Qv=D(function(fH,Wv){"use strict";function hw(r,a,e,i){var v,t,o,s,u;for(v=r.length,t=e,o=e,u=0;u0?o+=s*(r[u]-1):s<0&&(t+=s*(r[u]-1))}return i[0]=t,i[1]=o,i}Wv.exports=hw});var xe=D(function(dH,$v){"use strict";var bw=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hv=Xv(),ww=Qv();bw(Hv,"assign",ww);$v.exports=Hv});var es=D(function(lH,rs){"use strict";var Sw=xe();function jw(r,a,e,i){var v=Sw(a,e,i);return v[0]>=0&&v[1]=0;o--)t=r%e[o],r-=t,r/=e[o],v+=t*a[o];return this._accessors?this._buffer.get(v):this._buffer[v]}qs.exports=Pw});var bs=D(function(jH,hs){"use strict";function Cw(r,a){var e,i,v,t,o,s;if(v=this._ndims,v===0)return this._accessors?this._buffer.set(r,this._offset):this._buffer[this._offset]=r,this;if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(this._iterationOrder===1)return this._accessors?this._buffer.set(a,this._offset+r):this._buffer[this._offset+r]=a,this;if(this._iterationOrder===-1)return this._accessors?this._buffer.set(a,this._offset-r):this._buffer[this._offset-r]=a,this}if(i=this._shape,e=this._strides,t=this._offset,this._order==="column-major"){for(s=0;s=0;s--)o=r%i[s],r-=o,r/=i[s],t+=o*e[s];return this._accessors?this._buffer.set(a,t):this._buffer[t]=a,this}hs.exports=Cw});var Ss=D(function(EH,ws){"use strict";function Lw(){var r,a;for(r=this._offset,a=0;a=0;o--)t=this.iget(this._length-1-o),r+=Ti(t)+", "+Ii(t),o>0&&(r+=", ");else for(o=2;o>=0;o--)r+=this.iget(this._length-1-o),o>0&&(r+=", ")}if(e=Kw[this.dtype],i+=Yw(e,"{{data}}",r),i+=", ",a===0?i+="[]":i+="[ "+this._shape.join(", ")+" ]",i+=", ",i+="[ ",a===0)i+="0";else for(o=0;oa?a:r}Qs.exports=MS});var Oa=D(function(BH,$s){"use strict";var BS=Hs();$s.exports=BS});var eo=D(function(FH,ro){"use strict";function FS(r,a){var e=a+1;return r<0?(r+=e,r<0&&(r%=e,r!==0&&(r+=e)),r):(r>a&&(r-=e,r>a&&(r%=e)),r)}ro.exports=FS});var Ta=D(function(UH,ao){"use strict";var US=eo();ao.exports=US});var to=D(function(YH,io){"use strict";function YS(r,a){return r<0?(r+=a+1,r<0?-1:r):r>a?-1:r}io.exports=YS});var be=D(function(KH,vo){"use strict";var KS=to();vo.exports=KS});var oo=D(function(GH,so){"use strict";var GS=require("@stdlib/array/base/assert/contains").factory,JS=Ve(),ZS=GS(JS());so.exports=ZS});var Be=D(function(JH,no){"use strict";var XS=oo();no.exports=XS});var fo=D(function(ZH,uo){"use strict";var WS=Oa(),QS=Ta(),HS=be(),$S=Be(),Ni=require("@stdlib/string/format"),r8={wrap:QS,clamp:WS,normalize:a8,throw:e8};function e8(r,a){if(r<0||r>a)throw new RangeError(Ni("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",a,r));return r}function a8(r,a){var e=HS(r,a);if(e<0||e>a)throw new RangeError(Ni("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",a,r));return e}function i8(r){if(!$S(r))throw new TypeError(Ni("invalid argument. First argument must be a recognized index mode. Value: `%s`.",r));return r8[r]}uo.exports=i8});var co=D(function(XH,lo){"use strict";var t8=Oa(),v8=Ta(),s8=be(),o8=require("@stdlib/string/format");function n8(r,a,e){var i;if(e==="clamp")return t8(r,a);if(e==="wrap")return v8(r,a);if(i=r,e==="normalize"&&(i=s8(i,a)),i<0||i>a)throw new RangeError(o8("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",a,r));return i}lo.exports=n8});var Fe=D(function(WH,po){"use strict";var u8=require("@stdlib/utils/define-nonenumerable-read-only-property"),f8=fo(),yo=co();u8(yo,"factory",f8);po.exports=yo});var qo=D(function(QH,go){"use strict";var d8=require("@stdlib/assert/is-integer").isPrimitive,l8=Fe(),c8=te(),y8=require("@stdlib/string/format"),mo=c8.prototype.iget;function p8(r){if(this._ndims>0){if(!d8(r))throw new TypeError(y8("invalid argument. Index must be an integer. Value: `%s`.",r));return r=l8(r,this._length-1,this._mode),mo.call(this,r)}return mo.call(this)}go.exports=p8});var bo=D(function(HH,ho){"use strict";var m8=require("@stdlib/assert/is-integer").isPrimitive,g8=Fe(),q8=te(),x8=require("@stdlib/string/format"),xo=q8.prototype.iset;function h8(r,a){if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(this._ndims>0){if(!m8(r))throw new TypeError(x8("invalid argument. Index must be an integer. Value: `%s`.",r));r=g8(r,this._length-1,this._mode),xo.call(this,r,a)}else xo.call(this,r);return this}ho.exports=h8});var jo=D(function($H,So){"use strict";var b8=require("@stdlib/assert/is-integer").isPrimitive,w8=Fe(),wo=require("@stdlib/string/format");function S8(){var r,a,e,i;if(arguments.length!==this._ndims)throw new RangeError(wo("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(r=this._offset,e=this._submode.length,i=0;i0))throw new TypeError(ce("invalid argument. Third argument must be an array-like object containing nonnegative integers. Value: `%s`.",e));if(s=e.length,s>Vo)throw new RangeError(ce("invalid argument. Number of dimensions must not exceed %u due to stack limits. Value: `%u`.",Vo,s));if(!D8(i))throw new TypeError(ce("invalid argument. Fourth argument must be an array-like object containing integers. Value: `%s`.",i));if(s>0){if(i.length!==s)throw new RangeError(ce("invalid argument. Fourth argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.",s,i.length))}else{if(i.length!==1)throw new RangeError("invalid argument. Fourth argument length must be equal to 1 when creating a zero-dimensional ndarray.");if(i[0]!==0)throw new RangeError(ce("invalid argument. Fourth argument must contain a single element equal to 0. Value: `%d`.",i[0]))}if(!R8(v))throw new TypeError(ce("invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.",v));if(!z8(t))throw new TypeError(ce("invalid argument. Sixth argument must be a supported order. Value: `%s`.",t));if(s>0&&!P8(a.length,e,i,v)&&C8(e)>0)throw new Error("invalid arguments. Input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.");if(u={},u.mode=G8,u.readonly=J8,arguments.length>6&&(f=K8(u,o),f))throw f;return this._mode=u.mode,u.submode===void 0&&(u.submode=[this._mode]),this._submode=u.submode,n=zo(e,s),d=zo(i,s||1),Po.call(this,r,a,n,d,v,t),this._flags.READONLY=u.readonly,this}M8(ye,Po);va(ye,"name","ndarray");va(ye.prototype,"get",U8);va(ye.prototype,"iget",B8);va(ye.prototype,"set",Y8);va(ye.prototype,"iset",F8);Co.exports=ye});var pe=D(function(t$,Mo){"use strict";var Z8=Lo();Mo.exports=Z8});var Bo=D(function(v$,X8){X8.exports=["none","equiv","safe","mostly-safe","same-kind","unsafe"]});var Uo=D(function(s$,Fo){"use strict";var W8=Bo();function Q8(){return W8.slice()}Fo.exports=Q8});var Ko=D(function(o$,Yo){"use strict";function H8(){return{none:0,equiv:1,safe:2,"mostly-safe":3,"same-kind":4,unsafe:5}}Yo.exports=H8});var Di=D(function(n$,Jo){"use strict";var $8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Go=Uo(),rj=Ko();$8(Go,"enum",rj);Jo.exports=Go});var Wo=D(function(u$,Xo){"use strict";var ej=Di(),Zo=ej(),aj=Zo.length;function ij(r){var a;for(a=0;a0}cn.exports=Oj});var Na=D(function(b$,pn){"use strict";var Tj=yn();pn.exports=Tj});var mn=D(function(w$,Ij){Ij.exports={float64:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},float32:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int32:{float64:1,float32:0,int32:1,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},int16:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int8:{float64:1,float32:1,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},uint32:{float64:1,float32:0,int32:0,int16:0,int8:0,uint32:1,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},uint16:{float64:1,float32:1,int32:1,int16:0,int8:0,uint32:1,uint16:1,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},uint8:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},uint8c:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},complex128:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},complex64:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},generic:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:0,generic:1},binary:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:1,generic:0}}});var xn=D(function(S$,qn){"use strict";var gn=require("@stdlib/utils/keys"),kj=require("@stdlib/assert/has-own-property"),Aj=ve(),Da=mn(),Ra;function Nj(){var r,a,e,i,v,t,o,s,u;for(e={},r=gn(Da),a=r.length,u=0;u0}bn.exports=Cj});var za=D(function(_$,Sn){"use strict";var Lj=wn();Sn.exports=Lj});var jn=D(function(O$,Mj){Mj.exports={float64:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},float32:{float64:1,float32:1,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int32:{float64:1,float32:0,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,binary:0,generic:1},int16:{float64:1,float32:1,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},int8:{float64:1,float32:1,int32:1,int16:1,int8:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:1},uint32:{float64:1,float32:0,int32:0,int16:0,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:0,binary:0,generic:1},uint16:{float64:1,float32:1,int32:1,int16:0,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},uint8:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},uint8c:{float64:1,float32:1,int32:1,int16:1,int8:0,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,binary:0,generic:1},complex128:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:0},complex64:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,binary:0,generic:0},generic:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:0,generic:1},binary:{float64:0,float32:0,int32:0,int16:0,int8:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,binary:1,generic:0}}});var On=D(function(T$,_n){"use strict";var En=require("@stdlib/utils/keys"),Bj=require("@stdlib/assert/has-own-property"),Fj=ve(),Pa=jn(),Va;function Uj(){var r,a,e,i,v,t,o,s,u;for(e={},r=En(Pa),a=r.length,u=0;u0}In.exports=Xj});var Li=D(function(A$,An){"use strict";var Wj=kn();An.exports=Wj});var Rn=D(function(N$,Nn){"use strict";var Qj=Na(),Hj=za(),$j=Li();function r7(r,a,e){return e==="unsafe"||r===a?!0:e==="none"||e==="equiv"?!1:e==="safe"?Qj(r,a):e==="mostly-safe"?Hj(r,a):$j(r,a)}Nn.exports=r7});var Mi=D(function(R$,Dn){"use strict";var e7=Rn();Dn.exports=e7});var Vn=D(function(D$,zn){"use strict";var a7=require("@stdlib/buffer/ctor"),i7=require("@stdlib/array/float64"),t7=require("@stdlib/array/float32"),v7=require("@stdlib/array/int16"),s7=require("@stdlib/array/int32"),o7=require("@stdlib/array/int8"),n7=require("@stdlib/array/uint16"),u7=require("@stdlib/array/uint32"),f7=require("@stdlib/array/uint8"),d7=require("@stdlib/array/uint8c"),l7=require("@stdlib/array/complex64"),c7=require("@stdlib/array/complex128"),y7={binary:a7,float64:i7,float32:t7,generic:Array,int16:v7,int32:s7,int8:o7,uint16:n7,uint32:u7,uint8:f7,uint8c:d7,complex64:l7,complex128:c7};zn.exports=y7});var Cn=D(function(z$,Pn){"use strict";var p7=Vn();function m7(r){return p7[r]||null}Pn.exports=m7});var oa=D(function(V$,Ln){"use strict";var g7=Cn();Ln.exports=g7});var Bn=D(function(P$,Mn){"use strict";function q7(r){var a;for(a=0;a=0&&r.length=w_(a)}Wu.exports=S_});var $u=D(function(yrr,Hu){"use strict";var j_=Qu();Hu.exports=j_});var af=D(function(prr,ef){"use strict";var rf=require("@stdlib/math/base/special/abs");function E_(r){var a,e,i,v;if(a=r.length,a===0)return!1;for(e=rf(r[0]),v=1;ve)return!1;e=i}return!0}Yf.exports=xO});var Wi=D(function(Frr,Gf){"use strict";var hO=Kf();Gf.exports=hO});var Zf=D(function(Urr,Jf){"use strict";var bO=na(),wO=le(),SO=Wi();function jO(r,a,e){return wO(a)!==0&&SO(a)&&bO(r,a,e)}Jf.exports=jO});var Wf=D(function(Yrr,Xf){"use strict";var EO=Zf();Xf.exports=EO});var Hf=D(function(Krr,Qf){"use strict";var _O=require("@stdlib/array/base/assert/contains").factory,OO=Gr(),TO=_O(OO("signed_integer"));Qf.exports=TO});var Ya=D(function(Grr,$f){"use strict";var IO=Hf();$f.exports=IO});var ed=D(function(Jrr,rd){"use strict";var kO=require("@stdlib/array/base/assert/contains").factory,AO=Gr(),NO=kO(AO("unsigned_integer"));rd.exports=NO});var Ka=D(function(Zrr,ad){"use strict";var RO=ed();ad.exports=RO});var td=D(function(Xrr,id){"use strict";var Cr=require("@stdlib/utils/define-read-only-property"),Pr={};Cr(Pr,"isAllowedDataTypeCast",Mi());Cr(Pr,"isBufferLengthCompatible",Oi());Cr(Pr,"isBufferLengthCompatibleShape",$u());Cr(Pr,"isCastingMode",zi());Cr(Pr,"isColumnMajor",Ki());Cr(Pr,"isColumnMajorContiguous",df());Cr(Pr,"isComplexFloatingPointDataType",ua());Cr(Pr,"isContiguous",qf());Cr(Pr,"isDataType",Me());Cr(Pr,"isFloatingPointDataType",Fa());Cr(Pr,"isIndexMode",Be());Cr(Pr,"isIntegerDataType",Gi());Cr(Pr,"isMostlySafeDataTypeCast",za());Cr(Pr,"isNumericDataType",Ji());Cr(Pr,"isOrder",ae());Cr(Pr,"isReadOnly",re());Cr(Pr,"isRealDataType",Ua());Cr(Pr,"isRealFloatingPointDataType",Xi());Cr(Pr,"isRowMajor",Wi());Cr(Pr,"isRowMajorContiguous",Wf());Cr(Pr,"isSafeDataTypeCast",Na());Cr(Pr,"isSameKindDataTypeCast",Li());Cr(Pr,"isSignedIntegerDataType",Ya());Cr(Pr,"isSingleSegmentCompatible",na());Cr(Pr,"isUnsignedIntegerDataType",Ka());id.exports=Pr});var sd=D(function(Wrr,vd){"use strict";function DO(r){return r.dtype}vd.exports=DO});var Xr=D(function(Qrr,od){"use strict";var zO=sd();od.exports=zO});var ud=D(function(Hrr,nd){"use strict";var VO=require("@stdlib/array/base/copy-indexed");function PO(r,a){var e=r.shape;return a?VO(e):e}nd.exports=PO});var Yr=D(function($rr,fd){"use strict";var CO=ud();fd.exports=CO});var ld=D(function(rer,dd){"use strict";var LO=Jr(),MO=require("@stdlib/array/base/copy-indexed"),BO="row-major";function FO(r,a){var e,i,v;return v=r.strides,typeof v!="object"||v===null?(i=r.shape,i.length===0?[0]:(e=r.order,typeof e!="string"&&(e=BO),LO(i,e))):a?MO(v):v}dd.exports=FO});var ee=D(function(eer,cd){"use strict";var UO=ld();cd.exports=UO});var pd=D(function(aer,yd){"use strict";var YO=Zr();function KO(r){var a,e,i;return i=r.offset,typeof i=="number"?i:(e=r.shape,e.length===0||(a=r.strides,typeof a!="object"||a===null)?0:YO(e,a))}yd.exports=KO});var me=D(function(ier,md){"use strict";var GO=pd();md.exports=GO});var qd=D(function(ter,gd){"use strict";var JO=De(),Qi="row-major",ZO="column-major";function XO(r){var a,e;return e=r.order,typeof e=="string"?e:(a=r.strides,typeof a!="object"||a===null||(e=JO(a),e===1||e===3)?Qi:e===2?ZO:r.shape.length===0?Qi:null)}gd.exports=XO});var Wr=D(function(ver,xd){"use strict";var WO=qd();xd.exports=WO});var bd=D(function(ser,hd){"use strict";function QO(r){return r.data}hd.exports=QO});var Se=D(function(oer,wd){"use strict";var HO=bd();wd.exports=HO});var jd=D(function(ner,Sd){"use strict";var $O=require("@stdlib/array/base/assert/is-accessor-array"),rT=require("@stdlib/array/base/accessor-getter"),eT=require("@stdlib/array/base/accessor-setter"),aT=require("@stdlib/array/base/getter"),iT=require("@stdlib/array/base/setter"),tT=zr(),vT=Xr(),sT=Yr(),oT=ee(),nT=me(),uT=Wr(),fT=Se();function dT(r){var a,e,i,v;return a=fT(r),i=sT(r,!0),v=vT(r),e=$O(a),{ref:r,dtype:v,data:a,length:tT(i),shape:i,strides:oT(r,!0),offset:nT(r),order:uT(r),accessorProtocol:e,accessors:e?[rT(v),eT(v)]:[aT(v),iT(v)]}}Sd.exports=dT});var Ge=D(function(uer,Ed){"use strict";var lT=jd();Ed.exports=lT});var Od=D(function(fer,_d){"use strict";function cT(r,a){var e,i,v,t,o,s,u,f,n,d;for(v=1,t=1,d=1;d=0&&(n=r[o],i=n<0?-n:n,!(i<=e));)r[o+1]=n,a[s+1]=a[s],o-=1,s-=1;r[o+1]=u,a[s+1]=f,v+=1,t+=1}}_d.exports=cT});var kd=D(function(der,Id){"use strict";var yT=require("@stdlib/array/base/zero-to"),pT=require("@stdlib/array/base/copy-indexed"),Td=require("@stdlib/array/base/take-indexed"),mT=Od();function gT(r,a,e){var i;return i=yT(r.length),a=pT(a),mT(a,i),r=Td(r,i),e=Td(e,i),{sh:r,sx:a,sy:e}}Id.exports=gT});var Ir=D(function(ler,Ad){"use strict";var qT=kd();Ad.exports=qT});var Rd=D(function(cer,Nd){"use strict";var xT={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};Nd.exports=xT});var Vd=D(function(yer,zd){"use strict";var Dd=Oe(),Hi=Rd();function hT(r,a){var e,i;return e=Dd(r),i=Dd(a),e===null||i===null?Hi.BLOCK_SIZE_IN_ELEMENTS:e>i?Hi.BLOCK_SIZE_IN_BYTES/e|0:Hi.BLOCK_SIZE_IN_BYTES/i|0}zd.exports=hT});var kr=D(function(per,Pd){"use strict";var bT=Vd();Pd.exports=bT});var Ld=D(function(mer,Cd){"use strict";var wT=Ir(),ST=kr();function jT(r,a){var e,i,v,t,o,s,u,f,n,d,g,b,y,l,q,m,w,T,x,j,E,c,h,p,S;for(S=wT(r.shape,r.strides,a.strides),b=S.sh,q=S.sx,m=S.sy,e=ST(r.dtype,a.dtype),w=r.offset,T=a.offset,i=r.data,v=a.data,s=q[0],f=m[0],t=r.accessors[0],o=a.accessors[1],p=b[1];p>0;)for(p0;)for(h0;)for(I0;)for(R0;)for(N0;)for(M0;)for(L0;)for(C0;)for(P0;)for(J0;)for(Y0;)for(G0;)for(K0;)for(U0;)for(er0;)for(H0;)for($0;)for(X0;)for(Q0;)for(W0;)for(or0;)for(sr0;)for(vr0;)for(ar0;)for(tr0;)for(rr0;)for(ir0;)for(yr0;)for(lr0;)for(cr0;)for(fr0;)for(dr0;)for(ur0;)for(nr0;)for(or0;)for(Sr0;)for(mr0;)for(xr0;)for(qr0;)for(hr0;)for(gr0;)for(pr0;)for(yr0;)for(lr0;)for(Dr0;)for(Ar0;)for(Tr0;)for(Or0;)for(_r0;)for(Er0;)for(jr0;)for(Sr0;)for(mr0;)for(xr0;)for(c0;)for(E0;)for(N0;)for(O0;)for(A0;)for(C0;)for(P0;)for(k0;)for(V0;)for(G0;)for(K0;)for(U0;)for(F0;)for(B0;)for($0;)for(X0;)for(Q0;)for(W0;)for(Z0;)for(J0;)for(vr0;)for(ar0;)for(tr0;)for(rr0;)for(ir0;)for(er0;)for(H0;)for(cr0;)for(fr0;)for(dr0;)for(ur0;)for(nr0;)for(or0;)for(sr0;)for(vr0;)for(xr0;)for(qr0;)for(hr0;)for(gr0;)for(pr0;)for(yr0;)for(lr0;)for(cr0;)for(fr0;)for(Tr0;)for(Or0;)for(_r0;)for(Er0;)for(jr0;)for(Sr0;)for(mr0;)for(xr0;)for(qr0;)for(hr=s&&(v=s-1);else if(t==="wrap")v<0?(v+=s,v<0&&(v%=s,v!==0&&(v+=s))):v>=s&&(v-=s,v>=s&&(v%=s));else if(t==="normalize"&&v<0&&(v+=s),v<0||v>=s)throw new RangeError(RI("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",s,v));if(u=e,i==="column-major"){for(n=0;n=0;n--)f=v%r[n],v-=f,v/=r[n],u+=f*a[n];return u}F0.exports=DI});var ge=D(function(Ger,Y0){"use strict";var zI=U0();Y0.exports=zI});var Z0=D(function(Jer,J0){"use strict";var VI=zr(),K0=ge(),G0="throw";function PI(r,a){var e,i,v,t,o,s,u,f,n,d,g,b,y,l,q;for(f=r.shape,o=VI(f),e=r.data,i=a.data,n=r.strides,d=a.strides,g=r.offset,b=a.offset,v=r.order,t=a.order,s=r.accessors[0],u=a.accessors[1],q=0;q=0&&(n=r[o],i=n<0?-n:n,!(i<=e));)r[o+1]=n,a[s+1]=a[s],o-=1,s-=1;r[o+1]=u,a[s+1]=f,v+=1,t+=1}}Tl.exports=Jk});var Nl=D(function(far,Al){"use strict";var Zk=require("@stdlib/array/base/zero-to"),Xk=require("@stdlib/array/base/copy-indexed"),Ga=require("@stdlib/array/base/take-indexed"),Wk=require("@stdlib/array/base/filled"),rt=De(),Qk=Il(),kl=3;function Hk(r,a,e,i){var v,t,o,s,u,f,n,d,g,b;if(v=Zk(r.length),f=rt(a),n=rt(e),d=rt(i),t=Wk([],4),t[f].push(a),t[n].push(e),t[d].push(i),o=t[0].length,o===kl)u=a;else if(o===kl-1){for(g=1;g<4;g++)if(t[g].length){u=t[g][0];break}}else{for(b=0,g=1;g<4;g++)s=t[g].length,s>=o&&(o=s,b=g);u=t[b][0]}return u=Xk(u),Qk(u,v),r=Ga(r,v),a=a===u?u:Ga(a,v),e=e===u?u:Ga(e,v),i=i===u?u:Ga(i,v),{sh:r,sx:a,sy:e,sz:i}}Al.exports=Hk});var Dl=D(function(dar,Rl){"use strict";var $k=Nl();Rl.exports=$k});var Vl=D(function(lar,zl){"use strict";var rA={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};zl.exports=rA});var Cl=D(function(car,Pl){"use strict";var et=Oe(),Ja=Vl();function eA(r,a,e){var i,v,t;return i=et(r),v=et(a),t=et(e),i===null||v===null||t===null?Ja.BLOCK_SIZE_IN_ELEMENTS:i>v&&i>t?Ja.BLOCK_SIZE_IN_BYTES/i|0:v>t?Ja.BLOCK_SIZE_IN_BYTES/v|0:Ja.BLOCK_SIZE_IN_BYTES/t|0}Pl.exports=eA});var Ml=D(function(yar,Ll){"use strict";var aA=Cl();Ll.exports=aA});var Ul=D(function(par,Fl){"use strict";var iA=require("@stdlib/string/format"),Za=require("@stdlib/math/base/special/trunc"),Bl=require("@stdlib/math/base/special/abs");function tA(r,a,e,i,v,t){var o,s,u,f,n,d;for(o=r.length,s=1,d=0;d=s&&(v=s-1);else if(t==="wrap")v<0?(v+=s,v<0&&(v%=s,v!==0&&(v+=s))):v>=s&&(v-=s,v>=s&&(v%=s));else if(t==="normalize"&&v<0&&(v+=s),v<0||v>=s)throw new RangeError(iA("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",s,v));if(u=0,i==="column-major"){for(d=o-1;d>=0;d--)n=a[d],n<0?(f=Za(v/n),v-=f*n,f+=r[d]-1):(f=Za(v/n),v-=f*n),u+=f*Bl(n);return u}for(d=0;d=0;f--)if(n=s-o+f,!(n<0)){if(u=v[n],i=a[f],i!==0&&if&&(f=a[n]);for(n=0;n=0;){for(t=a[0]-f+n,t>=0?i=v[t]:i=1,d=1;d=0?s=r[d][o]:s=1,i===1){i=s;continue}if(!(s===1||i===s))return null}e[n]=i,n-=1}return e}Wl.exports=pA});var Ze=D(function(har,Hl){"use strict";var mA=Ql();Hl.exports=mA});var rc=D(function(bar,$l){"use strict";var gA=Ze(),qA=ca(),xA=Yr();function hA(r){var a,e,i,v,t;for(v=r.length,a=[],t=0;t ("):t.push("("):f===u?f===n?t.push(") => ()"):t.push(")"):f===n?t.push(") => ("):f%2===1?t.push(""):t.push(", ");for(f=0;f0?(t=oN(a),o=tN(a,e)):(t=1,o=[0]),r==="binary"?v=uN(t):v=nN(t,r),new sN(r,v,a,o,vN(a,o),e)}Fc.exports=fN});var Kc=D(function(Uar,Yc){"use strict";var dN=Uc();Yc.exports=dN});var Jc=D(function(Yar,Gc){"use strict";var lN=Jr(),cN=Zr(),yN=zr(),pN=Xr(),mN=Yr(),gN=Wr(),qN=require("@stdlib/array/empty"),xN=require("@stdlib/buffer/alloc-unsafe");function hN(r){var a,e,i,v,t,o,s;return s=pN(r),t=mN(r,!0),v=gN(r),a=t.length,a>0?(e=yN(t),o=lN(t,v)):(e=1,o=[0]),s==="binary"?i=xN(e):i=qN(e,s),new r.constructor(s,i,t,o,cN(t,o),v)}Gc.exports=hN});var Xc=D(function(Kar,Zc){"use strict";var bN=Jc();Zc.exports=bN});var e1=D(function(Gar,r1){"use strict";var wN=re(),Wc=Xr(),SN=Yr(),jN=ee(),Qc=me(),EN=Wr(),Hc=Se(),$c=require("@stdlib/string/format");function _N(r,a){var e,i,v,t,o,s,u;if(t=SN(r,!1),o=jN(r,!1),v=EN(r),s=t.length,e=[],i=[],a<0){if(a<-s-1)throw new RangeError($c("invalid argument. Specified axis is out-of-bounds. Must be on the interval: [-%u-1, %u]. Value: `%d`.",s,s,a));a+=s+1}else if(a>s)throw new RangeError($c("invalid argument. Specified axis is out-of-bounds. Must be on the interval: [-%u-1, %u]. Value: `%d`.",s,s,a));if(a===0)for(i.push(1),e.push(o[0]),u=0;u0&&(g=DN(g.length))}else g=d1(b);return l1(g)===0?FN(d,o,nt(g,f),u,!i):(t=MN(b,v,t),g=nt(g,f),g.length===0?new d(o,ut(r),[],[0],t,u,{readonly:!i}):(v=BN(b,v,f),new d(o,ut(r),g,v,t,u,{readonly:!i})))}y1.exports=UN});var Br=D(function(Har,m1){"use strict";var YN=p1();m1.exports=YN});var q1=D(function($ar,g1){"use strict";function KN(r){var a=r.ndims;return typeof a=="number"?a:r.shape.length}g1.exports=KN});var ue=D(function(rir,x1){"use strict";var GN=q1();x1.exports=GN});var b1=D(function(eir,h1){"use strict";var JN=require("@stdlib/slice/base/args2multislice"),ZN=require("@stdlib/slice/ctor"),XN=Br(),WN=require("@stdlib/array/base/filled"),QN=ue(),ft=require("@stdlib/string/format");function HN(r,a,e){var i,v,t;if(v=QN(r),v===0)throw new TypeError(ft("invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.",v));if(t=a,t<0){if(t+=v,t<0)throw new RangeError(ft("invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.",v,a))}else if(t>=v)throw new RangeError(ft("invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.",v,a));return i=WN(null,v),i[t]=new ZN(null,null,-1),XN(r,JN(i),!0,e)}h1.exports=HN});var Wa=D(function(air,w1){"use strict";var $N=b1();w1.exports=$N});var j1=D(function(iir,S1){"use strict";var rR=require("@stdlib/slice/multi"),eR=Wa(),aR=Br(),iR=ue();function tR(r,a){return iR(r)===0?aR(r,new rR,!0,a):eR(r,-1,a)}S1.exports=tR});var _1=D(function(tir,E1){"use strict";var vR=j1();E1.exports=vR});var k1=D(function(vir,I1){"use strict";var O1=require("@stdlib/slice/multi"),sR=Wa(),T1=Br(),oR=ue();function nR(r,a){var e=oR(r);return e===0?T1(r,new O1,!0,a):e===1?T1(r,new O1(null),!0,a):sR(r,-2,a)}I1.exports=nR});var N1=D(function(sir,A1){"use strict";var uR=k1();A1.exports=uR});var D1=D(function(oir,R1){"use strict";var fR=require("@stdlib/array/base/assert/is-accessor-array"),dR=require("@stdlib/array/base/accessor-setter"),lR=require("@stdlib/array/base/setter"),cR=se(),yR=te(),pR=require("@stdlib/string/format");function mR(r,a,e){var i,v;if(i=cR(a,1),i===null)throw new TypeError(pR("invalid argument. Second argument must be a recognized data type. Value: `%s`.",a));return/^complex/.test(a)&&typeof r=="number"&&(r=[r,0]),fR(i)?v=dR(a):v=lR(a),v(i,0,r),new yR(a,i,[],[0],0,e)}R1.exports=mR});var V1=D(function(nir,z1){"use strict";var gR=D1();z1.exports=gR});var dt=D(function(uir,P1){"use strict";var qR=require("@stdlib/string/format"),Qa=require("@stdlib/math/base/special/trunc");function xR(r,a,e,i,v,t,o){var s,u,f,n,d;for(s=r.length,u=1,d=0;d=u&&(v=u-1);else if(t==="wrap")v<0?(v+=u,v<0&&(v%=u,v!==0&&(v+=u))):v>=u&&(v-=u,v>=u&&(v%=u));else if(t==="normalize"&&v<0&&(v+=u),v<0||v>=u)throw new RangeError(qR("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",u,v));if(e===0){if(i==="column-major"){for(d=0;d=0;d--)n=v%r[d],v-=n,v/=r[d],o[d]=n;return o}if(i==="column-major"){for(d=s-1;d>=0;d--)n=a[d],n<0?(f=Qa(v/n),v-=f*n,o[d]=r[d]-1+f):(f=Qa(v/n),v-=f*n,o[d]=f);return o}for(d=0;d0&&(v+=a[t]*(r[t]-1))}return v}F1.exports=ER});var K1=D(function(cir,Y1){"use strict";var _R=U1();Y1.exports=_R});var Z1=D(function(yir,J1){"use strict";var G1=ca(),OR=Yr();function TR(r,a){var e,i,v;if(i=a.length,e=OR(r,!1),e.length===i){for(v=0;vi;t--)v[t]=e[t];for(t=i;t>=0&&(o=(e[t]+1)%a[t],v[t]=o,!(o>0));t--);for(t-=1;t>=0;t--)v[t]=e[t];return v}function UR(r,a,e,i,v){var t,o;for(t=0;t0));t++);for(t+=1;t=t)return null;return a===BR?FR(t,r,e,i,v):UR(t,r,e,i,v)}ny.exports=YR});var fy=D(function(Sir,uy){"use strict";var KR=require("@stdlib/array/base/zeros"),GR=yt();function JR(r,a,e,i){return GR(r,a,e,i,KR(r.length))}uy.exports=JR});var fe=D(function(jir,ly){"use strict";var ZR=require("@stdlib/utils/define-nonenumerable-read-only-property"),dy=fy(),XR=yt();ZR(dy,"assign",XR);ly.exports=dy});var yy=D(function(Eir,cy){"use strict";function WR(r){var a,e;for(a=0,e=0;e=0&&(n=r[o],i=n<0?-n:n,!(i<=e));)r[o+1]=n,a[s+1]=a[s],o-=1,s-=1;r[o+1]=u,a[s+1]=f,v+=1,t+=1}}gy.exports=HR});var hy=D(function(Tir,xy){"use strict";var $R=require("@stdlib/array/base/zero-to"),rD=require("@stdlib/array/base/copy-indexed"),eD=require("@stdlib/array/base/take-indexed"),aD=qy();function iD(r,a){var e;return e=$R(r.length),a=rD(a),aD(a,e),r=eD(r,e),{sh:r,sx:a}}xy.exports=iD});var Fr=D(function(Iir,by){"use strict";var tD=hy();by.exports=tD});var Sy=D(function(kir,wy){"use strict";var vD={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};wy.exports=vD});var _y=D(function(Air,Ey){"use strict";var sD=Oe(),jy=Sy();function oD(r){var a=sD(r);return a===null?jy.BLOCK_SIZE_IN_ELEMENTS:jy.BLOCK_SIZE_IN_BYTES/a|0}Ey.exports=oD});var Ur=D(function(Nir,Oy){"use strict";var nD=_y();Oy.exports=nD});var Iy=D(function(Rir,Ty){"use strict";var uD=Fr(),fD=Ur();function dD(r,a){var e,i,v,t,o,s,u,f,n,d,g,b,y,l,q,m,w;for(w=uD(r.shape,r.strides),u=w.sh,d=w.sx,e=fD(r.dtype),g=r.offset,i=r.data,t=d[0],v=r.accessors[1],m=u[1];m>0;)for(m0;)for(q0;)for(E0;)for(j0;)for(x0;)for(_0;)for(S0;)for(p0;)for(h0;)for(I0;)for(R0;)for(N0;)for(O0;)for(A0;)for(C0;)for(P0;)for(k0;)for(V0;)for(z0;)for(I0;)for(U0;)for(F0;)for(B0;)for(M0;)for(L0;)for(C0;)for(P0;)for(Z0;)for(J0;)for(Y0;)for(G0;)for(K0;)for(U0;)for(F0;)for(B0;)for(H0;)for($0;)for(X0;)for(Q0;)for(W0;)for(Z0;)for(J0;)for(Y0;)for(G0;)for(ar0;)for(tr0;)for(rr0;)for(ir0;)for(er0;)for(H0;)for($0;)for(X0;)for(Q0;)for(W0;)for(q0;)for(l0;)for(j0;)for(x0;)for(T0;)for(S0;)for(p0;)for(h0;)for(c0;)for(R0;)for(N0;)for(O0;)for(A0;)for(_0;)for(P0;)for(k0;)for(V0;)for(z0;)for(I0;)for(R0;)for(F0;)for(B0;)for(M0;)for(L0;)for(C0;)for(P0;)for(k0;)for(J0;)for(Y0;)for(G0;)for(K0;)for(U0;)for(F0;)for(B0;)for(M0;)for($0;)for(X0;)for(Q0;)for(W0;)for(Z0;)for(J0;)for(Y0;)for(G0;)for(K0;)for(tr0;)for(rr0;)for(ir0;)for(er0;)for(H0;)for($0;)for(X0;)for(Q0;)for(W0;)for(Z=u&&(n=u-1);else if(o==="wrap")n<0?(n+=u,n<0&&(n%=u,n!==0&&(n+=u))):n>=u&&(n-=u,n>=u&&(n%=u));else if(o==="normalize"&&n<0&&(n+=u),n<0||n>=u)throw new RangeError(a9("invalid argument. Subscripts must not exceed array dimensions. Subscript: `%u`. Value: `%d`.",d,n));f=r[d],f<0&&a===0?s-=n*f:s+=n*f}return s}Bm.exports=i9});var Et=D(function(fvr,Um){"use strict";var t9=Fm();Um.exports=t9});var Gm=D(function(dvr,Km){"use strict";function Ym(r,a,e,i,v,t){var o,s,u,f,n;if(t>=a.length)return r.accessors[0](r.data,i);for(u=[],f=a[t],o=e[t],n=0;n0;)for(S0;)for(p0;)for(z0;)for(I