Skip to content

Commit 20907a6

Browse files
committed
Auto-generated commit
1 parent 5d7392a commit 20907a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+275
-369
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,10 @@ A total of 14 issues were closed in this release:
362362

363363
<details>
364364

365+
- [`a616f66`](https://github.com/stdlib-js/stdlib/commit/a616f66172ea9e5ea730258daff8232f38675e39) - **refactor:** avoid duplicate computation _(by Athan Reines)_
366+
- [`1d2c4e2`](https://github.com/stdlib-js/stdlib/commit/1d2c4e2ef621e2304c5d855c4c8b6ed2f9e9e1ad) - **refactor:** avoid duplicate computation _(by Athan Reines)_
367+
- [`0fb7df7`](https://github.com/stdlib-js/stdlib/commit/0fb7df7fe84102add9858f53da605a6f2e0d42a9) - **docs:** document expected properties for accessor kernels _(by Athan Reines)_
368+
- [`529687d`](https://github.com/stdlib-js/stdlib/commit/529687d72291fe7c2f717e24bffe55130375139d) - **refactor:** avoid duplicate computation _(by Athan Reines)_
365369
- [`b9e9eca`](https://github.com/stdlib-js/stdlib/commit/b9e9eca93c4611a77122090ab8e589e6ba82e47b) - **fix:** use resolved order when computing loop variables _(by Athan Reines)_
366370
- [`1e0917b`](https://github.com/stdlib-js/stdlib/commit/1e0917b1bba1d273d93e8fa97cc8a060661bbbf0) - **fix:** use resolved order when computing loop variables _(by Athan Reines)_
367371
- [`92bf1a1`](https://github.com/stdlib-js/stdlib/commit/92bf1a12b2398ec5823eb3094bdc89f88d9876a7) - **fix:** use resolved order when computing loop variables _(by Athan Reines)_

base/map/lib/10d.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
// MODULES //
2424

25-
var strides2order = require( './../../../base/strides2order' );
2625
var zeroTo = require( '@stdlib/array/base/zero-to' );
2726
var reverse = require( '@stdlib/array/base/reverse' );
2827
var take = require( '@stdlib/array/base/take-indexed' );
@@ -49,6 +48,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
4948
* @param {IntegerArray} y.strides - stride lengths
5049
* @param {NonNegativeInteger} y.offset - index offset
5150
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
51+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5252
* @param {Callback} fcn - callback function
5353
* @param {*} thisArg - callback execution context
5454
* @returns {void}
@@ -95,12 +95,12 @@ var take = require( '@stdlib/array/base/take-indexed' );
9595
* };
9696
*
9797
* // Apply the map function:
98-
* map10d( x, y, scale, {} );
98+
* map10d( x, y, true, scale, {} );
9999
*
100100
* console.log( y.data );
101101
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
102102
*/
103-
function map10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements
103+
function map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements
104104
var xbuf;
105105
var ybuf;
106106
var dx0;
@@ -157,7 +157,7 @@ function map10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements
157157
sx = x.strides;
158158
sy = y.strides;
159159
idx = zeroTo( sh.length );
160-
if ( strides2order( sx ) === 1 ) {
160+
if ( isRowMajor ) {
161161
// For row-major ndarrays, the last dimensions have the fastest changing indices...
162162
S0 = sh[ 9 ];
163163
S1 = sh[ 8 ];

base/map/lib/10d_accessors.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
// MODULES //
2424

25-
var strides2order = require( './../../../base/strides2order' );
2625
var zeroTo = require( '@stdlib/array/base/zero-to' );
2726
var reverse = require( '@stdlib/array/base/reverse' );
2827
var take = require( '@stdlib/array/base/take-indexed' );
@@ -42,13 +41,16 @@ var take = require( '@stdlib/array/base/take-indexed' );
4241
* @param {IntegerArray} x.strides - stride lengths
4342
* @param {NonNegativeInteger} x.offset - index offset
4443
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
44+
* @param {Array<Function>} x.accessors - data buffer accessors
4545
* @param {Object} y - object containing output ndarray meta data
4646
* @param {string} y.dtype - data type
4747
* @param {Collection} y.data - data buffer
4848
* @param {NonNegativeIntegerArray} y.shape - dimensions
4949
* @param {IntegerArray} y.strides - stride lengths
5050
* @param {NonNegativeInteger} y.offset - index offset
5151
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
52+
* @param {Array<Function>} y.accessors - data buffer accessors
53+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5254
* @param {Callback} fcn - callback function
5355
* @param {*} thisArg - callback execution context
5456
* @returns {void}
@@ -109,7 +111,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
109111
* };
110112
*
111113
* // Apply the map function:
112-
* map10d( x, y, scale, {} );
114+
* map10d( x, y, true, scale, {} );
113115
*
114116
* var v = y.data.get( 0 );
115117
*
@@ -119,7 +121,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
119121
* var im = imagf( v );
120122
* // returns 20.0
121123
*/
122-
function map10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements
124+
function map10d( x, y, isRowMajor, fcn, thisArg ) { // eslint-disable-line max-statements
123125
var xbuf;
124126
var ybuf;
125127
var get;
@@ -178,7 +180,7 @@ function map10d( x, y, fcn, thisArg ) { // eslint-disable-line max-statements
178180
sx = x.strides;
179181
sy = y.strides;
180182
idx = zeroTo( sh.length );
181-
if ( strides2order( sx ) === 1 ) {
183+
if ( isRowMajor ) {
182184
// For row-major ndarrays, the last dimensions have the fastest changing indices...
183185
S0 = sh[ 9 ];
184186
S1 = sh[ 8 ];

base/map/lib/10d_blocked_accessors.js

+2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ var reverse = require( '@stdlib/array/base/reverse' );
4242
* @param {IntegerArray} x.strides - stride lengths
4343
* @param {NonNegativeInteger} x.offset - index offset
4444
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
45+
* @param {Array<Function>} x.accessors - data buffer accessors
4546
* @param {Object} y - object containing output ndarray meta data
4647
* @param {string} y.dtype - data type
4748
* @param {Collection} y.data - data buffer
4849
* @param {NonNegativeIntegerArray} y.shape - dimensions
4950
* @param {IntegerArray} y.strides - stride lengths
5051
* @param {NonNegativeInteger} y.offset - index offset
5152
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
53+
* @param {Array<Function>} y.accessors - data buffer accessors
5254
* @param {Callback} fcn - callback function
5355
* @param {*} thisArg - callback execution context
5456
* @returns {void}

base/map/lib/1d_accessors.js

+2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@
3232
* @param {IntegerArray} x.strides - stride lengths
3333
* @param {NonNegativeInteger} x.offset - index offset
3434
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
35+
* @param {Array<Function>} x.accessors - data buffer accessors
3536
* @param {Object} y - object containing output ndarray meta data
3637
* @param {string} y.dtype - data type
3738
* @param {Collection} y.data - data buffer
3839
* @param {NonNegativeIntegerArray} y.shape - dimensions
3940
* @param {IntegerArray} y.strides - stride lengths
4041
* @param {NonNegativeInteger} y.offset - index offset
4142
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
43+
* @param {Array<Function>} y.accessors - data buffer accessors
4244
* @param {Callback} fcn - callback function
4345
* @param {*} thisArg - callback execution context
4446
* @returns {void}

base/map/lib/2d.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var strides2order = require( './../../../base/strides2order' );
2423
var zeroTo = require( '@stdlib/array/base/zero-to' );
2524
var reverse = require( '@stdlib/array/base/reverse' );
2625
var take = require( '@stdlib/array/base/take-indexed' );
@@ -47,6 +46,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
4746
* @param {IntegerArray} y.strides - stride lengths
4847
* @param {NonNegativeInteger} y.offset - index offset
4948
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
49+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5050
* @param {Callback} fcn - callback function
5151
* @param {*} thisArg - callback execution context
5252
* @returns {void}
@@ -93,12 +93,12 @@ var take = require( '@stdlib/array/base/take-indexed' );
9393
* };
9494
*
9595
* // Apply the map function:
96-
* map2d( x, y, scale, {} );
96+
* map2d( x, y, true, scale, {} );
9797
*
9898
* console.log( y.data );
9999
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0 ]
100100
*/
101-
function map2d( x, y, fcn, thisArg ) {
101+
function map2d( x, y, isRowMajor, fcn, thisArg ) {
102102
var xbuf;
103103
var ybuf;
104104
var dx0;
@@ -123,7 +123,7 @@ function map2d( x, y, fcn, thisArg ) {
123123
sx = x.strides;
124124
sy = y.strides;
125125
idx = zeroTo( sh.length );
126-
if ( strides2order( sx ) === 1 ) {
126+
if ( isRowMajor ) {
127127
// For row-major ndarrays, the last dimensions have the fastest changing indices...
128128
S0 = sh[ 1 ];
129129
S1 = sh[ 0 ];

base/map/lib/2d_accessors.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var strides2order = require( './../../../base/strides2order' );
2423
var zeroTo = require( '@stdlib/array/base/zero-to' );
2524
var reverse = require( '@stdlib/array/base/reverse' );
2625
var take = require( '@stdlib/array/base/take-indexed' );
@@ -40,13 +39,16 @@ var take = require( '@stdlib/array/base/take-indexed' );
4039
* @param {IntegerArray} x.strides - stride lengths
4140
* @param {NonNegativeInteger} x.offset - index offset
4241
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
42+
* @param {Array<Function>} x.accessors - data buffer accessors
4343
* @param {Object} y - object containing output ndarray meta data
4444
* @param {string} y.dtype - data type
4545
* @param {Collection} y.data - data buffer
4646
* @param {NonNegativeIntegerArray} y.shape - dimensions
4747
* @param {IntegerArray} y.strides - stride lengths
4848
* @param {NonNegativeInteger} y.offset - index offset
4949
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
50+
* @param {Array<Function>} y.accessors - data buffer accessors
51+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5052
* @param {Callback} fcn - callback function
5153
* @param {*} thisArg - callback execution context
5254
* @returns {void}
@@ -107,7 +109,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
107109
* };
108110
*
109111
* // Apply the map function:
110-
* map2d( x, y, scale, {} );
112+
* map2d( x, y, true, scale, {} );
111113
*
112114
* var v = y.data.get( 0 );
113115
*
@@ -117,7 +119,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
117119
* var im = imagf( v );
118120
* // returns 20.0
119121
*/
120-
function map2d( x, y, fcn, thisArg ) {
122+
function map2d( x, y, isRowMajor, fcn, thisArg ) {
121123
var xbuf;
122124
var ybuf;
123125
var get;
@@ -144,7 +146,7 @@ function map2d( x, y, fcn, thisArg ) {
144146
sx = x.strides;
145147
sy = y.strides;
146148
idx = zeroTo( sh.length );
147-
if ( strides2order( sx ) === 1 ) {
149+
if ( isRowMajor ) {
148150
// For row-major ndarrays, the last dimensions have the fastest changing indices...
149151
S0 = sh[ 1 ];
150152
S1 = sh[ 0 ];

base/map/lib/2d_blocked_accessors.js

+2
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ var reverse = require( '@stdlib/array/base/reverse' );
4040
* @param {IntegerArray} x.strides - stride lengths
4141
* @param {NonNegativeInteger} x.offset - index offset
4242
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
43+
* @param {Array<Function>} x.accessors - data buffer accessors
4344
* @param {Object} y - object containing output ndarray meta data
4445
* @param {string} y.dtype - data type
4546
* @param {Collection} y.data - data buffer
4647
* @param {NonNegativeIntegerArray} y.shape - dimensions
4748
* @param {IntegerArray} y.strides - stride lengths
4849
* @param {NonNegativeInteger} y.offset - index offset
4950
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
51+
* @param {Array<Function>} y.accessors - data buffer accessors
5052
* @param {Callback} fcn - callback function
5153
* @param {*} thisArg - callback execution context
5254
* @returns {void}

base/map/lib/3d.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var strides2order = require( './../../../base/strides2order' );
2423
var zeroTo = require( '@stdlib/array/base/zero-to' );
2524
var reverse = require( '@stdlib/array/base/reverse' );
2625
var take = require( '@stdlib/array/base/take-indexed' );
@@ -47,6 +46,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
4746
* @param {IntegerArray} y.strides - stride lengths
4847
* @param {NonNegativeInteger} y.offset - index offset
4948
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
49+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5050
* @param {Callback} fcn - callback function
5151
* @param {*} thisArg - callback execution context
5252
* @returns {void}
@@ -93,12 +93,12 @@ var take = require( '@stdlib/array/base/take-indexed' );
9393
* };
9494
*
9595
* // Apply the map function:
96-
* map3d( x, y, scale, {} );
96+
* map3d( x, y, true, scale, {} );
9797
*
9898
* console.log( y.data );
9999
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
100100
*/
101-
function map3d( x, y, fcn, thisArg ) {
101+
function map3d( x, y, isRowMajor, fcn, thisArg ) {
102102
var xbuf;
103103
var ybuf;
104104
var dx0;
@@ -127,7 +127,7 @@ function map3d( x, y, fcn, thisArg ) {
127127
sx = x.strides;
128128
sy = y.strides;
129129
idx = zeroTo( sh.length );
130-
if ( strides2order( sx ) === 1 ) {
130+
if ( isRowMajor ) {
131131
// For row-major ndarrays, the last dimensions have the fastest changing indices...
132132
S0 = sh[ 2 ];
133133
S1 = sh[ 1 ];

base/map/lib/3d_accessors.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var strides2order = require( './../../../base/strides2order' );
2423
var zeroTo = require( '@stdlib/array/base/zero-to' );
2524
var reverse = require( '@stdlib/array/base/reverse' );
2625
var take = require( '@stdlib/array/base/take-indexed' );
@@ -40,13 +39,16 @@ var take = require( '@stdlib/array/base/take-indexed' );
4039
* @param {IntegerArray} x.strides - stride lengths
4140
* @param {NonNegativeInteger} x.offset - index offset
4241
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
42+
* @param {Array<Function>} x.accessors - data buffer accessors
4343
* @param {Object} y - object containing output ndarray meta data
4444
* @param {string} y.dtype - data type
4545
* @param {Collection} y.data - data buffer
4646
* @param {NonNegativeIntegerArray} y.shape - dimensions
4747
* @param {IntegerArray} y.strides - stride lengths
4848
* @param {NonNegativeInteger} y.offset - index offset
4949
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
50+
* @param {Array<Function>} y.accessors - data buffer accessors
51+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5052
* @param {Callback} fcn - callback function
5153
* @param {*} thisArg - callback execution context
5254
* @returns {void}
@@ -107,7 +109,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
107109
* };
108110
*
109111
* // Apply the map function:
110-
* map3d( x, y, scale, {} );
112+
* map3d( x, y, true, scale, {} );
111113
*
112114
* var v = y.data.get( 0 );
113115
*
@@ -117,7 +119,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
117119
* var im = imagf( v );
118120
* // returns 20.0
119121
*/
120-
function map3d( x, y, fcn, thisArg ) {
122+
function map3d( x, y, isRowMajor, fcn, thisArg ) {
121123
var xbuf;
122124
var ybuf;
123125
var dx0;
@@ -148,7 +150,7 @@ function map3d( x, y, fcn, thisArg ) {
148150
sx = x.strides;
149151
sy = y.strides;
150152
idx = zeroTo( sh.length );
151-
if ( strides2order( sx ) === 1 ) {
153+
if ( isRowMajor ) {
152154
// For row-major ndarrays, the last dimensions have the fastest changing indices...
153155
S0 = sh[ 2 ];
154156
S1 = sh[ 1 ];

base/map/lib/3d_blocked_accessors.js

+2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ var reverse = require( '@stdlib/array/base/reverse' );
4242
* @param {IntegerArray} x.strides - stride lengths
4343
* @param {NonNegativeInteger} x.offset - index offset
4444
* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)
45+
* @param {Array<Function>} x.accessors - data buffer accessors
4546
* @param {Object} y - object containing output ndarray meta data
4647
* @param {string} y.dtype - data type
4748
* @param {Collection} y.data - data buffer
4849
* @param {NonNegativeIntegerArray} y.shape - dimensions
4950
* @param {IntegerArray} y.strides - stride lengths
5051
* @param {NonNegativeInteger} y.offset - index offset
5152
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
53+
* @param {Array<Function>} y.accessors - data buffer accessors
5254
* @param {Callback} fcn - callback function
5355
* @param {*} thisArg - callback execution context
5456
* @returns {void}

base/map/lib/4d.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var strides2order = require( './../../../base/strides2order' );
2423
var zeroTo = require( '@stdlib/array/base/zero-to' );
2524
var reverse = require( '@stdlib/array/base/reverse' );
2625
var take = require( '@stdlib/array/base/take-indexed' );
@@ -47,6 +46,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
4746
* @param {IntegerArray} y.strides - stride lengths
4847
* @param {NonNegativeInteger} y.offset - index offset
4948
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
49+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
5050
* @param {Callback} fcn - callback function
5151
* @param {*} thisArg - callback execution context
5252
* @returns {void}
@@ -93,12 +93,12 @@ var take = require( '@stdlib/array/base/take-indexed' );
9393
* };
9494
*
9595
* // Apply the map function:
96-
* map4d( x, y, scale, {} );
96+
* map4d( x, y, true, scale, {} );
9797
*
9898
* console.log( y.data );
9999
* // => <Float64Array>[ 20.0, 30.0, 60.0, 70.0, 100.0, 110.0 ]
100100
*/
101-
function map4d( x, y, fcn, thisArg ) {
101+
function map4d( x, y, isRowMajor, fcn, thisArg ) {
102102
var xbuf;
103103
var ybuf;
104104
var dx0;
@@ -131,7 +131,7 @@ function map4d( x, y, fcn, thisArg ) {
131131
sx = x.strides;
132132
sy = y.strides;
133133
idx = zeroTo( sh.length );
134-
if ( strides2order( sx ) === 1 ) {
134+
if ( isRowMajor ) {
135135
// For row-major ndarrays, the last dimensions have the fastest changing indices...
136136
S0 = sh[ 3 ];
137137
S1 = sh[ 2 ];

0 commit comments

Comments
 (0)