Skip to content

Commit c674c46

Browse files
committed
fix: add spacing in parens
1 parent 390247e commit c674c46

File tree

6 files changed

+163
-163
lines changed

6 files changed

+163
-163
lines changed

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var bternary3d = require( './../lib' );
4242
* @param {PositiveIntegerArray} shape - output array shape
4343
* @returns {Function} benchmark function
4444
*/
45-
function createBenchmark(shape) {
45+
function createBenchmark( shape ) {
4646
var arrays;
4747
var shapes;
4848
var x;
@@ -51,17 +51,17 @@ function createBenchmark(shape) {
5151
var w;
5252

5353
shapes = [
54-
[1, 1, shape[2]],
55-
[shape[0], 1, 1],
56-
[1, shape[1], 1],
54+
[ 1, 1, shape[ 2 ] ],
55+
[ shape[ 0 ], 1, 1 ],
56+
[ 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));
62-
w = zeros3d(shapes[3]);
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 ));
62+
w = zeros3d( shapes[ 3 ] );
6363

64-
arrays = [x, y, z, w];
64+
arrays = [ x, y, z, w ];
6565

6666
return benchmark;
6767

@@ -71,31 +71,31 @@ function createBenchmark(shape) {
7171
* @private
7272
* @param {Benchmark} b - benchmark instance
7373
*/
74-
function benchmark(b) {
74+
function benchmark( b ) {
7575
var i0;
7676
var i1;
7777
var i2;
7878
var i;
7979

8080
b.tic();
81-
for (i = 0; i < b.iterations; i++) {
82-
bternary3d(arrays, shapes, add);
83-
i2 = i % shapes[1][0];
84-
i1 = i % shapes[1][1];
85-
i0 = i % shapes[1][2];
86-
if (isnan(arrays[3][i2][i1][i0])) {
87-
b.fail('should not return NaN');
81+
for ( i = 0; i < b.iterations; i++ ) {
82+
bternary3d( arrays, shapes, add );
83+
i2 = i % shapes[ 1 ][ 0 ];
84+
i1 = i % shapes[ 1 ][ 1 ];
85+
i0 = i % shapes[ 1 ][ 2 ];
86+
if ( isnan( arrays[ 3 ][ i2 ][ i1 ][ i0 ] ) ) {
87+
b.fail( 'should not return NaN' );
8888
}
8989
}
9090
b.toc();
9191

92-
i2 = i % shapes[1][0];
93-
i1 = i % shapes[1][1];
94-
i0 = i % shapes[1][2];
95-
if (isnan(arrays[3][i2][i1][i0])) {
96-
b.fail('should not return NaN');
92+
i2 = i % shapes[ 1 ][ 0 ];
93+
i1 = i % shapes[ 1 ][ 1 ];
94+
i0 = i % shapes[ 1 ][ 2 ];
95+
if ( isnan(arrays[ 3 ][ i2 ][ i1 ][ i0 ] ) ) {
96+
b.fail( 'should not return NaN' );
9797
}
98-
b.pass('benchmark finished');
98+
b.pass( 'benchmark finished' );
9999
b.end();
100100
}
101101
}
@@ -119,11 +119,11 @@ function main() {
119119
min = 1; // 10^min
120120
max = 6; // 10^max
121121

122-
for (i = min; i <= max; i++) {
123-
N = floor(pow(pow(10, i), 1.0 / 3.0));
124-
sh = [N, N, N];
125-
f = createBenchmark(sh);
126-
bench(pkg + '::equidimensional:size=' + numel(sh), f);
122+
for ( i = min; i <= max; i++ ) {
123+
N = floor( pow( pow( 10, i ), 1.0 / 3.0 ) );
124+
sh = [ N, N, N ];
125+
f = createBenchmark( sh );
126+
bench( pkg + '::equidimensional:size=' + numel( sh ), f );
127127
}
128128
}
129129

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
Examples
1919
--------
2020
> function fcn( x, y, z ) { return x + y + z };
21-
> var x = [ 1.0, 2.0 ];
22-
> var y = [ [ 3.0 ], [ 4.0 ] ];
23-
> z = [ [ [ 2.0, 3.0 ] ], [ [ 4.0, 4.0 ] ] ];
24-
> var out = [[[ 0.0, 0.0 ], [ 0.0, 0.0 ]], [[ 0.0, 0.0 ], [ 0.0, 0.0 ]]];
25-
> var shapes = [ [ 2 ], [ 2, 1 ], [ 2, 1, 2 ], [ 2, 2, 2 ] ];
21+
> var x = [ 1.0 ];
22+
> var y = [ [ 2.0 ], [ 3.0 ] ];
23+
> z = [ [ [ 4.0 ], [ 6.0 ] ] ];
24+
> var out = [ [ [ 0.0 ], [ 0.0 ] ], [ [ 0.0], [ 0.0 ] ] ];
25+
> var shapes = [ [ 1 ], [ 2, 1 ], [ 1, 2, 1 ], [ 2, 2, 1 ] ];
2626
> {{alias}}( [ x, y, z, out ], shapes, fcn );
2727
> out
28-
[[[6, 8], [7, 9]], [[8, 9], [9, 10]]]
28+
[ [ [ 7 ], [ 10 ] ], [ [ 7 ], [ 10 ] ] ]
2929

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function fcn( x: number, y: number, z: number ): number {
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...

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
* var bternary3d = require( '@stdlib/array/base/broadcasted-ternary3d' );
3131
*
3232
* var shapes = [
33-
* [ 1, 2, 1],
34-
* [ 2, 1, 1],
35-
* [ 1, 1, 2],
36-
* [ 2, 2, 2]
33+
* [ 1, 2, 1 ],
34+
* [ 2, 1, 1 ],
35+
* [ 1, 1, 2 ],
36+
* [ 2, 2, 2 ]
3737
* ];
3838
*
3939
* var x = ones3d( shapes[ 0 ] );

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

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ var broadcastArray = require( '@stdlib/array/base/broadcast-array' );
3939
* var add = require( '@stdlib/math/base/ops/add3' );
4040
*
4141
* var shapes = [
42-
* [ 1, 2, 1],
43-
* [ 2, 1, 1],
44-
* [ 1, 1, 2],
45-
* [ 2, 2, 2]
42+
* [ 1, 2, 1 ],
43+
* [ 2, 1, 1 ],
44+
* [ 1, 1, 2 ],
45+
* [ 2, 2, 2 ]
4646
* ];
4747
*
4848
* var x = ones3d( shapes[ 0 ] );
@@ -55,7 +55,7 @@ var broadcastArray = require( '@stdlib/array/base/broadcast-array' );
5555
* console.log( out );
5656
* // => [ [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] , [ [ 3.0, 3.0 ], [ 3.0, 3.0 ] ] ]
5757
*/
58-
function bternary3d(arrays, shapes, fcn) {
58+
function bternary3d( arrays, shapes, fcn ) {
5959
var dx0;
6060
var dx1;
6161
var dx2;
@@ -96,57 +96,57 @@ function bternary3d(arrays, shapes, fcn) {
9696
var z;
9797
var w;
9898

99-
sh = shapes[3];
100-
S0 = sh[2];
101-
S1 = sh[1];
102-
S2 = sh[0];
103-
if (S0 <= 0 || S1 <= 0 || S2 <= 0) {
99+
sh = shapes[ 3 ];
100+
S0 = sh[ 2 ];
101+
S1 = sh[ 1 ];
102+
S2 = sh[ 0 ];
103+
if ( S0 <= 0 || S1 <= 0 || S2 <= 0 ) {
104104
return;
105105
}
106-
o = broadcastArray(arrays[0], shapes[0], sh);
106+
o = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );
107107

108108
x = o.data;
109109
st = o.strides;
110-
dx0 = st[2];
111-
dx1 = st[1];
112-
dx2 = st[0];
110+
dx0 = st[ 2 ];
111+
dx1 = st[ 1 ];
112+
dx2 = st[ 0 ];
113113

114-
o = broadcastArray(arrays[1], shapes[1], sh);
114+
o = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );
115115
y = o.data;
116116
st = o.strides;
117-
dy0 = st[2];
118-
dy1 = st[1];
119-
dy2 = st[0];
117+
dy0 = st[ 2 ];
118+
dy1 = st[ 1 ];
119+
dy2 = st[ 0 ];
120120

121-
o = broadcastArray(arrays[2], shapes[2], sh);
121+
o = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );
122122
z = o.data;
123123
st = o.strides;
124-
dz0 = st[2];
125-
dz1 = st[1];
126-
dz2 = st[0];
124+
dz0 = st[ 2 ];
125+
dz1 = st[ 1 ];
126+
dz2 = st[ 0 ];
127127

128-
w = arrays[3];
128+
w = arrays[ 3 ];
129129
j2 = 0;
130130
k2 = 0;
131131
m2 = 0;
132-
for (i2 = 0; i2 < S2; i2++) {
132+
for ( i2 = 0; i2 < S2; i2++ ) {
133133
j1 = 0;
134134
k1 = 0;
135135
m1 = 0;
136-
x1 = x[j2];
137-
y1 = y[k2];
138-
z1 = z[m2];
139-
w1 = w[i2];
140-
for (i1 = 0; i1 < S1; i1++) {
136+
x1 = x[ j2 ];
137+
y1 = y[ k2 ];
138+
z1 = z[ m2 ];
139+
w1 = w[ i2 ];
140+
for ( i1 = 0; i1 < S1; i1++ ) {
141141
j0 = 0;
142142
k0 = 0;
143143
m0 = 0;
144-
x0 = x1[j1];
145-
y0 = y1[k1];
146-
z0 = z1[m1];
147-
w0 = w1[i1];
148-
for (i0 = 0; i0 < S0; i0++) {
149-
w0[i0] = fcn(x0[j0], y0[k0], z0[m0]);
144+
x0 = x1[ j1 ];
145+
y0 = y1[ k1 ];
146+
z0 = z1[ m1 ];
147+
w0 = w1[ i1 ];
148+
for ( i0 = 0; i0 < S0; i0++ ) {
149+
w0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );
150150
j0 += dx0;
151151
k0 += dy0;
152152
m0 += dz0;

0 commit comments

Comments
 (0)