diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md index 2bd36003c69c..11be02e870a3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/README.md @@ -66,6 +66,7 @@ The function returns an object having the following properties: - **sx**: first input array strides sorted in loop order. - **sy**: second input array strides sorted in loop order. - **sz**: output array strides sorted in loop order. +- **idx**: dimension indices 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. diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/repl.txt index ac5025508826..976a1035987b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/repl.txt +++ b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/repl.txt @@ -8,6 +8,7 @@ - sx: first input array strides sorted in loop order. - sy: second input array strides sorted in loop order. - sz: output array strides sorted in loop order. + - idx: dimension indices 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. @@ -46,6 +47,9 @@ out.sz: Array Output array strides sorted in loop order. + out.idx: Array + Dimension indices sorted in loop order. + Examples -------- > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/types/index.d.ts index 04ae9ffac531..d2a1e0cdd9ee 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/docs/types/index.d.ts @@ -45,6 +45,11 @@ interface LoopOrderObject { * Output array strides sorted in loop order. */ sz: Array; + + /** + * Dimension indices sorted in loop order. + */ + idx: Array; } /** @@ -58,6 +63,7 @@ interface LoopOrderObject { * - **sx**: first input ndarray strides sorted in loop order. * - **sy**: second input ndarray strides sorted in loop order. * - **sz**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices 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. * @@ -94,6 +100,9 @@ interface LoopOrderObject { * * var ssz = o.sz; * // returns [ 6, -2, 1 ] +* +* var idx = o.idx; +* // returns [ 2, 1, 0 ] */ declare function binaryLoopOrder( shape: ArrayLike, stridesX: ArrayLike, stridesY: ArrayLike, stridesZ: ArrayLike ): LoopOrderObject; diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/index.js index 4b26ccbb80bb..f521ef0e91a8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/index.js +++ b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/index.js @@ -46,6 +46,9 @@ * * var ssz = o.sz; * // returns [ 6, -2, 1 ] +* +* var idx = o.idx; +* // returns [ 2, 1, 0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/main.js index 0190a60e05a3..840de1e593e0 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/lib/main.js @@ -36,6 +36,7 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * - **sx**: first input ndarray strides sorted in loop order. * - **sy**: second input ndarray strides sorted in loop order. * - **sz**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices sorted in loop order. * * @param {NonNegativeIntegerArray} sh - array dimensions * @param {IntegerArray} sx - first input array stride lengths @@ -64,6 +65,9 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * * var ssz = o.sz; * // returns [ 6, -2, 1 ] +* +* var idx = o.idx; +* // returns [ 2, 1, 0 ] */ function binaryLoopOrder( sh, sx, sy, sz ) { var tmp = loopOrder( sh, [ sx, sy, sz ] ); @@ -71,7 +75,8 @@ function binaryLoopOrder( sh, sx, sy, sz ) { 'sh': tmp[ 0 ], 'sx': tmp[ 1 ], 'sy': tmp[ 2 ], - 'sz': tmp[ 3 ] + 'sz': tmp[ 3 ], + 'idx': tmp[ 4 ] }; } diff --git a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/test/test.js b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/test/test.js index a52405e714b5..f0d99e569147 100644 --- a/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/binary-loop-interchange-order/test/test.js @@ -63,6 +63,9 @@ tape( 'the function returns loop interchange data (row-major)', function test( t t.strictEqual( isArray( o.sz ), true, 'returns expected value' ); t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -96,6 +99,9 @@ tape( 'the function returns loop interchange data (column-major)', function test t.strictEqual( isArray( o.sz ), true, 'returns expected value' ); t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 0, 1, 2 ], 'returns expected value' ); + t.end(); }); @@ -129,6 +135,9 @@ tape( 'the function returns loop interchange data (mixed order)', function test( t.strictEqual( isArray( o.sz ), true, 'returns expected value' ); t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -162,6 +171,9 @@ tape( 'the function returns loop interchange data (mostly disorganized)', functi t.strictEqual( isArray( o.sz ), true, 'returns expected value' ); t.deepEqual( o.sz, [ 4, -2, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -195,6 +207,9 @@ tape( 'the function returns loop interchange data (all disorganized)', function t.strictEqual( isArray( o.sz ), true, 'returns expected value' ); t.deepEqual( o.sz, [ 4, -8, -2 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 0, 1 ], 'returns expected value' ); + t.end(); }); @@ -204,5 +219,6 @@ tape( 'if provided empty arrays, the function returns empty arrays', function te t.deepEqual( o.sx, [], 'returns expected value' ); t.deepEqual( o.sy, [], 'returns expected value' ); t.deepEqual( o.sz, [], 'returns expected value' ); + t.deepEqual( o.idx, [], 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/README.md index 0a4ef5d5ce5f..7d2048dd2fbe 100644 --- a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/README.md @@ -63,13 +63,14 @@ var o = loopOrder( shape, [ stridesX, stridesY, stridesZ ] ); The function returns an array having the following elements: ```text -[ , ... ] +[ , ..., ] ``` where - **shape**: dimensions sorted in loop order. - **...strides**: strides for each respective ndarray sorted in loop order. +- **idx**: dimension indices 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. diff --git a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/repl.txt index df2a6d85fb52..1546e52dfbdd 100644 --- a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/repl.txt +++ b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/repl.txt @@ -4,12 +4,13 @@ The function returns an array having the following elements: - [ , ... ] + [ , ..., ] where - shape: dimensions sorted in loop order. - strides: strides for each respective ndarray sorted in loop order. + - idx: dimension indices 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. diff --git a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/types/index.d.ts index 096e1c45c121..158f52a4c4b3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/docs/types/index.d.ts @@ -30,13 +30,14 @@ import { ArrayLike } from '@stdlib/types/array'; * - The returned array has the following elements: * * ```text -* [ , ... ] +* [ , ..., ] * ``` * * where * * - **shape**: dimensions sorted in loop order. * - **...strides**: strides for each respective ndarray sorted in loop order. +* - **idx**: dimension indices 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. * @@ -71,6 +72,9 @@ import { ArrayLike } from '@stdlib/types/array'; * * var ssz = o[ 3 ]; * // returns [ 6, -2, 1 ] +* +* var idx = o[ 4 ]; +* // returns [ 2, 1, 0 ] */ declare function loopOrder( shape: ArrayLike, strides: ArrayLike> ): Array>; diff --git a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/index.js index 10cd016fa3bd..7ed2dbf02834 100644 --- a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/index.js +++ b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/index.js @@ -46,6 +46,9 @@ * * var ssz = o[ 3 ]; * // returns [ 6, -2, 1 ] +* +* var idx = o[ 4 ]; +* // returns [ 2, 1, 0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/main.js index 1d77144001d8..3423039d0f9c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/lib/main.js @@ -37,13 +37,14 @@ var sort2ins = require( './sort2ins.js' ); * - The returned array has the following elements: * * ```text -* [ , ... ] +* [ , ..., ] * ``` * * where * * - **shape**: dimensions sorted in loop order. * - **...strides**: strides for each respective ndarray sorted in loop order. +* - **idx**: dimension indices sorted in loop order. * * @param {NonNegativeIntegerArray} shape - array dimensions * @param {ArrayLikeObject>} strides - list of stride arrays containing the stride lengths for each input and output ndarray @@ -70,6 +71,9 @@ var sort2ins = require( './sort2ins.js' ); * * var ssz = o[ 3 ]; * // returns [ 6, -2, 1 ] +* +* var idx = o[ 4 ]; +* // returns [ 2, 1, 0 ] */ function loopOrder( shape, strides ) { var idx; @@ -135,6 +139,9 @@ function loopOrder( shape, strides ) { for ( i = 0; i < N; i++ ) { out.push( take( strides[ i ], idx ) ); } + // Append the dimension indices sorted in loop order: + out.push( idx ); + return out; } diff --git a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/test/test.js b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/test/test.js index 60dd53efef3a..a5a0e22e96b2 100644 --- a/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/loop-interchange-order/test/test.js @@ -63,6 +63,11 @@ tape( 'the function returns loop interchange data (row-major)', function test( t t.strictEqual( isArray( o[ 3 ] ), true, 'returns expected value' ); t.deepEqual( o[ 3 ], [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o[ 4 ] ), true, 'returns expected value' ); + t.deepEqual( o[ 4 ], [ 2, 1, 0 ], 'returns expected value' ); + + t.strictEqual( o.length, 5, 'returns expected value' ); + t.end(); }); @@ -96,6 +101,11 @@ tape( 'the function returns loop interchange data (column-major)', function test t.strictEqual( isArray( o[ 3 ] ), true, 'returns expected value' ); t.deepEqual( o[ 3 ], [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o[ 4 ] ), true, 'returns expected value' ); + t.deepEqual( o[ 4 ], [ 0, 1, 2 ], 'returns expected value' ); + + t.strictEqual( o.length, 5, 'returns expected value' ); + t.end(); }); @@ -129,6 +139,11 @@ tape( 'the function returns loop interchange data (mixed order)', function test( t.strictEqual( isArray( o[ 3 ] ), true, 'returns expected value' ); t.deepEqual( o[ 3 ], [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o[ 4 ] ), true, 'returns expected value' ); + t.deepEqual( o[ 4 ], [ 2, 1, 0 ], 'returns expected value' ); + + t.strictEqual( o.length, 5, 'returns expected value' ); + t.end(); }); @@ -162,6 +177,11 @@ tape( 'the function returns loop interchange data (mostly disorganized)', functi t.strictEqual( isArray( o[ 3 ] ), true, 'returns expected value' ); t.deepEqual( o[ 3 ], [ 4, -2, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o[ 4 ] ), true, 'returns expected value' ); + t.deepEqual( o[ 4 ], [ 2, 1, 0 ], 'returns expected value' ); + + t.strictEqual( o.length, 5, 'returns expected value' ); + t.end(); }); @@ -195,6 +215,11 @@ tape( 'the function returns loop interchange data (all disorganized)', function t.strictEqual( isArray( o[ 3 ] ), true, 'returns expected value' ); t.deepEqual( o[ 3 ], [ 4, -8, -2 ], 'returns expected value' ); + t.strictEqual( isArray( o[ 4 ] ), true, 'returns expected value' ); + t.deepEqual( o[ 4 ], [ 2, 0, 1 ], 'returns expected value' ); + + t.strictEqual( o.length, 5, 'returns expected value' ); + t.end(); }); @@ -204,5 +229,7 @@ tape( 'if provided empty arrays, the function returns empty arrays', function te t.deepEqual( o[ 1 ], [], 'returns expected value' ); t.deepEqual( o[ 2 ], [], 'returns expected value' ); t.deepEqual( o[ 3 ], [], 'returns expected value' ); + t.deepEqual( o[ 4 ], [], 'returns expected value' ); + t.strictEqual( o.length, 5, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/README.md index 6a2510cd5008..78ad8c3b4bed 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/README.md @@ -74,6 +74,7 @@ The function returns an object having the following properties: - **sz**: third input array strides sorted in loop order. - **sw**: fourth input array strides sorted in loop order. - **su**: output array strides sorted in loop order. +- **idx**: dimension indices 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. diff --git a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/repl.txt index 5b8fa0b2c1e6..d6ab87eb5975 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/repl.txt +++ b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/repl.txt @@ -10,6 +10,7 @@ - sz: third input array strides sorted in loop order. - sw: fourth input array strides sorted in loop order. - su: output array strides sorted in loop order. + - idx: dimension indices 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. @@ -60,6 +61,9 @@ out.su: Array Output array strides sorted in loop order. + out.idx: Array + Dimension indices sorted in loop order. + Examples -------- > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/types/index.d.ts index 4fddeffe6877..fe24b0ac7f58 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/docs/types/index.d.ts @@ -55,6 +55,11 @@ interface LoopOrderObject { * Output array strides sorted in loop order. */ su: Array; + + /** + * Dimension indices sorted in loop order. + */ + idx: Array; } /** @@ -70,6 +75,7 @@ interface LoopOrderObject { * - **sz**: third input ndarray strides sorted in loop order. * - **sw**: fourth input ndarray strides sorted in loop order. * - **su**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices 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. * @@ -116,6 +122,9 @@ interface LoopOrderObject { * * var ssu = o.su; * // returns [ 1, -2, 6 ] +* +* var idx = o.idx; +* // returns [ 0, 1, 2 ] */ declare function quaternaryLoopOrder( shape: ArrayLike, stridesX: ArrayLike, stridesY: ArrayLike, stridesZ: ArrayLike, stridesW: ArrayLike, stridesU: ArrayLike ): LoopOrderObject; diff --git a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/index.js index 4bcc44e09960..02495afc8025 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/index.js +++ b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/index.js @@ -54,6 +54,9 @@ * * var ssu = o.su; * // returns [ 1, -2, 6 ] +* +* var idx = o.idx; +* // returns [ 0, 1, 2 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/main.js index 336e7f7d93e6..b01513084c30 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/lib/main.js @@ -38,6 +38,7 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * - **sz**: third input ndarray strides sorted in loop order. * - **sw**: fourth input ndarray strides sorted in loop order. * - **su**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices sorted in loop order. * * @param {NonNegativeIntegerArray} sh - array dimensions * @param {IntegerArray} sx - first input array stride lengths @@ -76,6 +77,9 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * * var ssu = o.su; * // returns [ 1, -2, 6 ] +* +* var idx = o.idx; +* // returns [ 0, 1, 2 ] */ function quaternaryLoopOrder( sh, sx, sy, sz, sw, su ) { var tmp = loopOrder( sh, [ sx, sy, sz, sw, su ] ); @@ -85,7 +89,8 @@ function quaternaryLoopOrder( sh, sx, sy, sz, sw, su ) { 'sy': tmp[ 2 ], 'sz': tmp[ 3 ], 'sw': tmp[ 4 ], - 'su': tmp[ 5 ] + 'su': tmp[ 5 ], + 'idx': tmp[ 6 ] }; } diff --git a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/test/test.js b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/test/test.js index beada5f3dfad..0e0e346cb725 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/quaternary-loop-interchange-order/test/test.js @@ -75,6 +75,9 @@ tape( 'the function returns loop interchange data (row-major)', function test( t t.strictEqual( isArray( o.su ), true, 'returns expected value' ); t.deepEqual( o.su, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -120,6 +123,9 @@ tape( 'the function returns loop interchange data (column-major)', function test t.strictEqual( isArray( o.su ), true, 'returns expected value' ); t.deepEqual( o.su, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 0, 1, 2 ], 'returns expected value' ); + t.end(); }); @@ -165,6 +171,9 @@ tape( 'the function returns loop interchange data (mixed order)', function test( t.strictEqual( isArray( o.su ), true, 'returns expected value' ); t.deepEqual( o.su, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -210,6 +219,9 @@ tape( 'the function returns loop interchange data (mostly disorganized)', functi t.strictEqual( isArray( o.su ), true, 'returns expected value' ); t.deepEqual( o.su, [ 4, -2, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -255,6 +267,9 @@ tape( 'the function returns loop interchange data (all disorganized)', function t.strictEqual( isArray( o.su ), true, 'returns expected value' ); t.deepEqual( o.su, [ 4, -8, -2 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 0, 1 ], 'returns expected value' ); + t.end(); }); @@ -266,5 +281,6 @@ tape( 'if provided empty arrays, the function returns empty arrays', function te t.deepEqual( o.sz, [], 'returns expected value' ); t.deepEqual( o.sw, [], 'returns expected value' ); t.deepEqual( o.su, [], 'returns expected value' ); + t.deepEqual( o.idx, [], 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/README.md b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/README.md index 67aa925b9739..fadeffe0e761 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/README.md @@ -76,6 +76,7 @@ The function returns an object having the following properties: - **sw**: fourth input array strides sorted in loop order. - **su**: fifth input array strides sorted in loop order. - **sv**: output array strides sorted in loop order. +- **idx**: dimension indices 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. diff --git a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/repl.txt index 027b8691ed61..a530765c0e4f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/repl.txt +++ b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/repl.txt @@ -11,6 +11,7 @@ - sw: fourth input array strides sorted in loop order. - su: fifth input array strides sorted in loop order. - sv: output array strides sorted in loop order. + - idx: dimension indices 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. @@ -67,6 +68,9 @@ out.sv: Array Output array strides sorted in loop order. + out.idx: Array + Dimension indices sorted in loop order. + Examples -------- > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); diff --git a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/types/index.d.ts index 8a6ad3265985..c158d78c4c1a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/docs/types/index.d.ts @@ -60,6 +60,11 @@ interface LoopOrderObject { * Output array strides sorted in loop order. */ sv: Array; + + /** + * Dimension indices sorted in loop order. + */ + idx: Array; } /** @@ -76,6 +81,7 @@ interface LoopOrderObject { * - **sw**: fourth input ndarray strides sorted in loop order. * - **su**: fifth input ndarray strides sorted in loop order. * - **sv**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices 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. * @@ -127,6 +133,9 @@ interface LoopOrderObject { * * var ssv = o.sv; * // returns [ 6, -2, 1 ] +* +* var idx = o.idx; +* // returns [ 2, 1, 0 ] */ declare function quinaryLoopOrder( shape: ArrayLike, stridesX: ArrayLike, stridesY: ArrayLike, stridesZ: ArrayLike, stridesW: ArrayLike, stridesU: ArrayLike, stridesV: ArrayLike ): LoopOrderObject; diff --git a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/index.js b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/index.js index 7515efcafdeb..a74722b18010 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/index.js +++ b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/index.js @@ -58,6 +58,9 @@ * * var ssv = o.sv; * // returns [ 6, -2, 1 ] +* +* var idx = o.idx; +* // returns [ 2, 1, 0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/main.js b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/main.js index e22eea671e77..41ea97541f7d 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/lib/main.js @@ -39,6 +39,7 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * - **sw**: fourth input ndarray strides sorted in loop order. * - **su**: fifth input ndarray strides sorted in loop order. * - **sv**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices sorted in loop order. * * @param {NonNegativeIntegerArray} sh - array dimensions * @param {IntegerArray} sx - first input array stride lengths @@ -82,6 +83,9 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * * var ssv = o.sv; * // returns [ 6, -2, 1 ] +* +* var idx = o.idx; +* // returns [ 2, 1, 0 ] */ function quinaryLoopOrder( sh, sx, sy, sz, sw, su, sv ) { var tmp = loopOrder( sh, [ sx, sy, sz, sw, su, sv ] ); @@ -92,7 +96,8 @@ function quinaryLoopOrder( sh, sx, sy, sz, sw, su, sv ) { 'sz': tmp[ 3 ], 'sw': tmp[ 4 ], 'su': tmp[ 5 ], - 'sv': tmp[ 6 ] + 'sv': tmp[ 6 ], + 'idx': tmp[ 7 ] }; } diff --git a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/test/test.js b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/test/test.js index 6a562b6655db..5ec7ca702324 100644 --- a/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/base/quinary-loop-interchange-order/test/test.js @@ -81,6 +81,9 @@ tape( 'the function returns loop interchange data (row-major)', function test( t t.strictEqual( isArray( o.sv ), true, 'returns expected value' ); t.deepEqual( o.sv, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -132,6 +135,9 @@ tape( 'the function returns loop interchange data (column-major)', function test t.strictEqual( isArray( o.sv ), true, 'returns expected value' ); t.deepEqual( o.sv, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 0, 1, 2 ], 'returns expected value' ); + t.end(); }); @@ -183,6 +189,9 @@ tape( 'the function returns loop interchange data (mixed order)', function test( t.strictEqual( isArray( o.sv ), true, 'returns expected value' ); t.deepEqual( o.sv, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -234,6 +243,9 @@ tape( 'the function returns loop interchange data (mostly disorganized)', functi t.strictEqual( isArray( o.sv ), true, 'returns expected value' ); t.deepEqual( o.sv, [ 4, -2, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -285,6 +297,9 @@ tape( 'the function returns loop interchange data (all disorganized)', function t.strictEqual( isArray( o.sv ), true, 'returns expected value' ); t.deepEqual( o.sv, [ 4, -8, -2 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 0, 1 ], 'returns expected value' ); + t.end(); }); @@ -297,5 +312,6 @@ tape( 'if provided empty arrays, the function returns empty arrays', function te t.deepEqual( o.sw, [], 'returns expected value' ); t.deepEqual( o.su, [], 'returns expected value' ); t.deepEqual( o.sv, [], 'returns expected value' ); + t.deepEqual( o.idx, [], 'returns expected value' ); t.end(); }); 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 index 5ad80d3c0c33..d6584247d96c 100644 --- 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 @@ -68,6 +68,7 @@ The function returns an object having the following properties: - **sy**: second input array strides sorted in loop order. - **sz**: third input array strides sorted in loop order. - **sw**: output array strides sorted in loop order. +- **idx**: dimension indices 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. 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 index 6dd164778980..f31521fdfed0 100644 --- 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 @@ -9,6 +9,7 @@ - sy: second input array strides sorted in loop order. - sz: third input array strides sorted in loop order. - sw: output array strides sorted in loop order. + - idx: dimension indices 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. @@ -53,6 +54,9 @@ out.sw: Array Output array strides sorted in loop order. + out.idx: Array + Dimension indices sorted in loop order. + Examples -------- > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ); 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 index ef2d33c170cb..1570b07a09b4 100644 --- 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 @@ -50,6 +50,11 @@ interface LoopOrderObject { * Output array strides sorted in loop order. */ sw: Array; + + /** + * Dimension indices sorted in loop order. + */ + idx: Array; } /** @@ -64,6 +69,7 @@ interface LoopOrderObject { * - **sy**: second input ndarray strides sorted in loop order. * - **sz**: third input ndarray strides sorted in loop order. * - **sw**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices 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. * @@ -105,6 +111,9 @@ interface LoopOrderObject { * * var ssw = o.sw; * // returns [ 1, -2, 6 ] +* +* var idx = o.idx; +* // returns [ 0, 1, 2 ] */ declare function ternaryLoopOrder( shape: ArrayLike, stridesX: ArrayLike, stridesY: ArrayLike, stridesZ: ArrayLike, stridesW: ArrayLike ): LoopOrderObject; 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 index 91e2c6319b46..674bb0f8e9aa 100644 --- 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 @@ -50,6 +50,9 @@ * * var ssw = o.sw; * // returns [ 1, -2, 6 ] +* +* var idx = o.idx; +* // returns [ 0, 1, 2 ] */ // MODULES // 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 index b384074c0f9e..6e98fde84c53 100644 --- 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 @@ -37,6 +37,7 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * - **sy**: second input ndarray strides sorted in loop order. * - **sz**: third input ndarray strides sorted in loop order. * - **sw**: output ndarray strides sorted in loop order. +* - **idx**: dimension indices sorted in loop order. * * @param {NonNegativeIntegerArray} sh - array dimensions * @param {IntegerArray} sx - first input array stride lengths @@ -70,6 +71,9 @@ var loopOrder = require( '@stdlib/ndarray/base/loop-interchange-order' ); * * var ssw = o.sw; * // returns [ 1, -2, 6 ] +* +* var idx = o.idx; +* // returns [ 0, 1, 2 ] */ function ternaryLoopOrder( sh, sx, sy, sz, sw ) { var tmp = loopOrder( sh, [ sx, sy, sz, sw ] ); @@ -78,7 +82,8 @@ function ternaryLoopOrder( sh, sx, sy, sz, sw ) { 'sx': tmp[ 1 ], 'sy': tmp[ 2 ], 'sz': tmp[ 3 ], - 'sw': tmp[ 4 ] + 'sw': tmp[ 4 ], + 'idx': tmp[ 5 ] }; } 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 index c58207c55d5e..4d21a8c02eed 100644 --- 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 @@ -69,6 +69,9 @@ tape( 'the function returns loop interchange data (row-major)', function test( t t.strictEqual( isArray( o.sw ), true, 'returns expected value' ); t.deepEqual( o.sw, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -108,6 +111,9 @@ tape( 'the function returns loop interchange data (column-major)', function test t.strictEqual( isArray( o.sw ), true, 'returns expected value' ); t.deepEqual( o.sw, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 0, 1, 2 ], 'returns expected value' ); + t.end(); }); @@ -147,6 +153,9 @@ tape( 'the function returns loop interchange data (mixed order)', function test( t.strictEqual( isArray( o.sw ), true, 'returns expected value' ); t.deepEqual( o.sw, [ -2, 4, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -186,6 +195,9 @@ tape( 'the function returns loop interchange data (mostly disorganized)', functi t.strictEqual( isArray( o.sw ), true, 'returns expected value' ); t.deepEqual( o.sw, [ 4, -2, -8 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' ); + t.end(); }); @@ -225,6 +237,9 @@ tape( 'the function returns loop interchange data (all disorganized)', function t.strictEqual( isArray( o.sw ), true, 'returns expected value' ); t.deepEqual( o.sw, [ 4, -8, -2 ], 'returns expected value' ); + t.strictEqual( isArray( o.idx ), true, 'returns expected value' ); + t.deepEqual( o.idx, [ 2, 0, 1 ], 'returns expected value' ); + t.end(); }); @@ -235,5 +250,6 @@ tape( 'if provided empty arrays, the function returns empty arrays', function te t.deepEqual( o.sy, [], 'returns expected value' ); t.deepEqual( o.sz, [], 'returns expected value' ); t.deepEqual( o.sw, [], 'returns expected value' ); + t.deepEqual( o.idx, [], 'returns expected value' ); t.end(); });