diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/README.md b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/README.md
new file mode 100644
index 000000000000..b1c14cbc6e2a
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/README.md
@@ -0,0 +1,162 @@
+
+
+# toReversedDimension
+
+> Return a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed.
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var toReversedDimension = require( '@stdlib/ndarray/base/to-reversed-dimension' );
+```
+
+#### toReversedDimension( x, dim )
+
+Returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed.
+
+```javascript
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+
+var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
+var shape = [ 3, 2 ];
+var strides = [ 2, 1 ];
+var offset = 0;
+
+var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
+// returns
+
+var sh = x.shape;
+// returns [ 3, 2 ]
+
+var arr = ndarray2array( x );
+// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+
+var y = toReversedDimension( x, 0 );
+// returns
+
+sh = y.shape;
+// returns [ 3, 2 ]
+
+arr = ndarray2array( y );
+// returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
+```
+
+The function accepts the following arguments:
+
+- **x**: input ndarray.
+- **dim**: index of dimension along which to reverse elements. 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 array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var toReversedDimension = require( '@stdlib/ndarray/base/to-reversed-dimension' );
+
+// Create a linear ndarray buffer:
+var buf = zeroTo( 16 );
+
+// Create a three-dimensional ndarray:
+var x = array( buf, {
+ 'shape': [ 2, 4, 2 ]
+});
+
+// Reverse the order of first axis:
+var y0 = toReversedDimension( x, 0 );
+// returns
+
+var a0 = ndarray2array( y0 );
+// returns [ [ [ 8, 9 ], [ 10, 11 ], [ 12, 13 ], [ 14, 15 ] ], [ [ 0, 1 ], [ 2, 3 ], [ 4, 5 ], [ 6, 7 ] ] ]
+
+// Reverse the order of second axis:
+var y1 = toReversedDimension( x, 1 );
+// returns
+
+var a1 = ndarray2array( y1 );
+// returns [ [ [ 6, 7 ], [ 4, 5 ], [ 2, 3 ], [ 0, 1 ] ], [ [ 14, 15 ], [ 12, 13 ], [ 10, 11 ], [ 8, 9 ] ] ]
+
+// Reverse the order of third axis:
+var y2 = toReversedDimension( x, 2 );
+// returns
+
+var a2 = ndarray2array( y2 );
+// returns [ [ [ 1, 0 ], [ 3, 2 ], [ 5, 4 ], [ 7, 6 ] ], [ [ 9, 8 ], [ 11, 10 ], [ 13, 12 ], [ 15, 14 ] ] ]
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/benchmark/benchmark.js
new file mode 100644
index 000000000000..52867829595c
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/benchmark/benchmark.js
@@ -0,0 +1,331 @@
+/**
+* @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 isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var baseEmpty = require( '@stdlib/ndarray/base/empty' );
+var empty = require( '@stdlib/ndarray/empty' );
+var pkg = require( './../package.json' ).name;
+var toReversedDimension = require( './../lib' );
+
+
+// MAIN //
+
+bench( pkg+'::1d,base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ values = [
+ baseEmpty( 'float64', [ 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2 ], 'row-major' )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::1d,non-base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline */
+
+ values = [
+ empty( [ 2 ], { 'dtype': 'float64' }),
+ empty( [ 2 ], { 'dtype': 'float32' }),
+ empty( [ 2 ], { 'dtype': 'int32' }),
+ empty( [ 2 ], { 'dtype': 'complex128' }),
+ empty( [ 2 ], { 'dtype': 'generic' })
+ ];
+
+ /* eslint-enable object-curly-newline */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::2d,base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ values = [
+ baseEmpty( 'float64', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2 ], 'row-major' )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::2d,non-base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline */
+
+ values = [
+ empty( [ 2, 2 ], { 'dtype': 'float64' }),
+ empty( [ 2, 2 ], { 'dtype': 'float32' }),
+ empty( [ 2, 2 ], { 'dtype': 'int32' }),
+ empty( [ 2, 2 ], { 'dtype': 'complex128' }),
+ empty( [ 2, 2 ], { 'dtype': 'generic' })
+ ];
+
+ /* eslint-enable object-curly-newline */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::3d,base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ values = [
+ baseEmpty( 'float64', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2 ], 'row-major' )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::3d,non-base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline */
+
+ values = [
+ empty( [ 2, 2, 2 ], { 'dtype': 'float64' }),
+ empty( [ 2, 2, 2 ], { 'dtype': 'float32' }),
+ empty( [ 2, 2, 2 ], { 'dtype': 'int32' }),
+ empty( [ 2, 2, 2 ], { 'dtype': 'complex128' }),
+ empty( [ 2, 2, 2 ], { 'dtype': 'generic' })
+ ];
+
+ /* eslint-enable object-curly-newline */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::4d,base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ values = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2 ], 'row-major' )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::4d,non-base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline */
+
+ values = [
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' }),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' }),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' }),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' }),
+ empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' })
+ ];
+
+ /* eslint-enable object-curly-newline */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::5d,base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ values = [
+ baseEmpty( 'float64', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'float32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'int32', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'complex128', [ 2, 2, 2, 2, 2 ], 'row-major' ),
+ baseEmpty( 'generic', [ 2, 2, 2, 2, 2 ], 'row-major' )
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::5d,non-base', function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline */
+
+ values = [
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' }),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' }),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' }),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' }),
+ empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' })
+ ];
+
+ /* eslint-enable object-curly-newline */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = toReversedDimension( values[ i%values.length ], 0 );
+ if ( typeof v !== 'object' ) {
+ b.fail( 'should return an ndarray' );
+ }
+ }
+ b.toc();
+ if ( !isndarrayLike( v ) ) {
+ b.fail( 'should return an ndarray' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/repl.txt
new file mode 100644
index 000000000000..460d378ea048
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/repl.txt
@@ -0,0 +1,36 @@
+
+{{alias}}( x, dim )
+ Returns a new ndarray where the order of elements of an input ndarray along
+ a specified dimension is reversed.
+
+ Parameters
+ ----------
+ x: ndarray
+ Input array.
+
+ dim: integer
+ Index of dimension to reverse. If less than zero, the index is resolved
+ relative to the last dimension, with the last dimension corresponding to
+ the value `-1`.
+
+ Returns
+ -------
+ out: ndarray
+ Output array.
+
+ Examples
+ --------
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] )
+
+ > x.shape
+ [ 2, 2 ]
+ > var y = {{alias}}( x, 0 )
+
+ > y.shape
+ [ 2, 2 ]
+ > {{alias:@stdlib/ndarray/to-array}}( y )
+ [ [ 3, 4 ], [ 1, 2 ] ]
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/types/index.d.ts
new file mode 100644
index 000000000000..9c1dd3a90758
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/types/index.d.ts
@@ -0,0 +1,65 @@
+/*
+* @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 { ndarray } from '@stdlib/types/ndarray';
+
+/**
+* Returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed.
+*
+* @param x - input array
+* @param dim - index of dimension to reverse
+* @returns output array
+*
+* @example
+* var typedarray = require( '@stdlib/array/typed' );
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+*
+* var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float64' );
+* var shape = [ 3, 2 ];
+* var strides = [ 2, 1 ];
+* var offset = 0;
+*
+* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
+* // returns
+*
+* var sh = x.shape;
+* // returns [ 3, 2 ]
+*
+* var arr = ndarray2array( x );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = toReversedDimension( x, 0 );
+* // returns
+*
+* sh = y.shape;
+* // returns [ 3, 2 ]
+*
+* arr = ndarray2array( y );
+* // returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
+*/
+declare function toReversedDimension( x: T, dim: number ): T;
+
+
+// EXPORTS //
+
+export = toReversedDimension;
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/types/test.ts
new file mode 100644
index 000000000000..26584e2cabf7
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/docs/types/test.ts
@@ -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.
+*/
+
+import empty = require( '@stdlib/ndarray/base/empty' );
+import toReversedDimension = require( './index' );
+
+
+// TESTS //
+
+// The function returns an ndarray...
+{
+ const order = 'row-major';
+ const sh = [ 2, 2 ];
+
+ toReversedDimension( empty( 'float64', sh, order ), 0 ); // $ExpectType float64ndarray
+ toReversedDimension( empty( 'float32', sh, order ), 0 ); // $ExpectType float32ndarray
+ toReversedDimension( empty( 'complex128', sh, order ), 0 ); // $ExpectType complex128ndarray
+ toReversedDimension( empty( 'complex64', sh, order ), 0 ); // $ExpectType complex64ndarray
+ toReversedDimension( empty( 'int32', sh, order ), 0 ); // $ExpectType int32ndarray
+ toReversedDimension( empty( 'int16', sh, order ), 0 ); // $ExpectType int16ndarray
+ toReversedDimension( empty( 'int8', sh, order ), 0 ); // $ExpectType int8ndarray
+ toReversedDimension( empty( 'uint32', sh, order ), 0 ); // $ExpectType uint32ndarray
+ toReversedDimension( empty( 'uint16', sh, order ), 0 ); // $ExpectType uint16ndarray
+ toReversedDimension( empty( 'uint8', sh, order ), 0 ); // $ExpectType uint8ndarray
+ toReversedDimension( empty( 'uint8c', sh, order ), 0 ); // $ExpectType uint8cndarray
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an ndarray...
+{
+ toReversedDimension( '10', 0 ); // $ExpectError
+ toReversedDimension( 10, 0 ); // $ExpectError
+ toReversedDimension( false, 0 ); // $ExpectError
+ toReversedDimension( true, 0 ); // $ExpectError
+ toReversedDimension( null, 0 ); // $ExpectError
+ toReversedDimension( [], 0 ); // $ExpectError
+ toReversedDimension( {}, 0 ); // $ExpectError
+ toReversedDimension( ( x: number ): number => x, 0 ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a number...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+
+ toReversedDimension( x, '5' ); // $ExpectError
+ toReversedDimension( x, true ); // $ExpectError
+ toReversedDimension( x, false ); // $ExpectError
+ toReversedDimension( x, null ); // $ExpectError
+ toReversedDimension( x, undefined ); // $ExpectError
+ toReversedDimension( x, [ '5' ] ); // $ExpectError
+ toReversedDimension( x, {} ); // $ExpectError
+ toReversedDimension( x, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const x = empty( 'float64', [ 2, 2 ], 'row-major' );
+
+ toReversedDimension(); // $ExpectError
+ toReversedDimension( x ); // $ExpectError
+ toReversedDimension( x, 0, {} ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/examples/index.js
new file mode 100644
index 000000000000..6987c4044e70
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/examples/index.js
@@ -0,0 +1,56 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2025 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var toReversedDimension = require( './../lib' );
+
+// Create a linear ndarray buffer:
+var buf = zeroTo( 16 );
+
+// Create a three-dimensional ndarray:
+var x = array( buf, {
+ 'shape': [ 2, 4, 2 ]
+});
+
+// Reverse the order of first axis:
+var y0 = toReversedDimension( x, 0 );
+// returns
+
+var a0 = ndarray2array( y0 );
+console.log( a0 );
+// => [ [ [ 8, 9 ], [ 10, 11 ], [ 12, 13 ], [ 14, 15 ] ], [ [ 0, 1 ], [ 2, 3 ], [ 4, 5 ], [ 6, 7 ] ] ]
+
+// Reverse the order of second axis:
+var y1 = toReversedDimension( x, 1 );
+// returns
+
+var a1 = ndarray2array( y1 );
+console.log( a1 );
+// => [ [ [ 6, 7 ], [ 4, 5 ], [ 2, 3 ], [ 0, 1 ] ], [ [ 14, 15 ], [ 12, 13 ], [ 10, 11 ], [ 8, 9 ] ] ]
+
+// Reverse the order of third axis:
+var y2 = toReversedDimension( x, 2 );
+// returns
+
+var a2 = ndarray2array( y2 );
+console.log( a2 );
+// => [ [ [ 1, 0 ], [ 3, 2 ], [ 5, 4 ], [ 7, 6 ] ], [ [ 9, 8 ], [ 11, 10 ], [ 13, 12 ], [ 15, 14 ] ] ]
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/lib/index.js
new file mode 100644
index 000000000000..bf82a330d455
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/lib/index.js
@@ -0,0 +1,62 @@
+/**
+* @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';
+
+/**
+* Return a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed.
+*
+* @module @stdlib/ndarray/base/to-reversed-dimension
+*
+* @example
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+* var toReversedDimension = require( '@stdlib/ndarray/base/to-reversed-dimension' );
+*
+* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
+* var shape = [ 3, 2 ];
+* var strides = [ 2, 1 ];
+* var offset = 0;
+*
+* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
+* // returns
+*
+* var sh = x.shape;
+* // returns [ 3, 2 ]
+*
+* var arr = ndarray2array( x );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = toReversedDimension( x, 0 );
+* // returns
+*
+* sh = y.shape;
+* // returns [ 3, 2 ]
+*
+* arr = ndarray2array( y );
+* // returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/lib/main.js
new file mode 100644
index 000000000000..baaffc010488
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/lib/main.js
@@ -0,0 +1,83 @@
+/**
+* @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 emptyLike = require( '@stdlib/ndarray/base/empty-like' );
+var reverseDimension = require( '@stdlib/ndarray/base/reverse-dimension' );
+var assign = require( '@stdlib/ndarray/base/assign' );
+
+
+// MAIN //
+
+/**
+* Returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed.
+*
+* @param {ndarray} x - input array
+* @param {integer} dim - index of dimension to reverse
+* @returns {ndarray} output array
+*
+* @example
+* var ndarray = require( '@stdlib/ndarray/ctor' );
+* var ndarray2array = require( '@stdlib/ndarray/to-array' );
+*
+* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
+* var shape = [ 3, 2 ];
+* var strides = [ 2, 1 ];
+* var offset = 0;
+*
+* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
+* // returns
+*
+* var sh = x.shape;
+* // returns [ 3, 2 ]
+*
+* var arr = ndarray2array( x );
+* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
+*
+* var y = toReversedDimension( x, 0 );
+* // returns
+*
+* sh = y.shape;
+* // returns [ 3, 2 ]
+*
+* arr = ndarray2array( y );
+* // returns [ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
+*/
+function toReversedDimension( x, dim ) {
+ var out;
+ var xr;
+
+ // Create a reversed view of the input ndarray:
+ xr = reverseDimension( x, dim, false );
+
+ // Create an output ndarray with the same shape and data type as the input ndarray:
+ out = emptyLike( x );
+
+ // Assign the elements of the reversed input ndarray view to the output ndarray:
+ assign( [ xr, out ] );
+
+ return out;
+}
+
+
+// EXPORTS //
+
+module.exports = toReversedDimension;
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/package.json b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/package.json
new file mode 100644
index 000000000000..2f404992d46a
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "@stdlib/ndarray/base/to-reversed-dimension",
+ "version": "0.0.0",
+ "description": "Return a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed.",
+ "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",
+ "data",
+ "structure",
+ "vector",
+ "ndarray",
+ "matrix",
+ "reverse",
+ "dimenions",
+ "flip",
+ "numpy.flip"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/test/test.js b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/test/test.js
new file mode 100644
index 000000000000..80e6f0e06142
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/to-reversed-dimension/test/test.js
@@ -0,0 +1,343 @@
+/**
+* @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 isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var zeroTo = require( '@stdlib/array/base/zero-to' );
+var typedarray = require( '@stdlib/array/typed' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var ctor = require( '@stdlib/ndarray/ctor' );
+var toReverseDimension = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof toReverseDimension, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed (ndims=1)', function test( t ) {
+ var expected;
+ var actual;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+ var i;
+
+ buf = typedarray( zeroTo( 30 ), 'float64' );
+ sh = [ 6 ];
+ st = [ 2 ];
+ o = 4;
+ ord = 'row-major';
+
+ x = new ctor( 'float64', buf, sh, st, o, ord );
+
+ actual = toReverseDimension( x, 0 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 1, 'returns expected value' );
+ t.strictEqual( actual.length, 6, 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [ 14, 12, 10, 8, 6, 4 ];
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual.iget( i ), expected[ i ], 'returns expected value' );
+ }
+
+ actual = toReverseDimension( x, -1 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 1, 'returns expected value' );
+ t.strictEqual( actual.length, 6, 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [ 14, 12, 10, 8, 6, 4 ];
+ for ( i = 0; i < expected.length; i++ ) {
+ t.strictEqual( actual.iget( i ), expected[ i ], 'returns expected value' );
+ }
+ t.end();
+});
+
+tape( 'the function returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed (ndims=2)', function test( t ) {
+ var expected;
+ var actual;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = typedarray( zeroTo( 30 ), 'float64' );
+ sh = [ 4, 3 ];
+ st = [ 6, 2 ];
+ o = 4;
+ ord = 'row-major';
+
+ x = new ctor( 'float64', buf, sh, st, o, ord );
+
+ actual = toReverseDimension( x, 0 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 2, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [ 22, 24, 26 ],
+ [ 16, 18, 20 ],
+ [ 10, 12, 14 ],
+ [ 4, 6, 8 ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, -2 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 2, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [ 22, 24, 26 ],
+ [ 16, 18, 20 ],
+ [ 10, 12, 14 ],
+ [ 4, 6, 8 ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, 1 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 2, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [ 8, 6, 4 ],
+ [ 14, 12, 10 ],
+ [ 20, 18, 16 ],
+ [ 26, 24, 22 ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, -1 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 2, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [ 8, 6, 4 ],
+ [ 14, 12, 10 ],
+ [ 20, 18, 16 ],
+ [ 26, 24, 22 ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+ t.end();
+});
+
+tape( 'the function returns a new ndarray where the order of elements of an input ndarray along a specified dimension is reversed (ndims=3)', function test( t ) {
+ var expected;
+ var actual;
+ var buf;
+ var ord;
+ var sh;
+ var st;
+ var o;
+ var x;
+
+ buf = typedarray( zeroTo( 100 ), 'float64' );
+ sh = [ 2, 4, 3 ];
+ st = [ 24, 6, 2 ];
+ o = 10;
+ ord = 'row-major';
+
+ x = new ctor( 'float64', buf, sh, st, o, ord );
+
+ actual = toReverseDimension( x, 0 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 3, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 2, 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [
+ [ 34, 36, 38 ],
+ [ 40, 42, 44 ],
+ [ 46, 48, 50 ],
+ [ 52, 54, 56 ]
+ ],
+ [
+ [ 10, 12, 14 ],
+ [ 16, 18, 20 ],
+ [ 22, 24, 26 ],
+ [ 28, 30, 32 ]
+ ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, -3 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 3, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 2, 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [
+ [ 34, 36, 38 ],
+ [ 40, 42, 44 ],
+ [ 46, 48, 50 ],
+ [ 52, 54, 56 ]
+ ],
+ [
+ [ 10, 12, 14 ],
+ [ 16, 18, 20 ],
+ [ 22, 24, 26 ],
+ [ 28, 30, 32 ]
+ ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, 1 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 3, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 2, 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [
+ [ 28, 30, 32 ],
+ [ 22, 24, 26 ],
+ [ 16, 18, 20 ],
+ [ 10, 12, 14 ]
+ ],
+ [
+ [ 52, 54, 56 ],
+ [ 46, 48, 50 ],
+ [ 40, 42, 44 ],
+ [ 34, 36, 38 ]
+ ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, -2 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 3, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 2, 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [
+ [ 28, 30, 32 ],
+ [ 22, 24, 26 ],
+ [ 16, 18, 20 ],
+ [ 10, 12, 14 ]
+ ],
+ [
+ [ 52, 54, 56 ],
+ [ 46, 48, 50 ],
+ [ 40, 42, 44 ],
+ [ 34, 36, 38 ]
+ ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, 2 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 3, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 2, 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [
+ [ 14, 12, 10 ],
+ [ 20, 18, 16 ],
+ [ 26, 24, 22 ],
+ [ 32, 30, 28 ]
+ ],
+ [
+ [ 38, 36, 34 ],
+ [ 44, 42, 40 ],
+ [ 50, 48, 46 ],
+ [ 56, 54, 52 ]
+ ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+
+ actual = toReverseDimension( x, -1 );
+
+ t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' );
+ t.strictEqual( actual.ndims, 3, 'returns expected value' );
+ t.deepEqual( actual.shape, [ 2, 4, 3 ], 'returns expected value' );
+ t.strictEqual( actual.dtype, x.dtype, 'returns expected value' );
+ t.notEqual( actual.data, x.data, 'returns expected value' );
+
+ expected = [
+ [
+ [ 14, 12, 10 ],
+ [ 20, 18, 16 ],
+ [ 26, 24, 22 ],
+ [ 32, 30, 28 ]
+ ],
+ [
+ [ 38, 36, 34 ],
+ [ 44, 42, 40 ],
+ [ 50, 48, 46 ],
+ [ 56, 54, 52 ]
+ ]
+ ];
+ actual = ndarray2array( actual );
+ t.deepEqual( actual, expected, 'returns expected value' );
+ t.end();
+});