Skip to content

Commit 9854a28

Browse files
committed
fix: fix space between parens
1 parent 36c333a commit 9854a28

File tree

7 files changed

+243
-218
lines changed

7 files changed

+243
-218
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var shapes = [
5757
];
5858

5959
bternary5d( [ x, y, z, out ], shapes, add );
60-
// out => [[[[[8,10],[9,11]],[[8,10],[9,11]]]]]
60+
// out => [ [ [ [ [ 8, 10 ], [ 9, 11 ] ], [ [ 8, 10 ], [ 9, 11 ] ] ] ] ]
6161
```
6262

6363
The function accepts the following arguments:

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

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var bternary5d = 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-
[shape[0], 1, 1, 1, 1],
55-
[1, 1, 1, 1, shape[1]],
56-
[1, 1, shape[2], 1, 1],
54+
[ shape[ 0 ], 1, 1, 1, 1 ],
55+
[ 1, 1, 1, 1, shape[ 1 ] ],
56+
[ 1, 1, shape[ 2 ], 1, 1 ],
5757
shape
5858
];
59-
x = filled5dBy(shapes[0], uniform(-100.0, 100.0));
60-
y = filled5dBy(shapes[1], uniform(-100.0, 100.0));
61-
z = filled5dBy(shapes[2], uniform(-100.0, 100.0));
62-
w = zeros5d(shapes[3]);
59+
x = filled5dBy( shapes[ 0 ], uniform( -100.0, 100.0 ) );
60+
y = filled5dBy( shapes[ 1 ], uniform( -100.0, 100.0 ) );
61+
z = filled5dBy( shapes[ 2 ], uniform( -100.0, 100.0 ) );
62+
w = zeros5d( shapes[ 3 ] );
6363

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

6666
return benchmark;
6767

@@ -71,7 +71,7 @@ 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;
@@ -80,28 +80,28 @@ function createBenchmark(shape) {
8080
var i;
8181

8282
b.tic();
83-
for (i = 0; i < b.iterations; i++) {
84-
bternary5d(arrays, shapes, add);
85-
i4 = i % shapes[1][0];
86-
i3 = i % shapes[1][1];
87-
i2 = i % shapes[1][2];
88-
i1 = i % shapes[1][3];
89-
i0 = i % shapes[1][4];
90-
if (isnan(arrays[3][i4][i3][i2][i1][i0])) {
91-
b.fail('should not return NaN');
83+
for ( i = 0; i < b.iterations; i++ ) {
84+
bternary5d( arrays, shapes, add );
85+
i4 = i % shapes[ 1 ][ 0 ];
86+
i3 = i % shapes[ 1 ][ 1 ];
87+
i2 = i % shapes[ 1 ][ 2 ];
88+
i1 = i % shapes[ 1 ][ 3 ];
89+
i0 = i % shapes[ 1 ][ 4 ];
90+
if ( isnan( arrays[ 3 ][ i4 ][ i3 ][ i2 ][ i1 ][ i0 ] ) ) {
91+
b.fail( 'should not return NaN' );
9292
}
9393
}
9494
b.toc();
9595

96-
i4 = i % shapes[1][0];
97-
i3 = i % shapes[1][1];
98-
i2 = i % shapes[1][2];
99-
i1 = i % shapes[1][3];
100-
i0 = i % shapes[1][4];
101-
if (isnan(arrays[3][i4][i3][i2][i1][i0])) {
102-
b.fail('should not return NaN');
96+
i4 = i % shapes[ 1 ][ 0 ];
97+
i3 = i % shapes[ 1 ][ 1 ];
98+
i2 = i % shapes[ 1 ][ 2 ];
99+
i1 = i % shapes[1 ][ 3 ];
100+
i0 = i % shapes[ 1 ][ 4 ];
101+
if (isnan(arrays[ 3 ][ i4 ][ i3 ][ i2 ][ i1 ][ i0 ])) {
102+
b.fail( 'should not return NaN' );
103103
}
104-
b.pass('benchmark finished');
104+
b.pass( 'benchmark finished' );
105105
b.end();
106106
}
107107
}
@@ -125,11 +125,11 @@ function main() {
125125
min = 1; // 10^min
126126
max = 6; // 10^max
127127

128-
for (i = min; i <= max; i++) {
129-
N = floor(pow(pow(10, i), 1.0 / 5.0));
130-
sh = [N, N, N, N, N];
131-
f = createBenchmark(sh);
132-
bench(pkg + '::equidimensional:size=' + numel(sh), f);
128+
for ( i = min; i <= max; i++ ) {
129+
N = floor( pow( pow( 10, i ), 1.0 / 5.0 ) );
130+
sh = [ N, N, N, N, N ];
131+
f = createBenchmark( sh );
132+
bench( pkg + '::equidimensional:size=' + numel( sh ), f );
133133
}
134134
}
135135

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
Examples
1919
--------
2020
> function fcn( x, y, z ) { return x + y + z };
21-
> var x = [ [ [ 1.0 ] ] ];
22-
> var y = [ [ [ [ 2.0, 2.0 ] , [ 3.0, 3.0 ] ] ] ];
21+
> var x = [ 1.0 ];
22+
> var y = [ [ 2.0, 2.0 ] , [ 3.0, 3.0 ] ];
2323
> var z = [ [ [ [ [ 2.0 ] , [ 3.0 ] ] ] ] ];
2424
> var out = [ [ [ [ [ 0.0 ,0.0 ], [ 0.0 ,0.0 ] ] ] ] ];
25-
> var shapes =[[1, 1, 1], [1, 1, 2, 2], [1, 1, 1, 2, 1], [1, 1, 1, 2, 2]];
25+
> var shapes =[ [ 1 ], [ 2, 2 ], [ 1, 1, 1, 2, 1 ], [ 1, 1, 1, 2, 2 ] ];
2626
> {{alias}}( [ x, y, z, out ], shapes, fcn );
2727
> out
2828
[ [ [ [ [ 5.0 ,5.0 ], [ 7.0 ,7.0 ] ] ] ] ]

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ type InOutShapes = [
8888
* var ones5d = require( '@stdlib/array/base/ones5d' );
8989
* var zeros5d = require( '@stdlib/array/base/zeros5d' );
9090
* var add = require( '@stdlib/math/base/ops/add3' );
91-
*
91+
* var bternary5d = require( '@stdlib/array/base/broadcasted-ternary5d' );
9292
* var shapes = [
93-
* [ 1, 2, 1, 1, 1],
94-
* [ 2, 1, 1, 1, 1],
95-
* [ 1, 1, 1, 1, 1],
96-
* [ 2, 2, 1, 1, 1]
93+
* [ 1, 2, 1, 1, 1 ],
94+
* [ 2, 1, 1, 1, 1 ],
95+
* [ 1, 1, 1, 1, 1 ],
96+
* [ 2, 2, 1, 1, 1 ]
9797
* ];
9898
*
9999
* var x = ones5d( shapes[ 0 ] );
@@ -104,7 +104,7 @@ type InOutShapes = [
104104
* bternary5d( [ x, y, z, out ], shapes, add );
105105
*
106106
* console.log( out );
107-
* // =>[[[[[3]]],[[3]]],[[[[3]]],[[3]]]],[[[[3]]],[[3]]],[[[[3]]],[[3]]]]
107+
* // =>[ [ [ [ [ 3 ] ] ], [ [ [ 3 ] ] ] ], [ [ [ 3 ] ], [ [ [ 3] ] ] ] ]
108108
*/
109109
declare function bternary5d<T = unknown, U = unknown, V = unknown, W = unknown>( arrays: InOutArrays<T, U, V, W>, shapes: InOutShapes, fcn: Ternary<T, U, V, W> ): void;
110110

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,21 @@
2929
* var add = require( '@stdlib/math/base/ops/add3' );
3030
* var bternary5d = require( '@stdlib/array/base/broadcasted-ternary5d' );
3131
* var shapes = [
32-
* [ 1, 2, 1, 1, 1],
33-
* [ 2, 1, 1, 1, 1],
34-
* [ 1, 1, 1, 1, 1],
35-
* [ 2, 2, 1, 1, 1]
32+
* [ 1, 2, 1, 1, 1 ],
33+
* [ 2, 1, 1, 1, 1 ],
34+
* [ 1, 1, 1, 1, 1 ],
35+
* [ 2, 2, 1, 1, 1 ]
3636
* ];
3737
*
3838
* var x = ones5d( shapes[ 0 ] );
3939
* var y = ones5d( shapes[ 1 ] );
4040
* var z = ones5d( shapes[ 2 ] );
4141
* var out = zeros5d( shapes[ 3 ] );
4242
*
43-
* bternary4d( [ x, y, z, out ], shapes, add );
43+
* bternary5d( [ x, y, z, out ], shapes, add );
4444
*
4545
* console.log( out );
46-
* // =>[[[[[3]]],[[3]]],[[[[3]]],[[3]]]],[[[[3]]],[[3]]],[[[[3]]],[[3]]]]
47-
46+
* // =>[ [ [ [ [ 3 ] ] ], [ [ [ 3 ] ] ] ], [ [ [ [ 3 ] ] ], [ [ [ 3 ] ] ] ] ]
4847
*/
4948

5049
// MODULES //

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

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ var broadcastArray = require( '@stdlib/array/base/broadcast-array' );
3838
* var ones5d = require( '@stdlib/array/base/ones5d' );
3939
* var zeros5d = require( '@stdlib/array/base/zeros5d' );
4040
* var add = require( '@stdlib/math/base/ops/add3' );
41-
*
41+
4242
* var shapes = [
43-
* [ 1, 2, 1, 1, 1],
44-
* [ 2, 1, 1, 1, 1],
45-
* [ 1, 1, 1, 1, 1],
46-
* [ 2, 2, 1, 1, 1]
43+
* [ 1, 2, 1, 1, 1 ],
44+
* [ 2, 1, 1, 1, 1 ],
45+
* [ 1, 1, 1, 1, 1 ],
46+
* [ 2, 2, 1, 1, 1 ]
4747
* ];
4848
*
4949
* var x = ones5d( shapes[ 0 ] );
@@ -54,9 +54,9 @@ var broadcastArray = require( '@stdlib/array/base/broadcast-array' );
5454
* bternary5d( [ x, y, z, out ], shapes, add );
5555
*
5656
* console.log( out );
57-
* // =>[[[[[3]]],[[[3]]]],[[[[3]]],[[[3]]]]]
57+
* // =>[ [ [ [ [ 3 ] ] ], [ [ [ 3 ] ] ] ], [ [ [ [ 3 ] ] ], [ [ [ 3 ] ] ] ] ]
5858
*/
59-
function bternary5d(arrays, shapes, fcn) {
59+
function bternary5d( arrays, shapes, fcn ) {
6060
var dx0;
6161
var dx1;
6262
var dx2;
@@ -121,82 +121,82 @@ function bternary5d(arrays, shapes, fcn) {
121121
var z;
122122
var w;
123123

124-
sh = shapes[3];
125-
S0 = sh[4];
126-
S1 = sh[3];
127-
S2 = sh[2];
128-
S3 = sh[1];
129-
S4 = sh[0];
130-
if (S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0) {
124+
sh = shapes[ 3 ];
125+
S0 = sh[ 4 ];
126+
S1 = sh[ 3 ];
127+
S2 = sh[ 2 ];
128+
S3 = sh[ 1 ];
129+
S4 = sh[ 0 ];
130+
if ( S0 <= 0 || S1 <= 0 || S2 <= 0 || S3 <= 0 || S4 <= 0 ) {
131131
return;
132132
}
133-
o = broadcastArray(arrays[0], shapes[0], sh);
133+
o = broadcastArray( arrays[ 0 ], shapes[ 0 ], sh );
134134

135135
x = o.data;
136136
st = o.strides;
137-
dx0 = st[4];
138-
dx1 = st[3];
139-
dx2 = st[2];
140-
dx3 = st[1];
141-
dx4 = st[0];
137+
dx0 = st[ 4 ];
138+
dx1 = st[ 3 ];
139+
dx2 = st[ 2 ];
140+
dx3 = st[ 1 ];
141+
dx4 = st[ 0 ];
142142

143-
o = broadcastArray(arrays[1], shapes[1], sh);
143+
o = broadcastArray( arrays[ 1 ], shapes[ 1 ], sh );
144144
y = o.data;
145145
st = o.strides;
146-
dy0 = st[4];
147-
dy1 = st[3];
148-
dy2 = st[2];
149-
dy3 = st[1];
150-
dy4 = st[0];
146+
dy0 = st[ 4 ];
147+
dy1 = st[ 3 ];
148+
dy2 = st[ 2 ];
149+
dy3 = st[ 1 ];
150+
dy4 = st[ 0 ];
151151

152-
o = broadcastArray(arrays[2], shapes[2], sh);
152+
o = broadcastArray( arrays[ 2 ], shapes[ 2 ], sh );
153153
z = o.data;
154154
st = o.strides;
155-
dz0 = st[4];
156-
dz1 = st[3];
157-
dz2 = st[2];
158-
dz3 = st[1];
159-
dz4 = st[0];
155+
dz0 = st[ 4 ];
156+
dz1 = st[ 3 ];
157+
dz2 = st[ 2 ];
158+
dz3 = st[ 1 ];
159+
dz4 = st[ 0 ];
160160

161-
w = arrays[3];
161+
w = arrays[ 3 ];
162162
j4 = 0;
163163
k4 = 0;
164164
m4 = 0;
165165

166-
for (i4 = 0; i4 < S4; i4++) {
166+
for ( i4 = 0; i4 < S4; i4++ ) {
167167
j3 = 0;
168168
k3 = 0;
169169
m3 = 0;
170-
x3 = x[j4];
171-
y3 = y[k4];
172-
z3 = z[m4];
173-
w3 = w[i4];
174-
for (i3 = 0; i3 < S3; i3++) {
170+
x3 = x[ j4 ];
171+
y3 = y[ k4 ];
172+
z3 = z[ m4 ];
173+
w3 = w[ i4 ];
174+
for ( i3 = 0; i3 < S3; i3++ ) {
175175
j2 = 0;
176176
k2 = 0;
177177
m2 = 0;
178-
x2 = x3[j3];
179-
y2 = y3[k3];
180-
z2 = z3[m3];
181-
w2 = w3[i3];
182-
for (i2 = 0; i2 < S2; i2++) {
178+
x2 = x3[ j3 ];
179+
y2 = y3[ k3 ];
180+
z2 = z3[ m3 ];
181+
w2 = w3[ i3 ];
182+
for ( i2 = 0; i2 < S2; i2++ ) {
183183
j1 = 0;
184184
k1 = 0;
185185
m1 = 0;
186-
x1 = x2[j2];
187-
y1 = y2[k2];
188-
z1 = z2[m2];
189-
w1 = w2[i2];
190-
for (i1 = 0; i1 < S1; i1++) {
186+
x1 = x2[ j2 ];
187+
y1 = y2[ k2 ];
188+
z1 = z2[ m2 ];
189+
w1 = w2[ i2 ];
190+
for ( i1 = 0; i1 < S1; i1++ ) {
191191
j0 = 0;
192192
k0 = 0;
193193
m0 = 0;
194-
x0 = x1[j1];
195-
y0 = y1[k1];
196-
z0 = z1[m1];
197-
w0 = w1[i1];
198-
for (i0 = 0; i0 < S0; i0++) {
199-
w0[i0] = fcn(x0[j0], y0[k0], z0[m0]);
194+
x0 = x1[ j1 ];
195+
y0 = y1[ k1 ];
196+
z0 = z1[ m1 ];
197+
w0 = w1[ i1 ];
198+
for ( i0 = 0; i0 < S0; i0++ ) {
199+
w0[ i0 ] = fcn( x0[ j0 ], y0[ k0 ], z0[ m0 ] );
200200
j0 += dx0;
201201
k0 += dy0;
202202
m0 += dz0;

0 commit comments

Comments
 (0)