Skip to content

Commit a74f643

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

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
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
--------

0 commit comments

Comments
 (0)