Skip to content

Commit 17530a4

Browse files
committed
style: fix spacing in C benchmark for planck/mode
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 7d04c37 commit 17530a4

File tree

9 files changed

+46
-55
lines changed

9 files changed

+46
-55
lines changed

lib/node_modules/@stdlib/blas/ext/base/sapxsumkbn/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ console.log( v );
166166
## See Also
167167

168168
- <span class="package-name">[`@stdlib/blas/ext/base/dapxsumkbn`][@stdlib/blas/ext/base/dapxsumkbn]</span><span class="delimiter">: </span><span class="description">add a constant to each double-precision floating-point strided array element and compute the sum using an improved Kahan–Babuška algorithm.</span>
169-
- <span class="package-name">[`@stdlib/blas/ext/base/gapxsumkbn`][@stdlib/blas/ext/base/gapxsumkbn]</span><span class="delimiter">: </span><span class="description">add a scalar constant to each strided array element and compute the sum using an improved Kahan–Babuška algorithm.</span>
169+
- <span class="package-name">[`@stdlib/blas/ext/base/gapxsumkbn`][@stdlib/blas/ext/base/gapxsumkbn]</span><span class="delimiter">: </span><span class="description">add a constant to each strided array element and compute the sum using an improved Kahan–Babuška algorithm.</span>
170170
- <span class="package-name">[`@stdlib/blas/ext/base/sapxsum`][@stdlib/blas/ext/base/sapxsum]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum.</span>
171171
- <span class="package-name">[`@stdlib/blas/ext/base/ssumkbn`][@stdlib/blas/ext/base/ssumkbn]</span><span class="delimiter">: </span><span class="description">calculate the sum of single-precision floating-point strided array elements using an improved Kahan–Babuška algorithm.</span>
172172

lib/node_modules/@stdlib/constants/float32/pi/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,6 @@ Macro for the mathematical constant [π][pi].
108108

109109
<section class="related">
110110

111-
* * *
112-
113-
## See Also
114-
115-
- <span class="package-name">[`@stdlib/constants/float32/fourth-pi`][@stdlib/constants/float32/fourth-pi]</span><span class="delimiter">: </span><span class="description">1/4 times π.</span>
116-
- <span class="package-name">[`@stdlib/constants/float32/half-pi`][@stdlib/constants/float32/half-pi]</span><span class="delimiter">: </span><span class="description">1/2 times π.</span>
117-
- <span class="package-name">[`@stdlib/constants/float32/two-pi`][@stdlib/constants/float32/two-pi]</span><span class="delimiter">: </span><span class="description">2π.</span>
118-
119111
</section>
120112

121113
<!-- /.related -->

lib/node_modules/@stdlib/stats/base/dists/planck/mode/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ for ( i = 0; i < lambda.length; i++ ) {
146146

147147
#### stdlib_base_dists_planck_mode( lambda )
148148

149-
Evaluates the mode for planck distribution.
149+
Returns the [mode][mode] of a Planck distribution with shape parameter `lambda`.
150150

151151
```c
152152
double out = stdlib_base_dists_planck_mode( 0.1 );
@@ -155,7 +155,7 @@ double out = stdlib_base_dists_planck_mode( 0.1 );
155155

156156
The function accepts the following arguments:
157157

158-
- **lambda**: `[in] double` shape parameter
158+
- **lambda**: `[in] double` shape parameter.
159159

160160
```c
161161
double stdlib_base_dists_planck_mode( const double lambda );
@@ -195,7 +195,7 @@ int main( void ) {
195195
for ( i = 0; i < 25; i++ ) {
196196
lambda = random_uniform( 0.1, 10.0 );
197197
y = stdlib_base_dists_planck_mode( lambda );
198-
printf( "lambda: %lf, E(X;λ): %lf\n", lambda, y );
198+
printf( "lambda: %lf, mode(X;λ): %lf\n", lambda, y );
199199
}
200200
}
201201
```

lib/node_modules/@stdlib/stats/base/dists/planck/mode/benchmark/c/benchmark.c

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* distributed under the License is distributed on an "AS IS" BASIS,
1414
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
* See the License for the specific language governing permissions and
16-
* limitations under the License .
16+
* limitations under the License.
1717
*/
1818

1919
#include "stdlib/stats/base/dists/planck/mode.h"
@@ -30,8 +30,8 @@
3030
/**
3131
* Prints the TAP version.
3232
*/
33-
static void print_version(void) {
34-
printf("TAP version 13\n");
33+
static void print_version( void ) {
34+
printf( "TAP version 13\n" );
3535
}
3636

3737
/**
@@ -40,37 +40,37 @@ static void print_version(void) {
4040
* @param total total number of tests
4141
* @param passing total number of passing tests
4242
*/
43-
static void print_summary(int total, int passing) {
44-
printf("#\n");
45-
printf("1..%d\n", total); // TAP plan
46-
printf("# total %d\n", total);
47-
printf("# pass %d\n", passing);
48-
printf("#\n");
49-
printf("# ok\n");
43+
static void print_summary( int total, int passing ) {
44+
printf( "#\n" );
45+
printf( "1..%d\n", total ); // TAP plan
46+
printf( "# total %d\n", total );
47+
printf( "# pass %d\n", passing );
48+
printf( "#\n" );
49+
printf( "# ok\n" );
5050
}
5151

5252
/**
5353
* Prints benchmarks results.
5454
*
5555
* @param elapsed elapsed time in seconds
5656
*/
57-
static void print_results(double elapsed) {
57+
static void print_results( double elapsed ) {
5858
double rate = (double)ITERATIONS / elapsed;
59-
printf(" ---\n");
60-
printf(" iterations: %d\n", ITERATIONS);
61-
printf(" elapsed: %0.9f\n", elapsed);
62-
printf(" rate: %0.9f\n", rate);
63-
printf(" ...\n");
59+
printf( " ---\n" );
60+
printf( " iterations: %d\n", ITERATIONS );
61+
printf( " elapsed: %0.9f\n", elapsed );
62+
printf( " rate: %0.9f\n", rate );
63+
printf( " ...\n" );
6464
}
6565

6666
/**
6767
* Returns a clock time.
6868
*
6969
* @return clock time
7070
*/
71-
static double tic(void) {
71+
static double tic( void ) {
7272
struct timeval now;
73-
gettimeofday(&now, NULL);
73+
gettimeofday( &now, NULL );
7474
return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
7575
}
7676

@@ -81,60 +81,60 @@ static double tic(void) {
8181
* @param max maximum value (exclusive)
8282
* @return random number
8383
*/
84-
static double random_uniform(const double min, const double max) {
85-
double v = (double)rand() / ((double)RAND_MAX + 1.0);
86-
return min + (v * (max - min));
84+
static double random_uniform( const double min, const double max ) {
85+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
86+
return min + ( v * ( max - min ) );
8787
}
8888

8989
/**
9090
* Runs a benchmark.
9191
*
9292
* @return elapsed time in seconds
9393
*/
94-
static double benchmark(void) {
94+
static double benchmark( void ) {
9595
double elapsed;
9696
double lambda[100];
9797
double y;
9898
double t;
9999
int i;
100100

101-
for (i = 0; i < 100; i++) {
102-
lambda[i] = (random_uniform(0.0, 10.0) + 1.0);
101+
for ( i = 0; i < 100; i++ ) {
102+
lambda[i] = ( random_uniform( 0.0, 10.0 ) + 1.0 );
103103
}
104104

105105
t = tic();
106-
for (i = 0; i < ITERATIONS; i++) {
107-
y = stdlib_base_dists_planck_mode(lambda[i % 100]);
108-
if (y != y) {
109-
printf("should not return NaN\n");
106+
for ( i = 0; i < ITERATIONS; i++ ) {
107+
y = stdlib_base_dists_planck_mode( lambda[i % 100] );
108+
if ( y != y ) {
109+
printf( "should not return NaN\n" );
110110
break;
111111
}
112112
}
113113
elapsed = tic() - t;
114-
if (y != y) {
115-
printf("should not return NaN\n");
114+
if ( y != y ) {
115+
printf( "should not return NaN\n" );
116116
}
117117
return elapsed;
118118
}
119119

120120
/**
121121
* Main execution sequence.
122122
*/
123-
int main(void) {
123+
int main( void ) {
124124
double elapsed;
125125
int i;
126126

127127
// Use the current time to seed the random number generator:
128-
srand(time(NULL));
128+
srand( time( NULL ) );
129129

130130
print_version();
131-
for (i = 0; i < REPEATS; i++) {
132-
printf("# c::%s\n", NAME);
131+
for ( i = 0; i < REPEATS; i++ ) {
132+
printf( "# c::%s\n", NAME );
133133
elapsed = benchmark();
134-
print_results(elapsed);
135-
printf("ok %d benchmark finished\n", i + 1);
134+
print_results( elapsed );
135+
printf( "ok %d benchmark finished\n", i + 1 );
136136
}
137-
print_summary(REPEATS, REPEATS);
137+
print_summary( REPEATS, REPEATS );
138138

139139
return 0;
140140
}

lib/node_modules/@stdlib/stats/base/dists/planck/mode/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ int main( void ) {
3232
for ( i = 0; i < 25; i++ ) {
3333
lambda = random_uniform( 1.0, 10.0 );
3434
y = stdlib_base_dists_planck_mode( lambda );
35-
printf( "λ: %lf, F(x;λ): %lf\n", lambda , y );
35+
printf( "λ: %lf, mode(X;λ): %lf\n", lambda , y );
3636
}
3737
}

lib/node_modules/@stdlib/stats/base/dists/planck/mode/lib/native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' );
2626
// MAIN //
2727

2828
/**
29-
* Returns the mode for Planck distribution with shape parameter `lambda`.
29+
* Returns the mode for a Planck distribution with shape parameter `lambda`.
3030
*
3131
* @private
3232
* @param {number} lambda - shape parameter

lib/node_modules/@stdlib/stats/base/dists/planck/mode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"scripts": {},
2929
"homepage": "https://github.com/stdlib-js/stdlib",
3030
"repository": {
31-
"type": "git",
32-
"url": "git://github.com/stdlib-js/stdlib.git"
31+
"type": "git",
32+
"url": "git://github.com/stdlib-js/stdlib.git"
3333
},
3434
"bugs": {
3535
"url": "https://github.com/stdlib-js/stdlib/issues"

lib/node_modules/@stdlib/stats/base/dists/planck/mode/src/addon.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
#include "stdlib/stats/base/dists/planck/mode.h"
2020
#include "stdlib/math/base/napi/unary.h"
2121

22-
// cppcheck-suppress shadowFunction
2322
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_dists_planck_mode )

lib/node_modules/@stdlib/stats/base/dists/planck/mode/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Returns the mode of a Planck distribution with shape parameter `lambda`.
2424
*
2525
* @param lambda shape parameter
26-
* @return mode or NaN if invalid input
26+
* @return mode
2727
*
2828
* @example
2929
* double y = stdlib_base_dists_planck_mode( 0.1 );

0 commit comments

Comments
 (0)