Skip to content

Commit 2a398d5

Browse files
committed
Auto-generated commit
1 parent 23b4ad5 commit 2a398d5

31 files changed

Lines changed: 205 additions & 8 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104

105105
### Bug Fixes
106106

107+
- [`96ed2fa`](https://github.com/stdlib-js/stdlib/commit/96ed2faff14d10a798f3d84d267a26e7a78b0759) - return loop permutation indices from `ndarray/base/*loop-interchange-order` packages [(#15812)](https://github.com/stdlib-js/stdlib/pull/15812)
107108
- [`c21221c`](https://github.com/stdlib-js/stdlib/commit/c21221c1a4ec8709eaca86aa5acc984e4aafda6d) - add missing option validation [(#14966)](https://github.com/stdlib-js/stdlib/pull/14966)
108109
- [`668ccdd`](https://github.com/stdlib-js/stdlib/commit/668ccdd7e8a924d21f431ca83782bb8f6af724f2) - add missing arguments to `format` calls [(#14517)](https://github.com/stdlib-js/stdlib/pull/14517)
109110
- [`6ba7e59`](https://github.com/stdlib-js/stdlib/commit/6ba7e5910d85debbb0dd39ea8cfdaf8c458ffe4d) - address off-by-one bug [(#14352)](https://github.com/stdlib-js/stdlib/pull/14352)
@@ -141,6 +142,7 @@ A total of 4 issues were closed in this release:
141142

142143
<details>
143144

145+
- [`96ed2fa`](https://github.com/stdlib-js/stdlib/commit/96ed2faff14d10a798f3d84d267a26e7a78b0759) - **fix:** return loop permutation indices from `ndarray/base/*loop-interchange-order` packages [(#15812)](https://github.com/stdlib-js/stdlib/pull/15812) _(by Kaustubh Patange)_
144146
- [`85f3d87`](https://github.com/stdlib-js/stdlib/commit/85f3d878b126107b24ba09fd08bea53307422087) - **feat:** add float16 dtype support to `ndarray/base/empty-like` [(#15739)](https://github.com/stdlib-js/stdlib/pull/15739) _(by Samarth Kolarkar)_
145147
- [`ce01d62`](https://github.com/stdlib-js/stdlib/commit/ce01d62f42a0f04f16f413f93dea56794a601211) - **feat:** add float16 dtype support to `ndarray/base/from-array` [(#15742)](https://github.com/stdlib-js/stdlib/pull/15742) _(by Samarth Kolarkar)_
146148
- [`745b7b2`](https://github.com/stdlib-js/stdlib/commit/745b7b23ad7c544eeaa33344aae3e79ba3404062) - **feat:** add float16 dtype support to `ndarray/base/from-scalar` [(#15743)](https://github.com/stdlib-js/stdlib/pull/15743) _(by Samarth Kolarkar)_

‎base/binary-loop-interchange-order/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The function returns an object having the following properties:
6666
- **sx**: first input array strides sorted in loop order.
6767
- **sy**: second input array strides sorted in loop order.
6868
- **sz**: output array strides sorted in loop order.
69+
- **idx**: dimension indices sorted in loop order.
6970

7071
For all returned arrays, the first element corresponds to the innermost loop, and the last element corresponds to the outermost loop.
7172

‎base/binary-loop-interchange-order/docs/repl.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- sx: first input array strides sorted in loop order.
99
- sy: second input array strides sorted in loop order.
1010
- sz: output array strides sorted in loop order.
11+
- idx: dimension indices sorted in loop order.
1112

1213
For all returned arrays, the first element corresponds to the innermost
1314
loop, and the last element corresponds to the outermost loop.
@@ -46,6 +47,9 @@
4647
out.sz: Array<integer>
4748
Output array strides sorted in loop order.
4849

50+
out.idx: Array<integer>
51+
Dimension indices sorted in loop order.
52+
4953
Examples
5054
--------
5155
> var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] );

‎base/binary-loop-interchange-order/docs/types/index.d.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ interface LoopOrderObject {
4545
* Output array strides sorted in loop order.
4646
*/
4747
sz: Array<number>;
48+
49+
/**
50+
* Dimension indices sorted in loop order.
51+
*/
52+
idx: Array<number>;
4853
}
4954

5055
/**
@@ -58,6 +63,7 @@ interface LoopOrderObject {
5863
* - **sx**: first input ndarray strides sorted in loop order.
5964
* - **sy**: second input ndarray strides sorted in loop order.
6065
* - **sz**: output ndarray strides sorted in loop order.
66+
* - **idx**: dimension indices sorted in loop order.
6167
*
6268
* - 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.
6369
*
@@ -94,6 +100,9 @@ interface LoopOrderObject {
94100
*
95101
* var ssz = o.sz;
96102
* // returns [ 6, -2, 1 ]
103+
*
104+
* var idx = o.idx;
105+
* // returns [ 2, 1, 0 ]
97106
*/
98107
declare function binaryLoopOrder( shape: ArrayLike<number>, stridesX: ArrayLike<number>, stridesY: ArrayLike<number>, stridesZ: ArrayLike<number> ): LoopOrderObject;
99108

‎base/binary-loop-interchange-order/lib/index.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
*
4747
* var ssz = o.sz;
4848
* // returns [ 6, -2, 1 ]
49+
*
50+
* var idx = o.idx;
51+
* // returns [ 2, 1, 0 ]
4952
*/
5053

5154
// MODULES //

‎base/binary-loop-interchange-order/lib/main.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var loopOrder = require( './../../../base/loop-interchange-order' );
3636
* - **sx**: first input ndarray strides sorted in loop order.
3737
* - **sy**: second input ndarray strides sorted in loop order.
3838
* - **sz**: output ndarray strides sorted in loop order.
39+
* - **idx**: dimension indices sorted in loop order.
3940
*
4041
* @param {NonNegativeIntegerArray} sh - array dimensions
4142
* @param {IntegerArray} sx - first input array stride lengths
@@ -64,14 +65,18 @@ var loopOrder = require( './../../../base/loop-interchange-order' );
6465
*
6566
* var ssz = o.sz;
6667
* // returns [ 6, -2, 1 ]
68+
*
69+
* var idx = o.idx;
70+
* // returns [ 2, 1, 0 ]
6771
*/
6872
function binaryLoopOrder( sh, sx, sy, sz ) {
6973
var tmp = loopOrder( sh, [ sx, sy, sz ] );
7074
return {
7175
'sh': tmp[ 0 ],
7276
'sx': tmp[ 1 ],
7377
'sy': tmp[ 2 ],
74-
'sz': tmp[ 3 ]
78+
'sz': tmp[ 3 ],
79+
'idx': tmp[ 4 ]
7580
};
7681
}
7782

‎base/binary-loop-interchange-order/test/test.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ tape( 'the function returns loop interchange data (row-major)', function test( t
6363
t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
6464
t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' );
6565

66+
t.strictEqual( isArray( o.idx ), true, 'returns expected value' );
67+
t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' );
68+
6669
t.end();
6770
});
6871

@@ -96,6 +99,9 @@ tape( 'the function returns loop interchange data (column-major)', function test
9699
t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
97100
t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' );
98101

102+
t.strictEqual( isArray( o.idx ), true, 'returns expected value' );
103+
t.deepEqual( o.idx, [ 0, 1, 2 ], 'returns expected value' );
104+
99105
t.end();
100106
});
101107

@@ -129,6 +135,9 @@ tape( 'the function returns loop interchange data (mixed order)', function test(
129135
t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
130136
t.deepEqual( o.sz, [ -2, 4, -8 ], 'returns expected value' );
131137

138+
t.strictEqual( isArray( o.idx ), true, 'returns expected value' );
139+
t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' );
140+
132141
t.end();
133142
});
134143

@@ -162,6 +171,9 @@ tape( 'the function returns loop interchange data (mostly disorganized)', functi
162171
t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
163172
t.deepEqual( o.sz, [ 4, -2, -8 ], 'returns expected value' );
164173

174+
t.strictEqual( isArray( o.idx ), true, 'returns expected value' );
175+
t.deepEqual( o.idx, [ 2, 1, 0 ], 'returns expected value' );
176+
165177
t.end();
166178
});
167179

@@ -195,6 +207,9 @@ tape( 'the function returns loop interchange data (all disorganized)', function
195207
t.strictEqual( isArray( o.sz ), true, 'returns expected value' );
196208
t.deepEqual( o.sz, [ 4, -8, -2 ], 'returns expected value' );
197209

210+
t.strictEqual( isArray( o.idx ), true, 'returns expected value' );
211+
t.deepEqual( o.idx, [ 2, 0, 1 ], 'returns expected value' );
212+
198213
t.end();
199214
});
200215

@@ -204,5 +219,6 @@ tape( 'if provided empty arrays, the function returns empty arrays', function te
204219
t.deepEqual( o.sx, [], 'returns expected value' );
205220
t.deepEqual( o.sy, [], 'returns expected value' );
206221
t.deepEqual( o.sz, [], 'returns expected value' );
222+
t.deepEqual( o.idx, [], 'returns expected value' );
207223
t.end();
208224
});

‎base/loop-interchange-order/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ var o = loopOrder( shape, [ stridesX, stridesY, stridesZ ] );
6363
The function returns an array having the following elements:
6464

6565
```text
66-
[ <shape>, ...<strides> ]
66+
[ <shape>, ...<strides>, <idx> ]
6767
```
6868

6969
where
7070

7171
- **shape**: dimensions sorted in loop order.
7272
- **...strides**: strides for each respective ndarray sorted in loop order.
73+
- **idx**: dimension indices sorted in loop order.
7374

7475
For all returned arrays, the first element corresponds to the innermost loop, and the last element corresponds to the outermost loop.
7576

‎base/loop-interchange-order/docs/repl.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
The function returns an array having the following elements:
66

7-
[ <shape>, ...<strides> ]
7+
[ <shape>, ...<strides>, <idx> ]
88

99
where
1010

1111
- shape: dimensions sorted in loop order.
1212
- strides: strides for each respective ndarray sorted in loop order.
13+
- idx: dimension indices sorted in loop order.
1314

1415
For all returned arrays, the first element corresponds to the innermost
1516
loop, and the last element corresponds to the outermost loop.

‎base/loop-interchange-order/docs/types/index.d.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ import { ArrayLike } from '@stdlib/types/array';
3030
* - The returned array has the following elements:
3131
*
3232
* ```text
33-
* [ <shape>, ...<strides> ]
33+
* [ <shape>, ...<strides>, <idx> ]
3434
* ```
3535
*
3636
* where
3737
*
3838
* - **shape**: dimensions sorted in loop order.
3939
* - **...strides**: strides for each respective ndarray sorted in loop order.
40+
* - **idx**: dimension indices sorted in loop order.
4041
*
4142
* - 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.
4243
*
@@ -71,6 +72,9 @@ import { ArrayLike } from '@stdlib/types/array';
7172
*
7273
* var ssz = o[ 3 ];
7374
* // returns [ 6, -2, 1 ]
75+
*
76+
* var idx = o[ 4 ];
77+
* // returns [ 2, 1, 0 ]
7478
*/
7579
declare function loopOrder( shape: ArrayLike<number>, strides: ArrayLike<ArrayLike<number>> ): Array<Array<number>>;
7680

0 commit comments

Comments
 (0)