Skip to content

Commit 212d1ae

Browse files
committed
Auto-generated commit
1 parent 69a5ef2 commit 212d1ae

File tree

5 files changed

+49
-44
lines changed

5 files changed

+49
-44
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ A total of 37 issues were closed in this release:
675675

676676
<details>
677677

678+
- [`72be5b1`](https://github.com/stdlib-js/stdlib/commit/72be5b1a80bbbbb72c79f85e034e0cafc989f1c7) - **test:** use function accessors _(by Athan Reines)_
678679
- [`fdf2934`](https://github.com/stdlib-js/stdlib/commit/fdf2934a97d8c754e52045dd10127ee4d85b0dad) - **docs:** update dtype type and use accessor functions _(by Athan Reines)_
679680
- [`7475400`](https://github.com/stdlib-js/stdlib/commit/7475400f3b912be86c17f2a915d1a4febcc6522d) - **docs:** move content to notes _(by Athan Reines)_
680681
- [`e99cdea`](https://github.com/stdlib-js/stdlib/commit/e99cdea5e029b2f53b27482f7ee22821fb0b3b95) - **docs:** update dtype type _(by Athan Reines)_

base/binary/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,6 @@ The function accepts the following arguments:
104104
- **arrays**: array-like object containing two input ndarrays and one output ndarray.
105105
- **fcn**: binary function to apply.
106106

107-
Each provided ndarray should be an object with the following properties:
108-
109-
- **dtype**: data type.
110-
- **data**: data buffer.
111-
- **shape**: dimensions.
112-
- **strides**: stride lengths.
113-
- **offset**: index offset.
114-
- **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).
115-
116107
</section>
117108

118109
<!-- /.usage -->
@@ -123,6 +114,16 @@ Each provided ndarray should be an object with the following properties:
123114

124115
## Notes
125116

117+
118+
- Each provided ndarray should be an object with the following properties:
119+
120+
- **dtype**: data type.
121+
- **data**: data buffer.
122+
- **shape**: dimensions.
123+
- **strides**: stride lengths.
124+
- **offset**: index offset.
125+
- **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).
126+
126127
- For very high-dimensional ndarrays which are non-contiguous, one should consider copying the underlying data to contiguous memory before applying a binary function in order to achieve better performance.
127128

128129
</section>

base/binary/test/test.0d.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' );
2929
var scalar2ndarray = require( './../../../from-scalar' );
3030
var add = require( '@stdlib/number/float64/base/add' );
3131
var zadd = require( '@stdlib/complex/float64/base/add' );
32+
var getData = require( './../../../data-buffer' );
3233
var binary = require( './../lib' );
3334

3435

@@ -56,7 +57,7 @@ tape( 'the function applies a binary callback to indexed elements of two 0-dimen
5657
binary( [ x, x, y ], add );
5758

5859
expected = new Float64Array( [ 10.0 ] );
59-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
60+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
6061
t.end();
6162
});
6263

@@ -76,6 +77,6 @@ tape( 'the function applies a binary callback to indexed elements of two 0-dimen
7677
binary( [ x, x, y ], zadd );
7778

7879
expected = new Complex128Array( [ 10.0, 10.0 ] );
79-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
80+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
8081
t.end();
8182
});

base/binary/test/test.1d.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var zeros = require( '@stdlib/array/zeros' );
2929
var ndarray = require( './../../../ctor' );
3030
var add = require( '@stdlib/number/float64/base/add' );
3131
var zadd = require( '@stdlib/complex/float64/base/add' );
32+
var getData = require( './../../../data-buffer' );
3233
var binary = require( './../lib' );
3334

3435

@@ -56,7 +57,7 @@ tape( 'the function applies a binary callback to indexed elements of two 1-dimen
5657
6.0,
5758
8.0
5859
]);
59-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
60+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
6061
t.end();
6162
});
6263

@@ -76,7 +77,7 @@ tape( 'the function applies a binary callback to indexed elements of two 1-dimen
7677
0.0,
7778
0.0
7879
]);
79-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
80+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
8081
t.end();
8182
});
8283

@@ -100,6 +101,6 @@ tape( 'the function applies a binary callback to indexed elements of two 1-dimen
100101
14.0,
101102
16.0
102103
]);
103-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
104+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
104105
t.end();
105106
});

base/binary/test/test.2d.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var zfill = require( '@stdlib/blas/ext/base/zfill' );
3838
var blockSize = require( './../../../base/nullary-tiling-block-size' );
3939
var add = require( '@stdlib/number/float64/base/add' );
4040
var zadd = require( '@stdlib/complex/float64/base/add' );
41+
var getData = require( './../../../data-buffer' );
4142
var binary = require( './../lib' );
4243

4344

@@ -76,7 +77,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
7677
6.0,
7778
8.0
7879
]);
79-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
80+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
8081
t.end();
8182
});
8283

@@ -111,7 +112,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
111112
14.0,
112113
16.0
113114
]);
114-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
115+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
115116
t.end();
116117
});
117118

@@ -140,7 +141,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
140141
0.0,
141142
0.0
142143
]);
143-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
144+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
144145
t.end();
145146
});
146147

@@ -171,7 +172,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
171172
6.0,
172173
8.0
173174
]);
174-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
175+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
175176
t.end();
176177
});
177178

@@ -202,7 +203,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
202203
6.0,
203204
8.0
204205
]);
205-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
206+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
206207
t.end();
207208
});
208209

@@ -237,7 +238,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
237238
0.0,
238239
0.0
239240
]);
240-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
241+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
241242
t.end();
242243
});
243244

@@ -272,7 +273,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
272273
0.0,
273274
0.0
274275
]);
275-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
276+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
276277
t.end();
277278
});
278279

@@ -303,7 +304,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
303304
expected = new Float64Array( x.length*2 );
304305
dfill( x.length, 2.0, expected, st[ 1 ] );
305306

306-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
307+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
307308
t.end();
308309
});
309310

@@ -334,7 +335,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
334335
expected = new Float64Array( x.length*2 );
335336
dfill( x.length, 2.0, expected, st[ 1 ] );
336337

337-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
338+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
338339
t.end();
339340
});
340341

@@ -369,7 +370,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
369370
14.0,
370371
16.0
371372
]);
372-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
373+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
373374
t.end();
374375
});
375376

@@ -404,7 +405,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
404405
14.0,
405406
16.0
406407
]);
407-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
408+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
408409
t.end();
409410
});
410411

@@ -447,7 +448,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
447448
0.0,
448449
0.0
449450
]);
450-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
451+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
451452
t.end();
452453
});
453454

@@ -490,7 +491,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
490491
0.0,
491492
0.0
492493
]);
493-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
494+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
494495
t.end();
495496
});
496497

@@ -521,7 +522,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
521522
expected = new Complex128Array( x.length*2 );
522523
zfill( x.length, new Complex128( 2.0, 2.0 ), expected, st[ 1 ] );
523524

524-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
525+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
525526
t.end();
526527
});
527528

@@ -552,7 +553,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
552553
expected = new Complex128Array( x.length*2 );
553554
zfill( x.length, new Complex128( 2.0, 2.0 ), expected, st[ 1 ] );
554555

555-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
556+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
556557
t.end();
557558
});
558559

@@ -583,7 +584,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
583584
6.0,
584585
8.0
585586
]);
586-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
587+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
587588
t.end();
588589
});
589590

@@ -618,7 +619,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
618619
14.0,
619620
16.0
620621
]);
621-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
622+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
622623
t.end();
623624
});
624625

@@ -638,7 +639,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
638639
0.0,
639640
0.0
640641
]);
641-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
642+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
642643
t.end();
643644
});
644645

@@ -669,7 +670,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
669670
6.0,
670671
8.0
671672
]);
672-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
673+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
673674
t.end();
674675
});
675676

@@ -700,7 +701,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
700701
6.0,
701702
8.0
702703
]);
703-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
704+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
704705
t.end();
705706
});
706707

@@ -735,7 +736,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
735736
0.0,
736737
0.0
737738
]);
738-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
739+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
739740
t.end();
740741
});
741742

@@ -770,7 +771,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
770771
0.0,
771772
0.0
772773
]);
773-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
774+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
774775
t.end();
775776
});
776777

@@ -801,7 +802,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
801802
expected = new Float64Array( x.length*2 );
802803
dfill( x.length, 2.0, expected, st[ 0 ] );
803804

804-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
805+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
805806
t.end();
806807
});
807808

@@ -832,7 +833,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
832833
expected = new Float64Array( x.length*2 );
833834
dfill( x.length, 2.0, expected, st[ 0 ] );
834835

835-
t.strictEqual( isSameFloat64Array( y.data, expected ), true, 'returns expected value' );
836+
t.strictEqual( isSameFloat64Array( getData( y ), expected ), true, 'returns expected value' );
836837
t.end();
837838
});
838839

@@ -867,7 +868,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
867868
14.0,
868869
16.0
869870
]);
870-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
871+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
871872
t.end();
872873
});
873874

@@ -902,7 +903,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
902903
14.0,
903904
16.0
904905
]);
905-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
906+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
906907
t.end();
907908
});
908909

@@ -945,7 +946,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
945946
0.0,
946947
0.0
947948
]);
948-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
949+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
949950
t.end();
950951
});
951952

@@ -988,7 +989,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
988989
0.0,
989990
0.0
990991
]);
991-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
992+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
992993
t.end();
993994
});
994995

@@ -1019,7 +1020,7 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
10191020
expected = new Complex128Array( x.length*2 );
10201021
zfill( x.length, new Complex128( 2.0, 2.0 ), expected, st[ 0 ] );
10211022

1022-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
1023+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
10231024
t.end();
10241025
});
10251026

@@ -1050,6 +1051,6 @@ tape( 'the function applies a binary callback to indexed elements of two 2-dimen
10501051
expected = new Complex128Array( x.length*2 );
10511052
zfill( x.length, new Complex128( 2.0, 2.0 ), expected, st[ 0 ] );
10521053

1053-
t.strictEqual( isSameComplex128Array( y.data, expected ), true, 'returns expected value' );
1054+
t.strictEqual( isSameComplex128Array( getData( y ), expected ), true, 'returns expected value' );
10541055
t.end();
10551056
});

0 commit comments

Comments
 (0)