Skip to content

Commit ca20324

Browse files
fix: added tab indentation in files
1 parent 2449088 commit ca20324

File tree

3 files changed

+69
-71
lines changed

3 files changed

+69
-71
lines changed

lib/node_modules/@stdlib/stats/base/dists/logistic/skewness/benchmark/c/benchmark.c

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@
3232
* Prints the TAP version.
3333
*/
3434
static void print_version( void ) {
35-
printf( "TAP version 13\n" );
35+
printf( "TAP version 13\n" );
3636
}
3737

3838
/**
3939
* Prints the TAP summary.
4040
*
41-
* @param total total number of tests
41+
* @param total total number of tests
4242
* @param passing total number of passing tests
4343
*/
4444
static void print_summary( int total, int passing ) {
45-
printf( "#\n" );
46-
printf( "1..%d\n", total ); // TAP plan
47-
printf( "# total %d\n", total );
48-
printf( "# pass %d\n", passing );
49-
printf( "#\n" );
50-
printf( "# ok\n" );
45+
printf( "#\n" );
46+
printf( "1..%d\n", total ); // TAP plan
47+
printf( "# total %d\n", total );
48+
printf( "# pass %d\n", passing );
49+
printf( "#\n" );
50+
printf( "# ok\n" );
5151
}
5252

5353
/**
@@ -56,12 +56,12 @@ static void print_summary( int total, int passing ) {
5656
* @param elapsed elapsed time in seconds
5757
*/
5858
static void print_results( double elapsed ) {
59-
double rate = (double)ITERATIONS / elapsed;
60-
printf( " ---\n" );
61-
printf( " iterations: %d\n", ITERATIONS );
62-
printf( " elapsed: %0.9f\n", elapsed );
63-
printf( " rate: %0.9f\n", rate );
64-
printf( " ...\n" );
59+
double rate = (double)ITERATIONS / elapsed;
60+
printf( " ---\n" );
61+
printf( " iterations: %d\n", ITERATIONS );
62+
printf( " elapsed: %0.9f\n", elapsed );
63+
printf( " rate: %0.9f\n", rate );
64+
printf( " ...\n" );
6565
}
6666

6767
/**
@@ -70,21 +70,21 @@ static void print_results( double elapsed ) {
7070
* @return clock time
7171
*/
7272
static double tic( void ) {
73-
struct timeval now;
74-
gettimeofday( &now, NULL );
75-
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
73+
struct timeval now;
74+
gettimeofday( &now, NULL );
75+
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
7676
}
7777

7878
/**
7979
* Generates a random number on the interval [min,max).
8080
*
81-
* @param min minimum value (inclusive)
82-
* @param max maximum value (exclusive)
83-
* @return random number
81+
* @param min minimum value (inclusive)
82+
* @param max maximum value (exclusive)
83+
* @return random number
8484
*/
8585
static double random_uniform( const double min, const double max ) {
86-
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
87-
return min + ( v*(max-min) );
86+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
87+
return min + ( v*(max-min) );
8888
}
8989

9090
/**
@@ -93,49 +93,49 @@ static double random_uniform( const double min, const double max ) {
9393
* @return elapsed time in seconds
9494
*/
9595
static double benchmark( void ) {
96-
double elapsed;
97-
double mu[ 100 ];
98-
double s[ 100 ];
99-
double y;
100-
double t;
101-
int i;
96+
double elapsed;
97+
double mu[ 100 ];
98+
double s[ 100 ];
99+
double y;
100+
double t;
101+
int i;
102102

103-
for ( i = 0; i < 100; i++ ) {
104-
mu[ i ] = random_uniform( 0.0, 100.0 ) - 50.0;
105-
s[ i ] = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
106-
}
103+
for ( i = 0; i < 100; i++ ) {
104+
mu[ i ] = random_uniform( 0.0, 100.0 ) - 50.0;
105+
s[ i ] = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
106+
}
107107

108-
t = tic();
109-
for ( i = 0; i < ITERATIONS; i++ ) {
110-
y = stdlib_base_dists_logistic_skewness( mu[ i % 100 ], s[ i % 100 ] );
111-
if ( y != y ) {
112-
printf( "should not return NaN\n" );
113-
break;
114-
}
115-
}
116-
elapsed = tic() - t;
117-
if ( y != y ) {
118-
printf( "should not return NaN\n" );
119-
}
120-
return elapsed;
108+
t = tic();
109+
for ( i = 0; i < ITERATIONS; i++ ) {
110+
y = stdlib_base_dists_logistic_skewness( mu[ i % 100 ], s[ i % 100 ] );
111+
if ( y != y ) {
112+
printf( "should not return NaN\n" );
113+
break;
114+
}
115+
}
116+
elapsed = tic() - t;
117+
if ( y != y ) {
118+
printf( "should not return NaN\n" );
119+
}
120+
return elapsed;
121121
}
122122

123123
/**
124124
* Main execution sequence.
125125
*/
126126
int main( void ) {
127-
double elapsed;
128-
int i;
127+
double elapsed;
128+
int i;
129129

130-
// Use the current time to seed the random number generator:
131-
srand( time( NULL ) );
130+
// Use the current time to seed the random number generator:
131+
srand( time( NULL ) );
132132

133-
print_version();
134-
for ( i = 0; i < REPEATS; i++ ) {
135-
printf( "# c::%s\n", NAME );
136-
elapsed = benchmark();
137-
print_results( elapsed );
138-
printf( "ok %d benchmark finished\n", i+1 );
139-
}
140-
print_summary( REPEATS, REPEATS );
133+
print_version();
134+
for ( i = 0; i < REPEATS; i++ ) {
135+
printf( "# c::%s\n", NAME );
136+
elapsed = benchmark();
137+
print_results( elapsed );
138+
printf( "ok %d benchmark finished\n", i+1 );
139+
}
140+
print_summary( REPEATS, REPEATS );
141141
}

lib/node_modules/@stdlib/stats/base/dists/logistic/skewness/examples/c/example.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
#include <stdio.h>
2222

2323
static double random_uniform( const double min, const double max ) {
24-
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
25-
return min + ( v * ( max-min ) );
24+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
25+
return min + ( v * ( max-min ) );
2626
}
2727

2828
int main( void ) {
29-
double mu;
30-
double s;
31-
double y;
32-
int i;
29+
double mu;
30+
double s;
31+
double y;
32+
int i;
3333

34-
for ( i = 0; i < 25; i++ ) {
35-
mu = random_uniform( 0.0, 10.0 ) - 5.0;
36-
s = random_uniform( 0.0, 20.0 );
37-
y = stdlib_base_dists_logistic_skewness( mu, s );
38-
printf( "µ:: %lf, s: %lf, Skewness(X;µ,s): %lf\n", mu, s, y );
39-
}
34+
for ( i = 0; i < 25; i++ ) {
35+
mu = random_uniform( 0.0, 10.0 ) - 5.0;
36+
s = random_uniform( 0.0, 20.0 );
37+
y = stdlib_base_dists_logistic_skewness( mu, s );
38+
printf( "µ:: %lf, s: %lf, Skewness(X;µ,s): %lf\n", mu, s, y );
39+
}
4040
}

lib/node_modules/@stdlib/stats/base/dists/logistic/skewness/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
/**
2323
* Returns the skewness for a logistic distribution with location `mu` and scale `s`.
2424
*
25-
* The skewness for a logistic distribution is always `0`, regardless of `mu` and `s`.
26-
*
2725
* @param mu location parameter
2826
* @param s scale parameter
2927
* @return skewness

0 commit comments

Comments
 (0)