Skip to content

Commit f4bae86

Browse files
committed
chore: clean-up
1 parent 4dd8815 commit f4bae86

File tree

7 files changed

+85
-116
lines changed

7 files changed

+85
-116
lines changed

lib/node_modules/@stdlib/array/base/broadcasted-quinary4d/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# bquinary4d
2222

23-
> Apply a quinary callback to elements in four [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assign results to elements in a four-dimensional nested output array.
23+
> Apply a quinary callback to elements in five [broadcasted][@stdlib/array/base/broadcast-array] input arrays and assign results to elements in a four-dimensional nested output array.
2424
2525
<section class="intro">
2626

@@ -38,7 +38,7 @@ var bquinary4d = require( '@stdlib/array/base/broadcasted-quinary4d' );
3838

3939
#### bquinary4d( arrays, shapes, fcn )
4040

41-
Applies a quinary callback to elements in four [broadcasted][@stdlib/array/base/broadcast-array] nested input arrays and assigns results to elements in a four-dimensional nested output array.
41+
Applies a quinary callback to elements in five [broadcasted][@stdlib/array/base/broadcast-array] input arrays and assigns results to elements in a four-dimensional nested output array.
4242

4343
```javascript
4444
var zeros4d = require( '@stdlib/array/base/zeros4d' );
@@ -64,7 +64,7 @@ var shapes = [
6464
];
6565

6666
bquinary4d( [ x, y, z, w, v, out ], shapes, add );
67-
// out => [ [ [ [ 12.0, 13.0 ], [ 13.0, 14.0 ] ] ] ]
67+
// out => [ [ [ [ 12.0, 13.0 ], [ 13.0, 14.0 ] ], [ [ 12.0, 13.0 ], [ 13.0, 14.0 ] ] ], [ [ [ 12.0, 13.0 ], [ 13.0, 14.0 ] ], [ [ 12.0, 13.0 ], [ 13.0, 14.0 ] ] ] ]
6868
```
6969

7070
The function accepts the following arguments:

lib/node_modules/@stdlib/array/base/broadcasted-quinary4d/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function createBenchmark( shape ) {
105105
i2 = i % shapes[ 1 ][ 1 ];
106106
i1 = i % shapes[ 1 ][ 2 ];
107107
i0 = i % shapes[ 1 ][ 3 ];
108-
if ( isnan( arrays[ 5 ][ i0 ][ i1 ][ i2 ][ i3 ] ) ) {
108+
if ( isnan( arrays[ 5 ][ i3 ][ i2 ][ i1 ][ i0 ] ) ) {
109109
b.fail( 'should not return NaN' );
110110
}
111111
}
@@ -115,7 +115,7 @@ function createBenchmark( shape ) {
115115
i2 = i % shapes[ 1 ][ 1 ];
116116
i1 = i % shapes[ 1 ][ 2 ];
117117
i0 = i % shapes[ 1 ][ 3 ];
118-
if ( isnan( arrays[ 5 ][ i0 ][ i1 ][ i2 ][ i3 ] ) ) {
118+
if ( isnan( arrays[ 5 ][ i3 ][ i2 ][ i1 ][ i0 ] ) ) {
119119
b.fail( 'should not return NaN' );
120120
}
121121
b.pass( 'benchmark finished' );
@@ -146,7 +146,7 @@ function main() {
146146
N = floor( pow( pow( 10, i ), 1.0/4.0 ) );
147147
sh = [ N, N, N, N ];
148148
f = createBenchmark( sh );
149-
bench( pkg+'::square_matrix:size='+numel( sh ), f );
149+
bench( pkg+'::equidimensional:size='+numel( sh ), f );
150150
}
151151
}
152152

lib/node_modules/@stdlib/array/base/broadcasted-quinary4d/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{{alias}}( arrays, shapes, fcn )
3-
Applies a quinary callback to elements in four broadcasted input arrays
4-
and assigns results to elements in a four-dimensional nested output array.
3+
Applies a quinary callback to elements in five broadcasted input arrays and
4+
assigns results to elements in a four-dimensional nested output array.
55

66
Parameters
77
----------

lib/node_modules/@stdlib/array/base/broadcasted-quinary4d/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type InOutShapes = [
8080
];
8181

8282
/**
83-
* Applies a quinary callback to elements in four broadcasted input arrays and assigns results to elements in a four-dimensional nested output array.
83+
* Applies a quinary callback to elements in five broadcasted input arrays and assigns results to elements in a four-dimensional nested output array.
8484
*
8585
* ## Notes
8686
*
@@ -117,7 +117,7 @@ type InOutShapes = [
117117
* bquinary4d( [ x, y, z, w, v, out ], shapes, add );
118118
*
119119
* console.log( out );
120-
* // => [ [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ] ]
120+
* // => [ [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ], [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ], [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ], [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ] ]
121121
*/
122122
declare function bquinary4d<T = unknown, U = unknown, V = unknown, W = unknown, X = unknown, Y = unknown>( arrays: InOutArrays<T, U, V, W, X, Y>, shapes: InOutShapes, fcn: Quinary<T, U, V, W, X, Y> ): void;
123123

lib/node_modules/@stdlib/array/base/broadcasted-quinary4d/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Apply a quinary callback to elements in four broadcasted input arrays and assign results to elements in a four-dimensional nested output array.
22+
* Apply a quinary callback to elements in five broadcasted input arrays and assign results to elements in a four-dimensional nested output array.
2323
*
2424
* @module @stdlib/array/base/broadcasted-quinary4d
2525
*
@@ -51,7 +51,7 @@
5151
* bquinary4d( [ x, y, z, w, v, out ], shapes, add );
5252
*
5353
* console.log( out );
54-
* // => [ [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ] ]
54+
* // => [ [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ], [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ], [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ], [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ] ]
5555
*/
5656

5757
// MODULES //

lib/node_modules/@stdlib/array/base/broadcasted-quinary4d/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ var broadcastArray = require( '@stdlib/array/base/broadcast-array' );
2626
// MAIN //
2727

2828
/**
29-
* Applies a quinary callback to elements in four broadcasted input arrays and assigns results to elements in a fou4-dimensional nested output array.
29+
* Applies a quinary callback to elements in five broadcasted input arrays and assigns results to elements in a four-dimensional nested output array.
3030
*
31-
* @param {ArrayLikeObject<Array<Collection>>} arrays - array-like object containing five input nested arrays and one output nested array
31+
* @param {ArrayLikeObject<Array>} arrays - array-like object containing five input nested arrays and one output nested array
3232
* @param {ArrayLikeObject<NonNegativeIntegerArray>} shapes - array shapes
3333
* @param {Callback} fcn - quinary callback
3434
* @returns {void}
@@ -60,7 +60,7 @@ var broadcastArray = require( '@stdlib/array/base/broadcast-array' );
6060
* bquinary4d( [ x, y, z, w, v, out ], shapes, add );
6161
*
6262
* console.log( out );
63-
* // => [ [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ] ]
63+
* // => [ [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ], [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ], [ [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ], [ [ 5.0, 5.0 ], [ 5.0, 5.0 ] ] ] ]
6464
*/
6565
function bquinary4d( arrays, shapes, fcn ) { // eslint-disable-line max-statements
6666
var dx0;

lib/node_modules/@stdlib/array/base/broadcasted-quinary4d/test/test.js

Lines changed: 70 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ tape( 'the function applies a provided callback to broadcasted input arrays and
147147
bquinary4d( [ x, y, z, w, u, out ], shapes, add );
148148
t.deepEqual( out, expected, 'returns expected value' );
149149

150+
// Same shapes:
150151
shapes = [
151152
[ 2, 2, 2, 2 ],
152153
[ 2, 2, 2, 2 ],
@@ -292,14 +293,26 @@ tape( 'the function applies a provided callback to broadcasted input arrays and
292293
bquinary4d( [ x, y, z, w, u, out ], shapes, add );
293294
t.deepEqual( out, expected, 'returns expected value' );
294295

295-
// Same shapes:
296+
t.end();
297+
});
298+
299+
tape( 'the function does not invoke a provided callback if provided an output shape having a first element equal to zero', function test( t ) {
300+
var expected;
301+
var shapes;
302+
var out;
303+
var x;
304+
var y;
305+
var z;
306+
var w;
307+
var u;
308+
296309
shapes = [
297310
[ 2, 2, 2, 2 ],
298311
[ 2, 2, 2, 2 ],
299312
[ 2, 2, 2, 2 ],
300313
[ 2, 2, 2, 2 ],
301314
[ 2, 2, 2, 2 ],
302-
[ 2, 2, 2, 2 ]
315+
[ 0, 2, 2, 2 ]
303316
];
304317
x = [
305318
[
@@ -323,73 +336,42 @@ tape( 'the function applies a provided callback to broadcasted input arrays and
323336
]
324337
]
325338
];
326-
y = [
327-
[
328-
[
329-
[ 1.0, 2.0 ],
330-
[ 3.0, 4.0 ]
331-
],
332-
[
333-
[ 1.0, 2.0 ],
334-
[ 3.0, 4.0 ]
335-
]
336-
],
337-
[
338-
[
339-
[ 1.0, 2.0 ],
340-
[ 3.0, 4.0 ]
341-
],
342-
[
343-
[ 1.0, 2.0 ],
344-
[ 3.0, 4.0 ]
345-
]
346-
]
347-
];
348-
z = [
349-
[
350-
[
351-
[ 1.0, 2.0 ],
352-
[ 3.0, 4.0 ]
353-
],
354-
[
355-
[ 1.0, 2.0 ],
356-
[ 3.0, 4.0 ]
357-
]
358-
],
359-
[
360-
[
361-
[ 1.0, 2.0 ],
362-
[ 3.0, 4.0 ]
363-
],
364-
[
365-
[ 1.0, 2.0 ],
366-
[ 3.0, 4.0 ]
367-
]
368-
]
369-
];
370-
w = [
371-
[
372-
[
373-
[ 1.0, 2.0 ],
374-
[ 3.0, 4.0 ]
375-
],
376-
[
377-
[ 1.0, 2.0 ],
378-
[ 3.0, 4.0 ]
379-
]
380-
],
381-
[
382-
[
383-
[ 1.0, 2.0 ],
384-
[ 3.0, 4.0 ]
385-
],
386-
[
387-
[ 1.0, 2.0 ],
388-
[ 3.0, 4.0 ]
389-
]
390-
]
339+
y = x;
340+
z = x;
341+
w = x;
342+
u = x;
343+
out = zeros4d( [ 2, 2, 2, 2 ] );
344+
345+
expected = zeros4d( [ 2, 2, 2, 2 ] );
346+
bquinary4d( [ x, y, z, w, u, out ], shapes, clbk );
347+
t.deepEqual( out, expected, 'returns expected value' );
348+
349+
t.end();
350+
351+
function clbk() {
352+
t.ok( false, 'should not invoke callback' );
353+
}
354+
});
355+
356+
tape( 'the function does not invoke a provided callback if provided an output shape having a second element equal to zero', function test( t ) {
357+
var expected;
358+
var shapes;
359+
var out;
360+
var x;
361+
var y;
362+
var z;
363+
var w;
364+
var u;
365+
366+
shapes = [
367+
[ 2, 2, 2, 2 ],
368+
[ 2, 2, 2, 2 ],
369+
[ 2, 2, 2, 2 ],
370+
[ 2, 2, 2, 2 ],
371+
[ 2, 2, 2, 2 ],
372+
[ 2, 0, 2, 2 ]
391373
];
392-
u = [
374+
x = [
393375
[
394376
[
395377
[ 1.0, 2.0 ],
@@ -411,37 +393,24 @@ tape( 'the function applies a provided callback to broadcasted input arrays and
411393
]
412394
]
413395
];
414-
out = zeros4d( shapes[ 5 ] );
396+
y = x;
397+
z = x;
398+
w = x;
399+
u = x;
400+
out = zeros4d( [ 2, 2, 2, 2 ] );
415401

416-
expected = [
417-
[
418-
[
419-
[ 5.0, 10.0 ],
420-
[ 15.0, 20.0 ]
421-
],
422-
[
423-
[ 5.0, 10.0 ],
424-
[ 15.0, 20.0 ]
425-
]
426-
],
427-
[
428-
[
429-
[ 5.0, 10.0 ],
430-
[ 15.0, 20.0 ]
431-
],
432-
[
433-
[ 5.0, 10.0 ],
434-
[ 15.0, 20.0 ]
435-
]
436-
]
437-
];
438-
bquinary4d( [ x, y, z, w, u, out ], shapes, add );
402+
expected = zeros4d( [ 2, 2, 2, 2 ] );
403+
bquinary4d( [ x, y, z, w, u, out ], shapes, clbk );
439404
t.deepEqual( out, expected, 'returns expected value' );
440405

441406
t.end();
407+
408+
function clbk() {
409+
t.ok( false, 'should not invoke callback' );
410+
}
442411
});
443412

444-
tape( 'the function does not invoke a provided callback if provided an output shape having a first element equal to zero', function test( t ) {
413+
tape( 'the function does not invoke a provided callback if provided an output shape having a third element equal to zero', function test( t ) {
445414
var expected;
446415
var shapes;
447416
var out;
@@ -457,7 +426,7 @@ tape( 'the function does not invoke a provided callback if provided an output sh
457426
[ 2, 2, 2, 2 ],
458427
[ 2, 2, 2, 2 ],
459428
[ 2, 2, 2, 2 ],
460-
[ 0, 2, 2, 2 ]
429+
[ 2, 2, 0, 2 ]
461430
];
462431
x = [
463432
[
@@ -498,7 +467,7 @@ tape( 'the function does not invoke a provided callback if provided an output sh
498467
}
499468
});
500469

501-
tape( 'the function does not invoke a provided callback if provided an output shape having a second element equal to zero', function test( t ) {
470+
tape( 'the function does not invoke a provided callback if provided an output shape having a fourth element equal to zero', function test( t ) {
502471
var expected;
503472
var shapes;
504473
var out;
@@ -509,12 +478,12 @@ tape( 'the function does not invoke a provided callback if provided an output sh
509478
var u;
510479

511480
shapes = [
512-
[ 2, 2, 2 ],
513-
[ 2, 2, 2 ],
514-
[ 2, 2, 2 ],
515-
[ 2, 2, 2 ],
516-
[ 2, 2, 2 ],
517-
[ 2, 0, 2 ]
481+
[ 2, 2, 2, 2 ],
482+
[ 2, 2, 2, 2 ],
483+
[ 2, 2, 2, 2 ],
484+
[ 2, 2, 2, 2 ],
485+
[ 2, 2, 2, 2 ],
486+
[ 2, 2, 2, 0 ]
518487
];
519488
x = [
520489
[

0 commit comments

Comments
 (0)