diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/README.md
new file mode 100644
index 000000000000..d2979575960e
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/README.md
@@ -0,0 +1,157 @@
+
+
+# ternaryLoopOrder
+
+> Reorder ndarray dimensions and associated strides for loop interchange.
+
+
+
+
+
+
+
+
+
+
+
+## Usage
+
+```javascript
+var ternaryLoopOrder = require( '@stdlib/ndarray/base/binary-loop-interchange-order' );
+```
+
+#### ternaryLoopOrder( shape, stridesW, stridesX, stridesY, stridesZ )
+
+Reorders [ndarray][@stdlib/ndarray/ctor] dimensions and associated strides for [loop interchange][loop-interchange].
+
+```javascript
+// Define an array shape:
+var shape = [ 2, 2 ];
+
+// Define the strides for the input arrays:
+var stridesW = [ 2, 1 ]; // row-major
+var stridesX = [ 4, 2 ]; // row-major
+var stridesY = [ 1, 2 ]; // column-major
+
+// Define the strides for the output array:
+var stridesZ = [ 1, 2 ]; // column-major
+
+// Resolve the loop interchange order:
+var o = ternaryLoopOrder( shape, stridesW, stridesX, stridesY, stridesZ );
+// returns {...}
+```
+
+The function returns an object having the following properties:
+
+- **sh**: ordered dimensions.
+- **sw**: first input array strides sorted in loop order.
+- **sx**: second input array strides sorted in loop order.
+- **sy**: third input array strides sorted in loop order.
+- **sz**: output array strides sorted in loop order.
+
+For all returned arrays, the first element corresponds to the innermost loop, and the last element corresponds to the outermost loop.
+
+
+
+
+
+
+
+
+
+## Notes
+
+- When iterating over the elements of a multi-dimensional array, accessing elements which are closer in memory can improve performance. To this end, [loop interchange][loop-interchange] is a technique used in [loop nest optimization][loop-nest-optimization] to improve locality of reference and take advantage of CPU cache.
+
+ The purpose of this function is to order [ndarray][@stdlib/ndarray/ctor] dimensions according to the magnitude of array strides. By using the ordered dimensions and associated strides, one can construct nested loops (one for each dimension) such that the innermost loop iterates over the dimension in which array elements are closest in memory and the outermost loop iterates over the dimension in which array elements are farthest apart in memory. As a consequence, element iteration is optimized to minimize cache misses and ensure locality of reference.
+
+- Cache performance may be degraded if the layout order (i.e., row-major or column-major) differs for the input and output [ndarrays][@stdlib/ndarray/ctor]. This function is intended to optimize cache performance for the most common layout order. Accordingly, if the output [ndarray][@stdlib/ndarray/ctor] has a different layout order (e.g., if the input [ndarrays][@stdlib/ndarray/ctor] are row-major and the output [ndarray][@stdlib/ndarray/ctor] is column-major), cache misses are likely for the output [ndarray][@stdlib/ndarray/ctor]. In general, to ensure best performance, input and output [ndarrays][@stdlib/ndarray/ctor] should have the same layout order.
+
+- The function assumes that the input and output [ndarrays][@stdlib/ndarray/ctor] have the same shape. Hence, loop interchange order should only be determined **after** broadcasting.
+
+
+
+
+
+
+
+
+
+## Examples
+
+
+
+
+
+```javascript
+var array = require( '@stdlib/ndarray/array' );
+var getShape = require( '@stdlib/ndarray/shape' );
+var getStrides = require( '@stdlib/ndarray/strides' );
+var ternaryLoopOrder = require( '@stdlib/ndarray/base/binary-loop-interchange-order' );
+
+// Create ndarrays:
+var w = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+var x = array( [ [ 5, 6 ], [ 7, 8 ] ] );
+var y = array( [ [ 9, 10 ], [ 11, 12 ] ] );
+var z = array( [ [ 0, 0 ], [ 0, 0 ] ] );
+
+// Resolve loop interchange data:
+var o = ternaryLoopOrder( getShape( w ), getStrides( w ), getStrides( x ), getStrides( y ), getStrides( z ) );
+// returns {...}
+
+console.log( o );
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[loop-interchange]: https://en.wikipedia.org/wiki/Loop_interchange
+
+[loop-nest-optimization]: https://en.wikipedia.org/wiki/Loop_nest_optimization
+
+[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/ctor
+
+
+
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/benchmark/benchmark.js b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/benchmark/benchmark.js
new file mode 100644
index 000000000000..e93e9b4f3530
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/benchmark/benchmark.js
@@ -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.
+*/
+
+'use strict';
+
+// MODULES //
+
+var bench = require( '@stdlib/bench' );
+var isArray = require( '@stdlib/assert/is-array' );
+var shape2strides = require( '@stdlib/ndarray/base/shape2strides' );
+var pkg = require( './../package.json' ).name;
+var ternaryLoopOrder = require( './../lib' );
+
+
+// MAIN //
+
+bench( pkg+'::row-major', function benchmark( b ) {
+ var strides;
+ var factors;
+ var shape;
+ var out;
+ var i;
+
+ shape = [ 10, 10, 10 ];
+ strides = shape2strides( shape, 'row-major' );
+ factors = [
+ -1,
+ 1
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ strides[ i%shape.length ] *= factors[ i%factors.length ];
+ out = ternaryLoopOrder( shape, strides, strides, strides, strides );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isArray( out.sh ) || !isArray( out.sx ) || !isArray( out.sy ) || !isArray( out.sz ) ) { // eslint-disable-line max-len
+ b.fail( 'should return an array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
+
+bench( pkg+'::column-major', function benchmark( b ) {
+ var strides;
+ var factors;
+ var shape;
+ var out;
+ var i;
+
+ shape = [ 10, 10, 10 ];
+ strides = shape2strides( shape, 'column-major' );
+ factors = [
+ -1,
+ 1
+ ];
+
+ b.tic();
+ for ( i = 0; i < b.iterations; i++ ) {
+ strides[ i%shape.length ] *= factors[ i%factors.length ];
+ out = ternaryLoopOrder( shape, strides, strides, strides, strides );
+ if ( typeof out !== 'object' ) {
+ b.fail( 'should return an object' );
+ }
+ }
+ b.toc();
+ if ( !isArray( out.sh ) || !isArray( out.sx ) || !isArray( out.sy ) || !isArray( out.sz ) ) { // eslint-disable-line max-len
+ b.fail( 'should return an array' );
+ }
+ b.pass( 'benchmark finished' );
+ b.end();
+});
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/repl.txt
new file mode 100644
index 000000000000..3a873ab6aba8
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/repl.txt
@@ -0,0 +1,67 @@
+
+{{alias}}( shape, stridesW, stridesX, stridesY, stridesZ )
+ Reorders ndarray dimensions and associated strides for loop interchange.
+
+ The function returns an object having the following properties:
+
+ - sh: ordered dimensions.
+ - sw: first input array strides sorted in loop order.
+ - sx: second input array strides sorted in loop order.
+ - sy: third input array strides sorted in loop order.
+ - sz: output array strides sorted in loop order.
+
+ For all returned arrays, the first element corresponds to the innermost
+ loop, and the last element corresponds to the outermost loop.
+
+ The function assumes that the input and output ndarrays have the same shape.
+ Hence, loop interchange order should only be determined after broadcasting.
+
+ Parameters
+ ----------
+ shape: ArrayLikeObject
+ Array dimensions.
+
+ stridesW: ArrayLikeObject
+ First input array strides.
+
+ stridesX: ArrayLikeObject
+ Second input array strides.
+
+ stridesY: ArrayLikeObject
+ Third input array strides.
+
+ stridesZ: ArrayLikeObject
+ Output array strides.
+
+ Returns
+ -------
+ out: Object
+ Loop interchange data.
+
+ out.sh: Array
+ Ordered dimensions.
+
+ out.sw: Array
+ First input array strides sorted in loop order.
+
+ out.sx: Array
+ Second input array strides sorted in loop order.
+
+ out.sy: Array
+ Third input array strides sorted in loop order.
+
+ out.sz: Array
+ Output array strides sorted in loop order.
+
+ Examples
+ --------
+ > var w = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] );
+ > var x = {{alias:@stdlib/ndarray/array}}( [ [ 5, 6 ], [ 7, 8 ] ] );
+ > var y = {{alias:@stdlib/ndarray/array}}( [ [ 9, 10 ], [ 11, 12 ] ] );
+ > var z = {{alias:@stdlib/ndarray/array}}( [ [ 0, 0 ], [ 0, 0 ] ] );
+ > var o = {{alias}}( w.shape, w.strides, x.strides, y.strides, z.strides )
+ {...}
+
+ See Also
+ --------
+
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/types/index.d.ts
new file mode 100644
index 000000000000..18188f2b6264
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/types/index.d.ts
@@ -0,0 +1,114 @@
+/*
+* @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 { ArrayLike } from '@stdlib/types/array';
+
+/**
+* Interface describing loop interchange data.
+*/
+interface LoopOrderObject {
+ /**
+ * Dimensions sorted in loop order.
+ */
+ sh: Array;
+
+ /**
+ * First input array strides sorted in loop order.
+ */
+ sw: Array;
+
+ /**
+ * Second input array strides sorted in loop order.
+ */
+ sx: Array;
+
+ /**
+ * Third input array strides sorted in loop order.
+ */
+ sy: Array;
+
+ /**
+ * Output array strides sorted in loop order.
+ */
+ sz: Array;
+}
+
+/**
+* Reorders ndarray dimensions and associated strides for loop interchange.
+*
+* ## Notes
+*
+* - The returned object has the following properties:
+*
+* - **sh**: dimensions sorted in loop order.
+* - **sw**: first input ndarray strides sorted in loop order.
+* - **sx**: second input ndarray strides sorted in loop order.
+* - **sy**: third input ndarray strides sorted in loop order.
+* - **sz**: output ndarray strides sorted in loop order.
+*
+* - When iterating over the elements of a multi-dimensional array, accessing elements which are closer in memory can improve performance. To this end, loop interchange is a technique used in loop nest optimization to improve locality of reference and take advantage of CPU cache.
+*
+* The purpose of this function is to order ndarray dimensions according to the magnitude of array strides. By using the ordered dimensions and associated strides, one can construct nested loops (one for each dimension) such that the innermost loop iterates over the dimension in which array elements are closest in memory and the outermost loop iterates over the dimension in which array elements are farthest apart in memory. As a consequence, element iteration is optimized to minimize cache misses and ensure locality of reference.
+*
+* - Cache performance may be degraded if the layout order (i.e., row-major or column-major) differs for the input and output ndarrays. This function is intended to optimize cache performance for the most common layout order. Accordingly, if the output ndarray has a different layout order (e.g., if the input ndarrays are row-major and the output ndarray is column-major), cache misses are likely for the output ndarray. In general, to ensure best performance, input and output ndarrays should have the same layout order.
+*
+* - The function assumes that the input and output ndarrays have the same shape. Hence, loop interchange order should only be determined **after** broadcasting.
+*
+* @param shape - array dimensions
+* @param stridesW - first input array stride lengths
+* @param stridesX - second input array stride lengths
+* @param stridesY - third input array stride lengths
+* @param stridesZ - output array stride lengths
+* @returns loop interchange data
+*
+* @example
+* var sh = [ 2, 3, 4 ];
+*
+* var sw = [ 12, 4, 1 ]; // row-major
+* var sx = [ 24, 8, 1 ]; // row-major
+* var sy = [ 1, 4, 12 ]; // column-major
+* var sz = [ 1, -2, 6 ]; // column-major
+*
+* var o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+* // returns {...}
+*
+* var ssh = o.sh;
+* // returns [ 2, 3, 4 ]
+*
+* var ssw = o.sw;
+* // returns [ 12, 4, 1 ]
+*
+* var ssx = o.sx;
+* // returns [ 24, 8, 1 ]
+*
+* var ssy = o.sy;
+* // returns [ 1, 4, 12 ]
+*
+* var ssz = o.sz;
+* // returns [ 1, -2, 6 ]
+*/
+declare function ternaryLoopOrder( shape: ArrayLike, stridesW: ArrayLike, stridesX: ArrayLike, stridesY: ArrayLike, stridesZ: ArrayLike ): LoopOrderObject;
+
+
+// EXPORTS //
+
+export = ternaryLoopOrder;
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/types/test.ts b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/types/test.ts
new file mode 100644
index 000000000000..30b6739a08bb
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/docs/types/test.ts
@@ -0,0 +1,116 @@
+/*
+* @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 ternaryLoopOrder = require( './index' );
+
+
+// TESTS //
+
+// The function returns an object...
+{
+ const sh = [ 2, 2 ];
+ const sw = [ 2, 1 ];
+ const sx = [ 2, 1 ];
+ const sy = [ 2, 1 ];
+ const sz = [ 4, 2 ];
+ ternaryLoopOrder( sh, sw, sx, sy, sz ); // $ExpectType LoopOrderObject
+}
+
+// The compiler throws an error if the function is provided a first argument which is not an array-like object of numbers...
+{
+ const sw = [ 2, 1 ];
+ const sx = [ 2, 1 ];
+ const sy = [ 2, 1 ];
+ const sz = [ 4, 2 ];
+ ternaryLoopOrder( true, sw, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( false, sw, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( '5', sw, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( 123, sw, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( {}, sw, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( ( x: number ): number => x, sw, sx, sy, sz ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a second argument which is not an array-like object of numbers...
+{
+ const sh = [ 2, 2 ];
+ const sx = [ 2, 1 ];
+ const sy = [ 2, 1 ];
+ const sz = [ 4, 2 ];
+ ternaryLoopOrder( sh, true, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, false, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, '5', sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, 123, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, {}, sx, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, ( x: number ): number => x, sx, sy, sz ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a third argument which is not an array-like object of numbers...
+{
+ const sh = [ 2, 2 ];
+ const sw = [ 2, 1 ];
+ const sy = [ 2, 1 ];
+ const sz = [ 4, 2 ];
+ ternaryLoopOrder( sh, sw, true, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, false, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, '5', sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, 123, sy, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, {}, sy, sz ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a fourth argument which is not an array-like object of numbers...
+{
+ const sh = [ 2, 2 ];
+ const sw = [ 2, 1 ];
+ const sx = [ 2, 1 ];
+ const sz = [ 4, 2 ];
+ ternaryLoopOrder( sh, sw, sx, true, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, false, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, '5', sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, 123, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, {}, sz ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, ( x: number ): number => x, sz ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided a fifth argument which is not an array-like object of numbers...
+{
+ const sh = [ 2, 2 ];
+ const sw = [ 2, 1 ];
+ const sx = [ 2, 1 ];
+ const sy = [ 2, 1 ];
+ ternaryLoopOrder( sh, sw, sx, sy, true ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, sy, false ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, sy, '5' ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, sy, 123 ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, sy, {} ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, sy, ( x: number ): number => x ); // $ExpectError
+}
+
+// The compiler throws an error if the function is provided an unsupported number of arguments...
+{
+ const sh = [ 2, 2 ];
+ const sw = [ 2, 1 ];
+ const sx = [ 2, 1 ];
+ const sy = [ 2, 1 ];
+ const sz = [ 4, 2 ];
+ ternaryLoopOrder(); // $ExpectError
+ ternaryLoopOrder( sh ); // $ExpectError
+ ternaryLoopOrder( sh, sw ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, sy ); // $ExpectError
+ ternaryLoopOrder( sh, sw, sx, sy, sz, [] ); // $ExpectError
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/examples/index.js b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/examples/index.js
new file mode 100644
index 000000000000..931d670677b2
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/examples/index.js
@@ -0,0 +1,36 @@
+/**
+* @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 getShape = require( '@stdlib/ndarray/shape' );
+var getStrides = require( '@stdlib/ndarray/strides' );
+var loopOrder = require( './../lib' );
+
+// Create ndarrays:
+var w = array( [ [ 1, 2 ], [ 3, 4 ] ] );
+var x = array( [ [ 5, 6 ], [ 7, 8 ] ] );
+var y = array( [ [ 9, 10 ], [ 11, 12 ] ] );
+var z = array( [ [ 0, 0 ], [ 0, 0 ] ] );
+
+// Resolve loop interchange data:
+var o = loopOrder( getShape( w ), getStrides( w ), getStrides( x ), getStrides( y ), getStrides( z ) ); // eslint-disable-line max-len
+// returns {...}
+
+console.log( o );
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/lib/index.js
new file mode 100644
index 000000000000..cb77e64f45e4
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/lib/index.js
@@ -0,0 +1,62 @@
+/**
+* @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';
+
+/**
+* Reorder ndarray dimensions and associated strides for loop interchange.
+*
+* @module @stdlib/ndarray/base/ternary-loop-interchange-order
+*
+* @example
+* var ternaryLoopOrder = require( '@stdlib/ndarray/base/ternary-loop-interchange-order' );
+*
+* var sh = [ 2, 3, 4 ];
+*
+* var sw = [ 12, 4, 1 ]; // row-major
+* var sx = [ 24, 8, 1 ]; // row-major
+* var sy = [ 1, 4, 12 ]; // column-major
+* var sz = [ 1, -2, 6 ]; // column-major
+*
+* var o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+* // returns {...}
+*
+* var ssh = o.sh;
+* // returns [ 2, 3, 4 ]
+*
+* var ssw = o.sw;
+* // returns [ 12, 4, 1 ]
+*
+* var ssx = o.sx;
+* // returns [ 24, 8, 1 ]
+*
+* var ssy = o.sy;
+* // returns [ 1, 4, 12 ]
+*
+* var ssz = o.sz;
+* // returns [ 1, -2, 6 ]
+*/
+
+// MODULES //
+
+var main = require( './main.js' );
+
+
+// EXPORTS //
+
+module.exports = main;
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/lib/main.js
new file mode 100644
index 000000000000..645925e90ff3
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/lib/main.js
@@ -0,0 +1,88 @@
+/**
+* @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 loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' );
+
+
+// MAIN //
+
+/**
+* Reorders ndarray dimensions and associated strides for loop interchange.
+*
+* ## Notes
+*
+* - The returned object has the following properties:
+*
+* - **sh**: dimensions sorted in loop order.
+* - **sw**: first input ndarray strides sorted in loop order.
+* - **sx**: second input ndarray strides sorted in loop order.
+* - **sy**: third input ndarray strides sorted in loop order.
+* - **sz**: output ndarray strides sorted in loop order.
+*
+* @param {NonNegativeIntegerArray} sh - array dimensions
+* @param {IntegerArray} sw - first input array stride lengths
+* @param {IntegerArray} sx - second input array stride lengths
+* @param {IntegerArray} sy - third input array stride lengths
+* @param {IntegerArray} sz - output array stride lengths
+* @returns {Object} loop interchange data
+*
+* @example
+* var sh = [ 2, 3, 4 ];
+*
+* var sw = [ 12, 4, 1 ]; // row-major
+* var sx = [ 24, 8, 1 ]; // row-major
+* var sy = [ 1, 4, 12 ]; // column-major
+* var sz = [ 1, -2, 6 ]; // column-major
+*
+* var o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+* // returns {...}
+*
+* var ssh = o.sh;
+* // returns [ 2, 3, 4 ]
+*
+* var ssw = o.sw;
+* // returns [ 12, 4, 1 ]
+*
+* var ssx = o.sx;
+* // returns [ 24, 8, 1 ]
+*
+* var ssy = o.sy;
+* // returns [ 1, 4, 12 ]
+*
+* var ssz = o.sz;
+* // returns [ 1, -2, 6 ]
+*/
+function ternaryLoopOrder( sh, sw, sx, sy, sz ) {
+ var tmp = loopOrder( sh, [ sw, sx, sy, sz ] );
+ return {
+ 'sh': tmp[ 0 ],
+ 'sw': tmp[ 1 ],
+ 'sx': tmp[ 2 ],
+ 'sy': tmp[ 3 ],
+ 'sz': tmp[ 4 ]
+ };
+}
+
+
+// EXPORTS //
+
+module.exports = ternaryLoopOrder;
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/package.json b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/package.json
new file mode 100644
index 000000000000..878d94b0e8ac
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/package.json
@@ -0,0 +1,73 @@
+{
+ "name": "@stdlib/ndarray/base/ternary-loop-interchange-order",
+ "version": "0.0.0",
+ "description": "Reorder ndarray dimensions and associated strides for loop interchange.",
+ "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",
+ "reorder",
+ "sort",
+ "loop",
+ "tiling",
+ "blocking",
+ "interchange",
+ "cache-oblivious",
+ "optimization",
+ "multidimensional",
+ "array",
+ "utilities",
+ "utility",
+ "utils",
+ "util"
+ ],
+ "__stdlib__": {}
+}
diff --git a/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/test/test.js b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/test/test.js
new file mode 100644
index 000000000000..586e8033a0e0
--- /dev/null
+++ b/lib/node_modules/@stdlib/ndarray/base/ternary-loop-interchange-order/test/test.js
@@ -0,0 +1,238 @@
+/**
+* @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 isArray = require( '@stdlib/assert/is-array' );
+var ternaryLoopOrder = require( './../lib' );
+
+
+// TESTS //
+
+tape( 'main export is a function', function test( t ) {
+ t.ok( true, __filename );
+ t.strictEqual( typeof ternaryLoopOrder, 'function', 'main export is a function' );
+ t.end();
+});
+
+tape( 'the function returns loop interchange data (row-major)', function test( t ) {
+ var sh;
+ var sw;
+ var sx;
+ var sy;
+ var sz;
+ var o;
+
+ sh = [ 4, 2, 2 ];
+ sw = [ 4, 2, -1 ];
+ sx = [ 4, -2, 1 ];
+ sy = [ -4, 2, 1 ];
+ sz = [ -8, 4, -2 ];
+
+ o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+
+ t.notEqual( o.sh, sh, 'returns new array' );
+ t.strictEqual( isArray( o.sh ), true, 'returns expected value' );
+ t.deepEqual( o.sh, [ 2, 2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sw, sw, 'returns new array' );
+ t.strictEqual( isArray( o.sw ), true, 'returns expected value' );
+ t.deepEqual( o.sw, [ -1, 2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sx, sx, 'returns new array' );
+ t.strictEqual( isArray( o.sx ), true, 'returns expected value' );
+ t.deepEqual( o.sx, [ 1, -2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sy, sy, 'returns new array' );
+ t.strictEqual( isArray( o.sy ), true, 'returns expected value' );
+ t.deepEqual( o.sy, [ 1, 2, -4 ], 'returns expected value' );
+
+ t.notEqual( o.sz, sz, 'returns new array' );
+ t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
+ t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns loop interchange data (column-major)', function test( t ) {
+ var sh;
+ var sw;
+ var sx;
+ var sy;
+ var sz;
+ var o;
+
+ sh = [ 4, 2, 2 ];
+ sw = [ -1, 4, 8 ];
+ sx = [ 1, -4, 8 ];
+ sy = [ -1, 4, 8 ];
+ sz = [ -2, 4, -8 ];
+
+ o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+
+ t.notEqual( o.sh, sh, 'returns new array' );
+ t.strictEqual( isArray( o.sh ), true, 'returns expected value' );
+ t.deepEqual( o.sh, [ 4, 2, 2 ], 'returns expected value' );
+
+ t.notEqual( o.sw, sw, 'returns new array' );
+ t.strictEqual( isArray( o.sw ), true, 'returns expected value' );
+ t.deepEqual( o.sw, [ -1, 4, 8 ], 'returns expected value' );
+
+ t.notEqual( o.sx, sx, 'returns new array' );
+ t.strictEqual( isArray( o.sx ), true, 'returns expected value' );
+ t.deepEqual( o.sx, [ 1, -4, 8 ], 'returns expected value' );
+
+ t.notEqual( o.sy, sy, 'returns new array' );
+ t.strictEqual( isArray( o.sy ), true, 'returns expected value' );
+ t.deepEqual( o.sy, [ -1, 4, 8 ], 'returns expected value' );
+
+ t.notEqual( o.sz, sz, 'returns new array' );
+ t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
+ t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns loop interchange data (mixed order)', function test( t ) {
+ var sh;
+ var sw;
+ var sx;
+ var sy;
+ var sz;
+ var o;
+
+ sh = [ 4, 2, 2 ];
+ sw = [ 4, 2, -1 ];
+ sx = [ 4, -2, 1 ];
+ sy = [ 1, -4, -8 ];
+ sz = [ -8, 4, -2 ];
+
+ o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+
+ t.notEqual( o.sh, sh, 'returns new array' );
+ t.strictEqual( isArray( o.sh ), true, 'returns expected value' );
+ t.deepEqual( o.sh, [ 2, 2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sw, sw, 'returns new array' );
+ t.strictEqual( isArray( o.sw ), true, 'returns expected value' );
+ t.deepEqual( o.sw, [ -1, 2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sx, sx, 'returns new array' );
+ t.strictEqual( isArray( o.sx ), true, 'returns expected value' );
+ t.deepEqual( o.sx, [ 1, -2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sy, sy, 'returns new array' );
+ t.strictEqual( isArray( o.sy ), true, 'returns expected value' );
+ t.deepEqual( o.sy, [ -8, -4, 1 ], 'returns expected value' );
+
+ t.notEqual( o.sz, sz, 'returns new array' );
+ t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
+ t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns loop interchange data (mostly disorganized)', function test( t ) {
+ var sh;
+ var sw;
+ var sx;
+ var sy;
+ var sz;
+ var o;
+
+ sh = [ 4, 2, 2 ];
+ sw = [ 2, 4, -1 ]; // disorganized
+ sx = [ -2, 4, 1 ]; // disorganized
+ sy = [ -4, 2, 1 ]; // row-major
+ sz = [ -8, -2, 4 ]; // disorganized
+
+ o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+
+ t.notEqual( o.sh, sh, 'returns new array' );
+ t.strictEqual( isArray( o.sh ), true, 'returns expected value' );
+ t.deepEqual( o.sh, [ 2, 2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sw, sw, 'returns new array' );
+ t.strictEqual( isArray( o.sw ), true, 'returns expected value' );
+ t.deepEqual( o.sw, [ -1, 4, 2 ], 'returns expected value' );
+
+ t.notEqual( o.sx, sx, 'returns new array' );
+ t.strictEqual( isArray( o.sx ), true, 'returns expected value' );
+ t.deepEqual( o.sx, [ 1, 4, -2 ], 'returns expected value' );
+
+ t.notEqual( o.sy, sy, 'returns new array' );
+ t.strictEqual( isArray( o.sy ), true, 'returns expected value' );
+ t.deepEqual( o.sy, [ 1, 2, -4 ], 'returns expected value' );
+
+ t.notEqual( o.sz, sz, 'returns new array' );
+ t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
+ t.deepEqual( o.sz, [ 4, -2, -8 ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'the function returns loop interchange data (all disorganized)', function test( t ) {
+ var sh;
+ var sw;
+ var sx;
+ var sy;
+ var sz;
+ var o;
+
+ sh = [ 4, 2, 2 ];
+ sw = [ 2, 4, -1 ]; // disorganized
+ sx = [ -2, 4, 1 ]; // disorganized
+ sy = [ 1, -4, 2 ]; // disorganized
+ sz = [ -8, -2, 4 ]; // disorganized
+
+ o = ternaryLoopOrder( sh, sw, sx, sy, sz );
+
+ t.notEqual( o.sh, sh, 'returns new array' );
+ t.strictEqual( isArray( o.sh ), true, 'returns expected value' );
+ t.deepEqual( o.sh, [ 2, 4, 2 ], 'returns expected value' );
+
+ t.notEqual( o.sw, sw, 'returns new array' );
+ t.strictEqual( isArray( o.sw ), true, 'returns expected value' );
+ t.deepEqual( o.sw, [ -1, 2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sx, sx, 'returns new array' );
+ t.strictEqual( isArray( o.sx ), true, 'returns expected value' );
+ t.deepEqual( o.sx, [ 1, -2, 4 ], 'returns expected value' );
+
+ t.notEqual( o.sy, sy, 'returns new array' );
+ t.strictEqual( isArray( o.sy ), true, 'returns expected value' );
+ t.deepEqual( o.sy, [ 2, 1, -4 ], 'returns expected value' );
+
+ t.notEqual( o.sz, sz, 'returns new array' );
+ t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
+ t.deepEqual( o.sz, [ 4, -8, -2 ], 'returns expected value' );
+
+ t.end();
+});
+
+tape( 'if provided empty arrays, the function returns empty arrays', function test( t ) {
+ var o = ternaryLoopOrder( [], [], [], [], [] );
+ t.deepEqual( o.sh, [], 'returns expected value' );
+ t.deepEqual( o.sx, [], 'returns expected value' );
+ t.deepEqual( o.sy, [], 'returns expected value' );
+ t.deepEqual( o.sz, [], 'returns expected value' );
+ t.end();
+});