Skip to content

Commit 64532cc

Browse files
committed
Auto-generated commit
1 parent 98eb0b6 commit 64532cc

25 files changed

Lines changed: 93 additions & 90 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251

252252
### Bug Fixes
253253

254+
- [`ab22671`](https://github.com/stdlib-js/stdlib/commit/ab2267149121cf347c5be11d7bfc7ee64e4f663a) - use resolved order when computing loop variables
254255
- [`18036a4`](https://github.com/stdlib-js/stdlib/commit/18036a4b73cbae2f90f5ce929645d1eb769138dc) - use resolved order when determining increment offsets
255256
- [`3ce09af`](https://github.com/stdlib-js/stdlib/commit/3ce09af9819ae7dbaad178179264fc84c5db5690) - ensure separate array instance for each memory layout
256257
- [`7c29c2d`](https://github.com/stdlib-js/stdlib/commit/7c29c2d3aea7b8d0396a77f6781d7d76bd7adde4) - use computed order
@@ -352,6 +353,10 @@ A total of 14 issues were closed in this release:
352353

353354
<details>
354355

356+
- [`25f29f8`](https://github.com/stdlib-js/stdlib/commit/25f29f85b888fd71646902ad9cda4f5f6aa62eff) - **refactor:** use base assertion utility _(by Athan Reines)_
357+
- [`3088dea`](https://github.com/stdlib-js/stdlib/commit/3088deabee417ce890ccb15e87066ef11c3f2305) - **test:** fix lint errors _(by Athan Reines)_
358+
- [`b9d3f03`](https://github.com/stdlib-js/stdlib/commit/b9d3f03a8fc45fa0f65dc1ded1a5b40125a0a0fb) - **refactor:** use base assertion utility _(by Athan Reines)_
359+
- [`ab22671`](https://github.com/stdlib-js/stdlib/commit/ab2267149121cf347c5be11d7bfc7ee64e4f663a) - **fix:** use resolved order when computing loop variables _(by Athan Reines)_
355360
- [`18036a4`](https://github.com/stdlib-js/stdlib/commit/18036a4b73cbae2f90f5ce929645d1eb769138dc) - **fix:** use resolved order when determining increment offsets _(by Athan Reines)_
356361
- [`ac7d5b4`](https://github.com/stdlib-js/stdlib/commit/ac7d5b41eeefdc2a27ffeb244442c2e29feb728c) - **refactor:** use assertion utility rather than hardcoded string _(by Athan Reines)_
357362
- [`2464b78`](https://github.com/stdlib-js/stdlib/commit/2464b78c6e164fd048d04d13d57a3ba44707cac9) - **docs:** remove import _(by Athan Reines)_

array/lib/expand_strides.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
// MODULES //
2222

23+
var isRowMajor = require( './../../base/assert/is-row-major-string' );
2324
var abs = require( '@stdlib/math/base/special/abs' );
2425

2526

@@ -53,7 +54,7 @@ function expandStrides( ndims, shape, strides, order ) {
5354
N = strides.length;
5455
j = ndims - N;
5556
out = [];
56-
if ( order === 'row-major' ) {
57+
if ( isRowMajor( order ) ) {
5758
s = abs( strides[ 0 ] ) * shape[ j ]; // at `j` is the size of the first non-prepended dimension
5859
for ( i = 0; i < j; i++ ) {
5960
out.push( s );

base/assign/lib/10d.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {IntegerArray} y.strides - stride lengths
4141
* @param {NonNegativeInteger} y.offset - index offset
4242
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -79,12 +80,12 @@
7980
* };
8081
*
8182
* // Copy elements:
82-
* assign10d( x, y );
83+
* assign10d( x, y, true );
8384
*
8485
* console.log( y.data );
8586
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0, 10.0, 11.0 ]
8687
*/
87-
function assign10d( x, y ) { // eslint-disable-line max-statements
88+
function assign10d( x, y, isRowMajor ) { // eslint-disable-line max-statements
8889
var xbuf;
8990
var ybuf;
9091
var dx0;
@@ -139,7 +140,7 @@ function assign10d( x, y ) { // eslint-disable-line max-statements
139140
sh = x.shape;
140141
sx = x.strides;
141142
sy = y.strides;
142-
if ( x.order === 'row-major' ) {
143+
if ( isRowMajor ) {
143144
// For row-major ndarrays, the last dimensions have the fastest changing indices...
144145
S0 = sh[ 9 ];
145146
S1 = sh[ 8 ];

base/assign/lib/10d_accessors.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* @param {NonNegativeInteger} y.offset - index offset
4343
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4444
* @param {Array<Function>} y.accessors - data buffer accessors
45+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4546
* @returns {void}
4647
*
4748
* @example
@@ -95,7 +96,7 @@
9596
* };
9697
*
9798
* // Copy elements:
98-
* assign10d( x, y );
99+
* assign10d( x, y, true );
99100
*
100101
* var v = y.data.get( 0 );
101102
*
@@ -105,7 +106,7 @@
105106
* var im = imagf( v );
106107
* // returns 2.0
107108
*/
108-
function assign10d( x, y ) { // eslint-disable-line max-statements
109+
function assign10d( x, y, isRowMajor ) { // eslint-disable-line max-statements
109110
var xbuf;
110111
var ybuf;
111112
var get;
@@ -162,7 +163,7 @@ function assign10d( x, y ) { // eslint-disable-line max-statements
162163
sh = x.shape;
163164
sx = x.strides;
164165
sy = y.strides;
165-
if ( x.order === 'row-major' ) {
166+
if ( isRowMajor ) {
166167
// For row-major ndarrays, the last dimensions have the fastest changing indices...
167168
S0 = sh[ 9 ];
168169
S1 = sh[ 8 ];

base/assign/lib/2d.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @param {IntegerArray} y.strides - stride lengths
3939
* @param {NonNegativeInteger} y.offset - index offset
4040
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
41+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4142
* @returns {void}
4243
*
4344
* @example
@@ -77,12 +78,12 @@
7778
* };
7879
*
7980
* // Copy elements:
80-
* assign2d( x, y );
81+
* assign2d( x, y, true );
8182
*
8283
* console.log( y.data );
8384
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0 ]
8485
*/
85-
function assign2d( x, y ) {
86+
function assign2d( x, y, isRowMajor ) {
8687
var xbuf;
8788
var ybuf;
8889
var dx0;
@@ -105,7 +106,7 @@ function assign2d( x, y ) {
105106
sh = x.shape;
106107
sx = x.strides;
107108
sy = y.strides;
108-
if ( x.order === 'row-major' ) {
109+
if ( isRowMajor ) {
109110
// For row-major ndarrays, the last dimensions have the fastest changing indices...
110111
S0 = sh[ 1 ];
111112
S1 = sh[ 0 ];

base/assign/lib/2d_accessors.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {NonNegativeInteger} y.offset - index offset
4141
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4242
* @param {Array<Function>} y.accessors - data buffer accessors
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -93,7 +94,7 @@
9394
* };
9495
*
9596
* // Copy elements:
96-
* assign2d( x, y );
97+
* assign2d( x, y, true );
9798
*
9899
* var v = y.data.get( 0 );
99100
*
@@ -103,7 +104,7 @@
103104
* var im = imagf( v );
104105
* // returns 2.0
105106
*/
106-
function assign2d( x, y ) {
107+
function assign2d( x, y, isRowMajor ) {
107108
var xbuf;
108109
var ybuf;
109110
var get;
@@ -128,7 +129,7 @@ function assign2d( x, y ) {
128129
sh = x.shape;
129130
sx = x.strides;
130131
sy = y.strides;
131-
if ( x.order === 'row-major' ) {
132+
if ( isRowMajor ) {
132133
// For row-major ndarrays, the last dimensions have the fastest changing indices...
133134
S0 = sh[ 1 ];
134135
S1 = sh[ 0 ];

base/assign/lib/3d.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @param {IntegerArray} y.strides - stride lengths
3939
* @param {NonNegativeInteger} y.offset - index offset
4040
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
41+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4142
* @returns {void}
4243
*
4344
* @example
@@ -77,12 +78,12 @@
7778
* };
7879
*
7980
* // Copy elements:
80-
* assign3d( x, y );
81+
* assign3d( x, y, true );
8182
*
8283
* console.log( y.data );
8384
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0, 10.0, 11.0 ]
8485
*/
85-
function assign3d( x, y ) {
86+
function assign3d( x, y, isRowMajor ) {
8687
var xbuf;
8788
var ybuf;
8889
var dx0;
@@ -109,7 +110,7 @@ function assign3d( x, y ) {
109110
sh = x.shape;
110111
sx = x.strides;
111112
sy = y.strides;
112-
if ( x.order === 'row-major' ) {
113+
if ( isRowMajor ) {
113114
// For row-major ndarrays, the last dimensions have the fastest changing indices...
114115
S0 = sh[ 2 ];
115116
S1 = sh[ 1 ];

base/assign/lib/3d_accessors.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {NonNegativeInteger} y.offset - index offset
4141
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4242
* @param {Array<Function>} y.accessors - data buffer accessors
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -93,7 +94,7 @@
9394
* };
9495
*
9596
* // Copy elements:
96-
* assign3d( x, y );
97+
* assign3d( x, y, true );
9798
*
9899
* var v = y.data.get( 0 );
99100
*
@@ -103,7 +104,7 @@
103104
* var im = imagf( v );
104105
* // returns 2.0
105106
*/
106-
function assign3d( x, y ) {
107+
function assign3d( x, y, isRowMajor ) {
107108
var xbuf;
108109
var ybuf;
109110
var get;
@@ -132,7 +133,7 @@ function assign3d( x, y ) {
132133
sh = x.shape;
133134
sx = x.strides;
134135
sy = y.strides;
135-
if ( x.order === 'row-major' ) {
136+
if ( isRowMajor ) {
136137
// For row-major ndarrays, the last dimensions have the fastest changing indices...
137138
S0 = sh[ 2 ];
138139
S1 = sh[ 1 ];

base/assign/lib/4d.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @param {IntegerArray} y.strides - stride lengths
3939
* @param {NonNegativeInteger} y.offset - index offset
4040
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
41+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4142
* @returns {void}
4243
*
4344
* @example
@@ -77,12 +78,12 @@
7778
* };
7879
*
7980
* // Copy elements:
80-
* assign4d( x, y );
81+
* assign4d( x, y, true );
8182
*
8283
* console.log( y.data );
8384
* // => <Float64Array>[ 2.0, 3.0, 6.0, 7.0, 10.0, 11.0 ]
8485
*/
85-
function assign4d( x, y ) {
86+
function assign4d( x, y, isRowMajor ) {
8687
var xbuf;
8788
var ybuf;
8889
var dx0;
@@ -113,7 +114,7 @@ function assign4d( x, y ) {
113114
sh = x.shape;
114115
sx = x.strides;
115116
sy = y.strides;
116-
if ( x.order === 'row-major' ) {
117+
if ( isRowMajor ) {
117118
// For row-major ndarrays, the last dimensions have the fastest changing indices...
118119
S0 = sh[ 3 ];
119120
S1 = sh[ 2 ];

base/assign/lib/4d_accessors.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @param {NonNegativeInteger} y.offset - index offset
4141
* @param {string} y.order - specifies whether `y` is row-major (C-style) or column-major (Fortran-style)
4242
* @param {Array<Function>} y.accessors - data buffer accessors
43+
* @param {boolean} isRowMajor - boolean indicating if provided arrays are in row-major order
4344
* @returns {void}
4445
*
4546
* @example
@@ -93,7 +94,7 @@
9394
* };
9495
*
9596
* // Copy elements:
96-
* assign4d( x, y );
97+
* assign4d( x, y, true );
9798
*
9899
* var v = y.data.get( 0 );
99100
*
@@ -103,7 +104,7 @@
103104
* var im = imagf( v );
104105
* // returns 2.0
105106
*/
106-
function assign4d( x, y ) {
107+
function assign4d( x, y, isRowMajor ) {
107108
var xbuf;
108109
var ybuf;
109110
var get;
@@ -136,7 +137,7 @@ function assign4d( x, y ) {
136137
sh = x.shape;
137138
sx = x.strides;
138139
sy = y.strides;
139-
if ( x.order === 'row-major' ) {
140+
if ( isRowMajor ) {
140141
// For row-major ndarrays, the last dimensions have the fastest changing indices...
141142
S0 = sh[ 3 ];
142143
S1 = sh[ 2 ];

0 commit comments

Comments
 (0)