Skip to content

Commit 438efb9

Browse files
committed
chore: clean-up
1 parent c674c46 commit 438efb9

File tree

7 files changed

+55
-37
lines changed

7 files changed

+55
-37
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var bternary3d = require( '@stdlib/array/base/broadcasted-ternary3d' );
3838

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

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

4343
```javascript
4444
var add = require( '@stdlib/math/base/ops/add3' );
@@ -57,7 +57,7 @@ var shapes = [
5757
];
5858

5959
bternary3d( [ x, y, z, out ], shapes, add );
60-
// out => [ [ [ 9, 10 ], [ 10, 11 ] ], [ [ 10, 11 ], [ 11, 12 ] ] ]
60+
// out => [ [ [ 9.0, 10.0 ], [ 10.0, 11.0 ] ], [ [ 10.0, 11.0 ], [ 11.0, 12.0 ] ] ]
6161
```
6262

6363
The function accepts the following arguments:

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var uniform = require( '@stdlib/random/base/uniform' ).factory;
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var pow = require( '@stdlib/math/base/special/pow' );
2727
var floor = require( '@stdlib/math/base/special/floor' );
28-
var add = require( '@stdlib/math/base/ops/add' );
28+
var add = require( '@stdlib/math/base/ops/add3' );
2929
var filled3dBy = require( '@stdlib/array/base/filled3d-by' );
3030
var zeros3d = require( '@stdlib/array/base/zeros3d' );
3131
var numel = require( '@stdlib/ndarray/base/numel' );
@@ -56,9 +56,9 @@ function createBenchmark( shape ) {
5656
[ 1, shape[ 1 ], 1 ],
5757
shape
5858
];
59-
x = filled3dBy( shapes[ 0 ], uniform( -100.0, 100.0 ));
60-
y = filled3dBy(shapes[ 1 ], uniform( -100.0, 100.0 ));
61-
z = filled3dBy(shapes[ 2 ], uniform( -100.0, 100.0 ));
59+
x = filled3dBy( shapes[ 0 ], uniform( -100.0, 100.0 ) );
60+
y = filled3dBy( shapes[ 1 ], uniform( -100.0, 100.0 ) );
61+
z = filled3dBy( shapes[ 2 ], uniform( -100.0, 100.0 ) );
6262
w = zeros3d( shapes[ 3 ] );
6363

6464
arrays = [ x, y, z, w ];
@@ -92,7 +92,7 @@ function createBenchmark( shape ) {
9292
i2 = i % shapes[ 1 ][ 0 ];
9393
i1 = i % shapes[ 1 ][ 1 ];
9494
i0 = i % shapes[ 1 ][ 2 ];
95-
if ( isnan(arrays[ 3 ][ i2 ][ i1 ][ i0 ] ) ) {
95+
if ( isnan( arrays[ 3 ][ i2 ][ i1 ][ i0 ] ) ) {
9696
b.fail( 'should not return NaN' );
9797
}
9898
b.pass( 'benchmark finished' );

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
> function fcn( x, y, z ) { return x + y + z };
2121
> var x = [ 1.0 ];
2222
> var y = [ [ 2.0 ], [ 3.0 ] ];
23-
> z = [ [ [ 4.0 ], [ 6.0 ] ] ];
24-
> var out = [ [ [ 0.0 ], [ 0.0 ] ], [ [ 0.0], [ 0.0 ] ] ];
23+
> var z = [ [ [ 4.0 ], [ 6.0 ] ] ];
24+
> var out = [ [ [ 0.0 ], [ 0.0 ] ], [ [ 0.0 ], [ 0.0 ] ] ];
2525
> var shapes = [ [ 1 ], [ 2, 1 ], [ 1, 2, 1 ], [ 2, 2, 1 ] ];
2626
> {{alias}}( [ x, y, z, out ], shapes, fcn );
2727
> out
28-
[ [ [ 7 ], [ 10 ] ], [ [ 7 ], [ 10 ] ] ]
28+
[ [ [ 7.0 ], [ 10.0 ] ], [ [ 7.0 ], [ 10.0 ] ] ]
2929

3030
See Also
3131
--------

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ type InOutShapes = [
9090
* var add = require( '@stdlib/math/base/ops/add3' );
9191
*
9292
* var shapes = [
93-
* [ 1, 2, 1],
94-
* [ 2, 1, 1],
95-
* [ 1, 1, 2],
96-
* [ 2, 2, 2]
93+
* [ 1, 2, 1 ],
94+
* [ 2, 1, 1 ],
95+
* [ 1, 1, 2 ],
96+
* [ 2, 2, 2 ]
9797
* ];
9898
*
9999
* var x = ones3d( shapes[ 0 ] );
@@ -104,8 +104,7 @@ type InOutShapes = [
104104
* bternary3d( [ x, y, z, out ], shapes, add );
105105
*
106106
* console.log( out );
107-
* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ,
108-
* [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]
107+
* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ], [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]
109108
*/
110109
declare function bternary3d<T = unknown, U = unknown, V = unknown, W = unknown>( arrays: InOutArrays<T, U, V, W>, shapes: InOutShapes, fcn: Ternary<T, U, V, W> ): void;
111110

lib/node_modules/@stdlib/array/base/broadcasted-ternary3d/docs/types/test.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ function fcn( x: number, y: number, z: number ): number {
3535

3636
// The function returns undefined...
3737
{
38-
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ,[ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
39-
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
40-
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
41-
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] , [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
38+
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
39+
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
40+
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
41+
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
4242

4343
const shapes: [ Array<number>, Array<number>, Array<number>, Array<number> ] = [ [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ] ];
4444

4545
bternary3d( [ x, y, z, out ], shapes, fcn ); // $ExpectType void
46-
bternary3d( [ x[ 0 ][ 0 ], y, z, out ], [ shapes[ 0 ][ 2 ] , shapes[ 1 ], shapes[ 2 ] , shapes[ 3 ] ], fcn ); // $ExpectType void
46+
bternary3d( [ x[ 0 ][ 0 ], y, z, out ], [ [ shapes[ 0 ][ 2 ] ], shapes[ 1 ], shapes[ 2 ] , shapes[ 3 ] ], fcn ); // $ExpectType void
4747
}
4848

4949
// The compiler throws an error if the function is provided a first argument which is not an array of nested arrays...
@@ -62,10 +62,10 @@ function fcn( x: number, y: number, z: number ): number {
6262

6363
// The compiler throws an error if the function is provided a second argument which is not an array of arrays...
6464
{
65-
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ,[ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
66-
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
67-
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
68-
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] , [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
65+
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
66+
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
67+
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
68+
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
6969

7070
bternary3d( [ x, y, z, out ], 'abc', fcn ); // $ExpectError
7171
bternary3d( [ x, y, z, out ], 3.14, fcn ); // $ExpectError
@@ -79,10 +79,10 @@ function fcn( x: number, y: number, z: number ): number {
7979

8080
// The compiler throws an error if the function is provided a third argument which is not a valid callback...
8181
{
82-
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ,[ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
83-
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
84-
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
85-
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] , [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
82+
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
83+
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
84+
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
85+
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
8686

8787
const shapes: [ Array<number>, Array<number>, Array<number>, Array<number> ] = [ [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ] ];
8888

@@ -97,10 +97,10 @@ function fcn( x: number, y: number, z: number ): number {
9797

9898
// The compiler throws an error if the function is provided an unsupported number of arguments...
9999
{
100-
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ,[ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
101-
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
102-
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] , [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
103-
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] , [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
100+
const x = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
101+
const y = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
102+
const z = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ];
103+
const out = [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ], [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ];
104104

105105
const shapes: [ Array<number>, Array<number>, Array<number>, Array<number> ] = [ [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ], [ 2, 2, 2 ] ];
106106

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ function bternary3d( arrays, shapes, fcn ) {
104104
return;
105105
}
106106
o = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );
107-
108107
x = o.data;
109108
st = o.strides;
110109
dx0 = st[ 2 ];

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

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,26 @@ tape( 'the function applies a provided callback to broadcasted input arrays and
5252
[ 3.0 ],
5353
[ 4.0 ]
5454
];
55-
z = [ [ [ 2.0, 3.0 ] ], [ [ 4.0, 4.0 ] ] ];
55+
z = [
56+
[
57+
[ 2.0, 3.0 ]
58+
],
59+
[
60+
[ 4.0, 4.0 ]
61+
]
62+
];
5663
w = zeros3d( shapes[ 3 ] );
5764

58-
expected = [ [ [ 6, 8 ], [ 7, 9 ] ], [ [ 8, 9 ], [ 9, 10 ] ] ];
65+
expected = [
66+
[
67+
[ 6.0, 8.0 ],
68+
[ 7.0, 9.0 ]
69+
],
70+
[
71+
[ 8.0, 9.0 ],
72+
[ 9.0, 10.0 ]
73+
]
74+
];
5975
bternary3d( [ x, y, z, w ], shapes, add );
6076
t.deepEqual( w, expected, 'returns expected value' );
6177

@@ -69,7 +85,11 @@ tape( 'the function applies a provided callback to broadcasted input arrays and
6985
[ 1.0, 2.0 ]
7086
];
7187
y = [ 3.0, 4.0 ];
72-
z = [ [ [ 5 ] ] ];
88+
z = [
89+
[
90+
[ 5.0 ]
91+
]
92+
];
7393
w = zeros3d( shapes[ 3 ] );
7494

7595
expected = [

0 commit comments

Comments
 (0)