diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/README.md b/lib/node_modules/@stdlib/ndarray/base/rot180/README.md
new file mode 100644
index 000000000000..355490646779
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/README.md
@@ -0,0 +1,143 @@
+
+
+# rot180
+
+> Rotate an ndarray 180 degrees in a specified plane.
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var rot180 = require( '@stdlib/ndarray/base/rot180' );
+```
+
+#### rot180( x, dims, writable )
+
+Rotates an ndarray 180 degrees in a specified plane.
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+
+var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+// returns [ [ 1, 2 ], [ 3, 4 ] ]
+
+var y = rot180( x, [ 0, 1 ], false );
+// returns [ [ 4, 3 ], [ 2, 1 ] ]
+```
+
+The function accepts the following arguments:
+
+- **x**: input ndarray.
+- **dims**: dimension indices defining the plane of rotation. Must contain exactly two unique dimension indices. If a dimension index is provided as an integer less than zero, the dimension index is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`.
+- **writable**: boolean indicating whether a returned ndarray should be writable.
+
+
+
+
+
+
+
+
+
+## Notes
+
+- Each provided dimension index must reside on the interval `[-ndims, ndims-1]`.
+- The `writable` parameter **only** applies to ndarray constructors supporting **read-only** instances.
+- The returned ndarray is a **view** of the input ndarray. Accordingly, writing to the original ndarray will **mutate** the returned ndarray and vice versa.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var rot180 = require( '@stdlib/ndarray/base/rot180' );
+
+// Create a 2x3 matrix:
+var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] );
+
+// Rotate 180 degrees in the (0,1) plane:
+var y = rot180( x, [ 0, 1 ], false );
+var arr = ndarray2array( y );
+// returns [ [ 6, 5, 4 ], [ 3, 2, 1 ] ]
+
+// Supports negative dimension indices:
+y = rot180( x, [ -2, -1 ], false );
+arr = ndarray2array( y );
+// returns [ [ 6, 5, 4 ], [ 3, 2, 1 ] ]
+
+// Rotating twice returns the original arrangement:
+y = rot180( rot180( x, [ 0, 1 ], false ), [ 0, 1 ], false );
+arr = ndarray2array( y );
+// returns [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/base/rot180/benchmark/benchmark.js
new file mode 100644
index 000000000000..646c71104466
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/benchmark/benchmark.js
@@ -0,0 +1,204 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' );
+var baseEmpty = require( '@stdlib/ndarray/base/empty' );
+var empty = require( '@stdlib/ndarray/empty' );
+var format = require( '@stdlib/string/format' );
+var pkg = require( './../package.json' ).name;
+var rot180 = require( './../lib' );
+
+
+// MAIN //
+
+bench( format( '%s::base:ndims=2', pkg ), 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 = rot180( values[ i%values.length ], [ 0, 1 ], false );
+ 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( format( '%s::non-base:ndims=2', pkg ), function benchmark( b ) {
+ var values;
+ var v;
+ var i;
+
+ /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */
+
+ 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, stdlib/line-closing-bracket-spacing */
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ v = rot180( values[ i%values.length ], [ 0, 1 ], false );
+ 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( format( '%s::base:ndims=3,dims=[1,2]', pkg ), 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 = rot180( values[ i%values.length ], [ 1, 2 ], false );
+ 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( format( '%s::base:ndims=3,dims=[0,2]', pkg ), 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 = rot180( values[ i%values.length ], [ 0, 2 ], false );
+ 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( format( '%s::base:ndims=4', pkg ), 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 = rot180( values[ i%values.length ], [ 2, 3 ], false );
+ 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( format( '%s::base:ndims=5', pkg ), 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 = rot180( values[ i%values.length ], [ 3, 4 ], false );
+ 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/rot180/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/rot180/docs/repl.txt
new file mode 100644
index 000000000000..2d679135be67
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/docs/repl.txt
@@ -0,0 +1,40 @@
+
+{{alias}}( x, dims, writable )
+ Rotates an ndarray 180 degrees in a specified plane.
+
+ Each provided dimension index must reside on the interval [-ndims, ndims-1].
+
+ The returned ndarray is always a *view* of the input ndarray. Accordingly,
+ writing to the original ndarray will mutate the returned ndarray and vice
+ versa.
+
+ Parameters
+ ----------
+ x: ndarray
+ Input array.
+
+ dims: ArrayLikeObject
+ Dimension indices defining the plane of rotation. Must contain exactly
+ two unique dimension indices. If less than zero, an index is resolved
+ relative to the last dimension, with the last dimension corresponding to
+ the value `-1`.
+
+ writable: boolean
+ Boolean indicating whether a returned ndarray should be writable. This
+ parameter only applies to ndarray constructors which support read-only
+ instances.
+
+ Returns
+ -------
+ out: ndarray
+ Output array view.
+
+ Examples
+ --------
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] )
+ [ [ 1, 2 ], [ 3, 4 ] ]
+ > var y = {{alias}}( x, [ 0, 1 ], false )
+ [ [ 4, 3 ], [ 2, 1 ] ]
+
+ See Also
+ --------
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/rot180/docs/types/index.d.ts
new file mode 100644
index 000000000000..ea9c4d431296
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/docs/types/index.d.ts
@@ -0,0 +1,52 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+// TypeScript Version: 4.1
+
+///
+
+import { typedndarray } from '@stdlib/types/ndarray';
+import { Collection } from '@stdlib/types/array';
+
+/**
+* Rotates an ndarray 180 degrees in a specified plane.
+*
+* ## Notes
+*
+* - Each provided dimension index must reside on the interval `[-ndims, ndims-1]`.
+*
+* @param x - input array
+* @param dims - dimension indices defining the plane of rotation
+* @param writable - boolean indicating whether the returned ndarray should be writable
+* @returns ndarray view
+*
+* @example
+* var array = require( '@stdlib/ndarray/array' );
+*
+* var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+* // returns [ [ 1, 2 ], [ 3, 4 ] ]
+*
+* var y = rot180( x, [ 0, 1 ], false );
+* // returns [ [ 4, 3 ], [ 2, 1 ] ]
+*/
+declare function rot180 = typedndarray>( x: U, dims: Collection, writable: boolean ): U;
+
+
+// EXPORTS //
+
+export = rot180;
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/rot180/docs/types/test.ts
new file mode 100644
index 000000000000..3c62f72e826e
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/docs/types/test.ts
@@ -0,0 +1,90 @@
+/*
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import zeros = require( '@stdlib/ndarray/base/zeros' );
+import rot180 = require( './index' );
+
+
+// TESTS //
+
+// The function returns an ndarray...
+{
+ const sh = [ 2, 2 ];
+ const ord = 'row-major';
+
+ rot180( zeros( 'float64', sh, ord ), [ 0, 1 ], false ); // $ExpectType float64ndarray
+ rot180( zeros( 'float32', sh, ord ), [ 0, 1 ], false ); // $ExpectType float32ndarray
+ rot180( zeros( 'complex128', sh, ord ), [ 0, 1 ], false ); // $ExpectType complex128ndarray
+ rot180( zeros( 'complex64', sh, ord ), [ 0, 1 ], false ); // $ExpectType complex64ndarray
+ rot180( zeros( 'int32', sh, ord ), [ 0, 1 ], false ); // $ExpectType int32ndarray
+ rot180( zeros( 'int16', sh, ord ), [ 0, 1 ], false ); // $ExpectType int16ndarray
+ rot180( zeros( 'int8', sh, ord ), [ 0, 1 ], false ); // $ExpectType int8ndarray
+ rot180( zeros( 'uint32', sh, ord ), [ 0, 1 ], false ); // $ExpectType uint32ndarray
+ rot180( zeros( 'uint16', sh, ord ), [ 0, 1 ], false ); // $ExpectType uint16ndarray
+ rot180( zeros( 'uint8', sh, ord ), [ 0, 1 ], false ); // $ExpectType uint8ndarray
+ rot180( zeros( 'uint8c', sh, ord ), [ 0, 1 ], false ); // $ExpectType uint8cndarray
+ rot180( zeros( 'generic', sh, ord ), [ 0, 1 ], false ); // $ExpectType genericndarray
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an ndarray...
+{
+ rot180( '10', [ 0, 1 ], false ); // $ExpectError
+ rot180( 10, [ 0, 1 ], false ); // $ExpectError
+ rot180( false, [ 0, 1 ], false ); // $ExpectError
+ rot180( true, [ 0, 1 ], false ); // $ExpectError
+ rot180( null, [ 0, 1 ], false ); // $ExpectError
+ rot180( void 0, [ 0, 1 ], false ); // $ExpectError
+ rot180( [], [ 0, 1 ], false ); // $ExpectError
+ rot180( {}, [ 0, 1 ], false ); // $ExpectError
+ rot180( ( x: number ): number => x, [ 0, 1 ], false ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not a collection of numbers...
+{
+ const x = zeros( 'float64', [ 2, 2 ], 'row-major' );
+
+ rot180( x, '10', false ); // $ExpectError
+ rot180( x, 10, false ); // $ExpectError
+ rot180( x, false, false ); // $ExpectError
+ rot180( x, true, false ); // $ExpectError
+ rot180( x, null, false ); // $ExpectError
+ rot180( x, void 0, false ); // $ExpectError
+ rot180( x, {}, false ); // $ExpectError
+ rot180( x, ( x: number ): number => x, false ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not a boolean...
+{
+ const x = zeros( 'float64', [ 2, 2 ], 'row-major' );
+
+ rot180( x, [ 0, 1 ], '10' ); // $ExpectError
+ rot180( x, [ 0, 1 ], 10 ); // $ExpectError
+ rot180( x, [ 0, 1 ], null ); // $ExpectError
+ rot180( x, [ 0, 1 ], void 0 ); // $ExpectError
+ rot180( x, [ 0, 1 ], [] ); // $ExpectError
+ rot180( x, [ 0, 1 ], {} ); // $ExpectError
+ rot180( x, [ 0, 1 ], ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ rot180(); // $ExpectError
+ rot180( zeros( 'float64', [ 2, 2 ], 'row-major' ) ); // $ExpectError
+ rot180( zeros( 'float64', [ 2, 2 ], 'row-major' ), [ 0, 1 ] ); // $ExpectError
+ rot180( zeros( 'float64', [ 2, 2 ], 'row-major' ), [ 0, 1 ], false, {} ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/rot180/examples/index.js
new file mode 100644
index 000000000000..25d385bddb6a
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/examples/index.js
@@ -0,0 +1,41 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var rot180 = require( './../lib' );
+
+// Create a 2x3 matrix:
+var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] );
+
+// Rotate 180 degrees in the (0,1) plane:
+var y = rot180( x, [ 0, 1 ], false );
+console.log( ndarray2array( y ) );
+// => [ [ 6, 5, 4 ], [ 3, 2, 1 ] ]
+
+// Supports negative dimension indices:
+y = rot180( x, [ -2, -1 ], false );
+console.log( ndarray2array( y ) );
+// => [ [ 6, 5, 4 ], [ 3, 2, 1 ] ]
+
+// Rotating twice returns the original arrangement:
+y = rot180( rot180( x, [ 0, 1 ], false ), [ 0, 1 ], false );
+console.log( ndarray2array( y ) );
+// => [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/rot180/lib/index.js
new file mode 100644
index 000000000000..2ee490dba3f0
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/lib/index.js
@@ -0,0 +1,44 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+/**
+* Rotate an ndarray 180 degrees in a specified plane.
+*
+* @module @stdlib/ndarray/base/rot180
+*
+* @example
+* var array = require( '@stdlib/ndarray/array' );
+* var rot180 = require( '@stdlib/ndarray/base/rot180' );
+*
+* var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+* // returns [ [ 1, 2 ], [ 3, 4 ] ]
+*
+* var y = rot180( x, [ 0, 1 ], false );
+* // returns [ [ 4, 3 ], [ 2, 1 ] ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/rot180/lib/main.js
new file mode 100644
index 000000000000..57e1d8cc1be2
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/lib/main.js
@@ -0,0 +1,52 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var rot90 = require( '@stdlib/ndarray/base/rot90' );
+
+
+// MAIN //
+
+/**
+* Rotates an ndarray 180 degrees in a specified plane.
+*
+* @param {ndarray} x - input array
+* @param {IntegerArray} dims - dimension indices defining the plane of rotation
+* @param {boolean} writable - boolean indicating whether the returned ndarray should be writable
+* @returns {ndarray} ndarray view
+*
+* @example
+* var array = require( '@stdlib/ndarray/array' );
+*
+* var x = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+* // returns [ [ 1, 2 ], [ 3, 4 ] ]
+*
+* var y = rot180( x, [ 0, 1 ], false );
+* // returns [ [ 4, 3 ], [ 2, 1 ] ]
+*/
+function rot180( x, dims, writable ) {
+ return rot90( x, dims, 2, writable );
+}
+
+
+// EXPORTS //
+
+module.exports = rot180;
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/package.json b/lib/node_modules/@stdlib/ndarray/base/rot180/package.json
new file mode 100644
index 000000000000..9fe612b13b20
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "@stdlib/ndarray/base/rot180",
+ "version": "0.0.0",
+ "description": "Rotate an ndarray 180 degrees in a specified plane.",
+ "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",
+ "ndarray",
+ "matrix",
+ "rotate",
+ "rotation",
+ "rot180",
+ "plane",
+ "axis",
+ "view"
+ ]
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/rot180/test/test.js b/lib/node_modules/@stdlib/ndarray/base/rot180/test/test.js
new file mode 100644
index 000000000000..b6565d376b40
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/rot180/test/test.js
@@ -0,0 +1,471 @@
+/**
+* @license Apache-2.0
+*
+* Copyright (c) 2026 The Stdlib Authors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+'use strict';
+
+// MODULES //
+
+var tape = require( 'tape' );
+var Float64Array = require( '@stdlib/array/float64' );
+var Float32Array = require( '@stdlib/array/float32' );
+var Complex128Array = require( '@stdlib/array/complex128' );
+var Complex64Array = require( '@stdlib/array/complex64' );
+var real = require( '@stdlib/complex/float64/real' );
+var imag = require( '@stdlib/complex/float64/imag' );
+var realf = require( '@stdlib/complex/float32/real' );
+var imagf = require( '@stdlib/complex/float32/imag' );
+var instanceOf = require( '@stdlib/assert/instance-of' );
+var isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );
+var base = require( '@stdlib/ndarray/base/ctor' );
+var ndarray = require( '@stdlib/ndarray/ctor' );
+var array = require( '@stdlib/ndarray/array' );
+var ndarray2array = require( '@stdlib/ndarray/to-array' );
+var getData = require( '@stdlib/ndarray/data-buffer' );
+var getDType = require( '@stdlib/ndarray/dtype' );
+var getOrder = require( '@stdlib/ndarray/order' );
+var getShape = require( '@stdlib/ndarray/shape' );
+var rot180 = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof rot180, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function throws an error if provided an input ndarray with fewer than two dimensions', function test( t ) {
+ var values;
+ var i;
+
+ values = [
+ new base( 'float64', new Float64Array( [ 5.0 ] ), [], [ 0 ], 0, 'row-major' ),
+ new base( 'float64', new Float64Array( [ 1.0, 2.0, 3.0 ] ), [ 3 ], [ 1 ], 0, 'row-major' )
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided an input ndarray with '+values[ i ].ndims+' dimensions' );
+ }
+ t.end();
+
+ function badValue( x ) {
+ return function badValue() {
+ rot180( x, [ 0, 1 ], false );
+ };
+ }
+});
+
+tape( 'the function throws an error if not provided exactly two dimension indices', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = new base( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
+
+ values = [
+ [],
+ [ 0 ],
+ [ 0, 1, 0 ],
+ [ 0, 1, 0, 1 ]
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided '+values[ i ].length+' dimension indices' );
+ }
+ t.end();
+
+ function badValue( dims ) {
+ return function badValue() {
+ rot180( x, dims, false );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided out-of-bounds dimension indices', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = new base( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ), [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
+
+ values = [
+ [ 0, 2 ],
+ [ 2, 0 ],
+ [ -3, 0 ],
+ [ 0, -3 ],
+ [ 10, 0 ],
+ [ 0, 10 ]
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided dimension indices ['+values[ i ]+']' );
+ }
+ t.end();
+
+ function badValue( dims ) {
+ return function badValue() {
+ rot180( x, dims, false );
+ };
+ }
+});
+
+tape( 'the function throws an error if provided duplicate dimension indices', function test( t ) {
+ var values;
+ var x;
+ var i;
+
+ x = new base( 'float64', new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ), [ 2, 2, 2 ], [ 4, 2, 1 ], 0, 'row-major' );
+
+ values = [
+ [ 0, 0 ],
+ [ 1, 1 ],
+ [ 2, 2 ],
+ [ 0, -3 ],
+ [ -2, 1 ],
+ [ -1, 2 ]
+ ];
+ for ( i = 0; i < values.length; i++ ) {
+ t.throws( badValue( values[ i ] ), Error, 'throws an error when provided dimension indices ['+values[ i ]+']' );
+ }
+ t.end();
+
+ function badValue( dims ) {
+ return function badValue() {
+ rot180( x, dims, false );
+ };
+ }
+});
+
+tape( 'the function rotates a matrix 180 degrees in a specified plane (dtype=float64, base, row-major)', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = new base( 'float64', buf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
+
+ arr = rot180( x, [ 0, 1 ], false );
+ t.strictEqual( instanceOf( arr, base ), true, 'returns expected value' );
+ t.strictEqual( String( getDType( arr ) ), String( getDType( x ) ), 'returns expected value' );
+ t.deepEqual( getShape( arr ), [ 2, 3 ], 'returns expected value' );
+ t.strictEqual( getData( arr ), getData( x ), 'returns expected value' );
+ t.strictEqual( getOrder( arr ), getOrder( x ), 'returns expected value' );
+ t.notEqual( arr, x, 'returns expected value' );
+ expected = [ [ 6.0, 5.0, 4.0 ], [ 3.0, 2.0, 1.0 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function rotates a matrix 180 degrees in a specified plane (dtype=float64, base, column-major)', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = new base( 'float64', buf, [ 2, 3 ], [ 1, 2 ], 0, 'column-major' );
+
+ // In column-major with strides [1,2], x = [ [ 1.0, 3.0, 5.0 ], [ 2.0, 4.0, 6.0 ] ]
+
+ arr = rot180( x, [ 0, 1 ], false );
+ t.deepEqual( getShape( arr ), [ 2, 3 ], 'returns expected value' );
+ t.strictEqual( getData( arr ), getData( x ), 'returns expected value' );
+ expected = [ [ 6.0, 4.0, 2.0 ], [ 5.0, 3.0, 1.0 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function rotates a matrix 180 degrees in a specified plane (dtype=float64, non-base)', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = array( buf, {
+ 'shape': [ 2, 3 ],
+ 'dtype': 'float64'
+ });
+
+ arr = rot180( x, [ 0, 1 ], false );
+ t.strictEqual( instanceOf( arr, ndarray ), true, 'returns expected value' );
+ t.strictEqual( isReadOnly( arr ), true, 'returns expected value' );
+ expected = [ [ 6.0, 5.0, 4.0 ], [ 3.0, 2.0, 1.0 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function rotates a matrix 180 degrees in a specified plane (dtype=float32)', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = new base( 'float32', buf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
+
+ arr = rot180( x, [ 0, 1 ], false );
+ t.strictEqual( String( getDType( arr ) ), String( getDType( x ) ), 'returns expected value' );
+ t.deepEqual( getShape( arr ), [ 2, 3 ], 'returns expected value' );
+ expected = [ [ 6.0, 5.0, 4.0 ], [ 3.0, 2.0, 1.0 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function rotates a matrix 180 degrees in a specified plane (dtype=complex128, base)', function test( t ) {
+ var arr;
+ var buf;
+ var v;
+ var x;
+
+ buf = new Complex128Array([
+ 1.0,
+ 1.0,
+ 2.0,
+ 2.0,
+ 3.0,
+ 3.0,
+ 4.0,
+ 4.0
+ ]);
+ x = new base( 'complex128', buf, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
+
+ // Original matrix: [ [ 1+1i, 2+2i ], [ 3+3i, 4+4i ] ].
+
+ // After 180 rotation: [ [ 4+4i, 3+3i ], [ 2+2i, 1+1i ] ]
+
+ arr = rot180( x, [ 0, 1 ], false );
+ t.strictEqual( String( getDType( arr ) ), String( getDType( x ) ), 'returns expected value' );
+ t.deepEqual( getShape( arr ), [ 2, 2 ], 'returns expected value' );
+
+ v = arr.get( 0, 0 );
+ t.strictEqual( real( v ), 4.0, 'returns expected value' );
+ t.strictEqual( imag( v ), 4.0, 'returns expected value' );
+ v = arr.get( 0, 1 );
+ t.strictEqual( real( v ), 3.0, 'returns expected value' );
+ t.strictEqual( imag( v ), 3.0, 'returns expected value' );
+ v = arr.get( 1, 0 );
+ t.strictEqual( real( v ), 2.0, 'returns expected value' );
+ t.strictEqual( imag( v ), 2.0, 'returns expected value' );
+ v = arr.get( 1, 1 );
+ t.strictEqual( real( v ), 1.0, 'returns expected value' );
+ t.strictEqual( imag( v ), 1.0, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function rotates a matrix 180 degrees in a specified plane (dtype=complex64, base)', function test( t ) {
+ var arr;
+ var buf;
+ var v;
+ var x;
+
+ buf = new Complex64Array([
+ 1.0,
+ 1.0,
+ 2.0,
+ 2.0,
+ 3.0,
+ 3.0,
+ 4.0,
+ 4.0
+ ]);
+ x = new base( 'complex64', buf, [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );
+
+ arr = rot180( x, [ 0, 1 ], false );
+ t.strictEqual( String( getDType( arr ) ), String( getDType( x ) ), 'returns expected value' );
+ t.deepEqual( getShape( arr ), [ 2, 2 ], 'returns expected value' );
+
+ v = arr.get( 0, 0 );
+ t.strictEqual( realf( v ), 4.0, 'returns expected value' );
+ t.strictEqual( imagf( v ), 4.0, 'returns expected value' );
+ v = arr.get( 1, 1 );
+ t.strictEqual( realf( v ), 1.0, 'returns expected value' );
+ t.strictEqual( imagf( v ), 1.0, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function rotates a matrix 180 degrees in a specified plane (dtype=generic)', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = [ 1, 2, 3, 4, 5, 6 ];
+ x = new base( 'generic', buf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
+
+ arr = rot180( x, [ 0, 1 ], false );
+ expected = [ [ 6, 5, 4 ], [ 3, 2, 1 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports negative dimension indices', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = new base( 'float64', buf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
+
+ // dims=[-2,-1] should be equivalent to dims=[0,1]:
+ arr = rot180( x, [ -2, -1 ], false );
+ expected = [ [ 6.0, 5.0, 4.0 ], [ 3.0, 2.0, 1.0 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ // dims=[0,-1]:
+ arr = rot180( x, [ 0, -1 ], false );
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ // dims=[-1,0] (order does not matter for 180 degrees):
+ arr = rot180( x, [ -1, 0 ], false );
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function produces the same result regardless of dimension order', function test( t ) {
+ var expected;
+ var arr1;
+ var arr2;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = new base( 'float64', buf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
+
+ arr1 = rot180( x, [ 0, 1 ], false );
+ arr2 = rot180( x, [ 1, 0 ], false );
+
+ expected = [ [ 6.0, 5.0, 4.0 ], [ 3.0, 2.0, 1.0 ] ];
+ t.deepEqual( ndarray2array( arr1 ), expected, 'returns expected value' );
+ t.deepEqual( ndarray2array( arr2 ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports a stack of matrices when rotating in the last two dimensions', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
+ x = new base( 'generic', buf, [ 2, 2, 3 ], [ 6, 3, 1 ], 0, 'row-major' );
+
+ arr = rot180( x, [ 1, 2 ], false );
+ t.deepEqual( getShape( arr ), [ 2, 2, 3 ], 'returns expected value' );
+ expected = [
+ [ [ 6, 5, 4 ], [ 3, 2, 1 ] ],
+ [ [ 12, 11, 10 ], [ 9, 8, 7 ] ]
+ ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports rotation in arbitrary planes for higher-dimensional ndarrays', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
+ x = new base( 'generic', buf, [ 2, 2, 3 ], [ 6, 3, 1 ], 0, 'row-major' );
+
+ // dims=[0,1]:
+ arr = rot180( x, [ 0, 1 ], false );
+ t.deepEqual( getShape( arr ), [ 2, 2, 3 ], 'returns expected value' );
+ expected = [
+ [ [ 10, 11, 12 ], [ 7, 8, 9 ] ],
+ [ [ 4, 5, 6 ], [ 1, 2, 3 ] ]
+ ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ // dims=[0,2]:
+ arr = rot180( x, [ 0, 2 ], false );
+ t.deepEqual( getShape( arr ), [ 2, 2, 3 ], 'returns expected value' );
+ expected = [
+ [ [ 9, 8, 7 ], [ 12, 11, 10 ] ],
+ [ [ 3, 2, 1 ], [ 6, 5, 4 ] ]
+ ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports a `writable` parameter', function test( t ) {
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
+ x = array( buf, {
+ 'shape': [ 2, 2 ],
+ 'dtype': 'float64'
+ });
+
+ arr = rot180( x, [ 0, 1 ], false );
+ t.strictEqual( isReadOnly( arr ), true, 'returns expected value' );
+
+ arr = rot180( x, [ 0, 1 ], true );
+ t.strictEqual( isReadOnly( arr ), false, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports a non-zero offset', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = new base( 'float64', buf, [ 2, 3 ], [ 3, 1 ], 2, 'row-major' );
+
+ arr = rot180( x, [ 0, 1 ], false );
+ expected = [ [ 6.0, 5.0, 4.0 ], [ 3.0, 2.0, 1.0 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function supports rotating twice in the same plane, returning the original arrangement', function test( t ) {
+ var expected;
+ var arr;
+ var buf;
+ var x;
+
+ buf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
+ x = new base( 'float64', buf, [ 2, 3 ], [ 3, 1 ], 0, 'row-major' );
+
+ arr = rot180( x, [ 0, 1 ], false );
+ arr = rot180( arr, [ 0, 1 ], false );
+
+ expected = [ [ 1.0, 2.0, 3.0 ], [ 4.0, 5.0, 6.0 ] ];
+ t.deepEqual( ndarray2array( arr ), expected, 'returns expected value' );
+ t.strictEqual( getData( arr ), getData( x ), 'returns expected value' );
+
+ t.end();
+});