Skip to content

Commit 66db13d

Browse files
committed
refactor: fixed the formatting issues
--- 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: passed - 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: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: passed - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 524dd90 commit 66db13d

File tree

6 files changed

+199
-185
lines changed

6 files changed

+199
-185
lines changed

lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ int main( void ) {
185185
int i;
186186
187187
for ( i = 0; i < 10; i++ ) {
188-
mu = random_uniform( -20.0, 20.0 );
188+
mu = random_uniform( 0.0, 20.0 );
189189
m = stdlib_base_dists_degenerate_mean( mu );
190190
191-
printf( "mu: %lf, Mean: %lf\n", mu, m );
191+
printf( "µ: %lf, E(X;µ): %lf\n", mu, m );
192192
}
193193
194194
return 0;

lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/benchmark/c/benchmark.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* limitations under the License.
1717
*/
1818

19+
#include <sys/time.h>
1920
#include "stdlib/stats/base/dists/degenerate/mean.h"
20-
#include <stdlib.h>
21-
#include <stdio.h>
2221
#include <math.h>
22+
#include <stdio.h>
23+
#include <stdlib.h>
2324
#include <time.h>
24-
#include <sys/time.h>
2525

2626
#define NAME "degenerate-mean"
2727
#define ITERATIONS 1000000
@@ -71,7 +71,7 @@ static void print_results( double elapsed ) {
7171
static double tic( void ) {
7272
struct timeval now;
7373
gettimeofday( &now, NULL );
74-
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
74+
return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
7575
}
7676

7777
/**
@@ -83,7 +83,7 @@ static double tic( void ) {
8383
*/
8484
static double random_uniform( const double min, const double max ) {
8585
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
86-
return min + ( v*(max-min) );
86+
return min + ( v * ( max - min ) );
8787
}
8888

8989
/**
@@ -104,7 +104,7 @@ static double benchmark( void ) {
104104

105105
t = tic();
106106
for ( i = 0; i < ITERATIONS; i++ ) {
107-
y = stdlib_base_dists_degenerate_mean( mu[ i%100 ] );
107+
y = stdlib_base_dists_degenerate_mean( mu[ i % 100 ] );
108108
if ( y != y ) {
109109
printf( "should not return NaN\n" );
110110
break;
@@ -124,15 +124,15 @@ int main( void ) {
124124
double elapsed;
125125
int i;
126126

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

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

lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/binding.gyp

Lines changed: 144 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -19,131 +19,152 @@
1919
# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
2020
# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
2121
{
22-
# List of files to include in this file:
23-
"includes": [
24-
"./include.gypi",
25-
],
26-
# Define variables to be used throughout the configuration for all targets:
27-
"variables": {
28-
# Target name should match the add-on export name:
29-
"addon_target_name%": "addon",
30-
# Set variables based on the host OS:
31-
"conditions": [
32-
[
33-
'OS=="win"',
34-
{
35-
# Define the object file suffix:
36-
"obj": "obj",
37-
},
38-
{
39-
# Define the object file suffix:
40-
"obj": "o",
41-
},
42-
], # end condition (OS=="win")
43-
], # end conditions
44-
}, # end variables
45-
# Define compile targets:
46-
"targets": [
47-
# Target to generate an add-on:
22+
# List of files to include in this file:
23+
'includes': [
24+
'./include.gypi',
25+
],
26+
27+
# Define variables to be used throughout the configuration for all targets:
28+
'variables': {
29+
# Target name should match the add-on export name:
30+
'addon_target_name%': 'addon',
31+
32+
# Set variables based on the host OS:
33+
'conditions': [
34+
[
35+
'OS=="win"',
4836
{
49-
# The target name should match the add-on export name:
50-
"target_name": "<(addon_target_name)",
51-
# Define dependencies:
52-
"dependencies": [],
53-
# Define directories which contain relevant include headers:
54-
"include_dirs": [
55-
# Local include directory:
56-
"<@(include_dirs)",
57-
],
58-
# List of source files:
59-
"sources": [
60-
"<@(src_files)",
61-
"src/addon.c",
62-
],
63-
# Settings which should be applied when a target's object files are used as linker input:
64-
"link_settings": {
65-
# Define libraries:
66-
"libraries": [
67-
"<@(libraries)",
68-
],
69-
# Define library directories:
70-
"library_dirs": [
71-
"<@(library_dirs)",
72-
],
73-
},
74-
# C/C++ compiler flags:
75-
"cflags": [
76-
# Enable commonly used warning options:
77-
"-Wall",
78-
# Aggressive optimization:
79-
"-O3",
80-
],
81-
# C specific compiler flags:
82-
"cflags_c": [
83-
# Specify the C standard to which a program is expected to conform:
84-
"-std=c99",
37+
# Define the object file suffix:
38+
'obj': 'obj',
39+
},
40+
{
41+
# Define the object file suffix:
42+
'obj': 'o',
43+
}
44+
], # end condition (OS=="win")
45+
], # end conditions
46+
}, # end variables
47+
48+
# Define compile targets:
49+
'targets': [
50+
51+
# Target to generate an add-on:
52+
{
53+
# The target name should match the add-on export name:
54+
'target_name': '<(addon_target_name)',
55+
56+
# Define dependencies:
57+
'dependencies': [],
58+
59+
# Define directories which contain relevant include headers:
60+
'include_dirs': [
61+
# Local include directory:
62+
'<@(include_dirs)',
63+
],
64+
65+
# List of source files:
66+
'sources': [
67+
'<@(src_files)',
68+
],
69+
70+
# Settings which should be applied when a target's object files are used as linker input:
71+
'link_settings': {
72+
# Define libraries:
73+
'libraries': [
74+
'<@(libraries)',
75+
],
76+
77+
# Define library directories:
78+
'library_dirs': [
79+
'<@(library_dirs)',
80+
],
81+
},
82+
83+
# C/C++ compiler flags:
84+
'cflags': [
85+
# Enable commonly used warning options:
86+
'-Wall',
87+
88+
# Aggressive optimization:
89+
'-O3',
90+
],
91+
92+
# C specific compiler flags:
93+
'cflags_c': [
94+
# Specify the C standard to which a program is expected to conform:
95+
'-std=c99',
96+
],
97+
98+
# C++ specific compiler flags:
99+
'cflags_cpp': [
100+
# Specify the C++ standard to which a program is expected to conform:
101+
'-std=c++11',
102+
],
103+
104+
# Linker flags:
105+
'ldflags': [],
106+
107+
# Apply conditions based on the host OS:
108+
'conditions': [
109+
[
110+
'OS=="mac"',
111+
{
112+
# Linker flags:
113+
'ldflags': [
114+
'-undefined dynamic_lookup',
115+
'-Wl,-no-pie',
116+
'-Wl,-search_paths_first',
85117
],
86-
# C++ specific compiler flags:
87-
"cflags_cpp": [
88-
# Specify the C++ standard to which a program is expected to conform:
89-
"-std=c++11",
118+
},
119+
], # end condition (OS=="mac")
120+
[
121+
'OS!="win"',
122+
{
123+
# C/C++ flags:
124+
'cflags': [
125+
# Generate platform-independent code:
126+
'-fPIC',
90127
],
91-
# Linker flags:
92-
"ldflags": [],
93-
# Apply conditions based on the host OS:
94-
"conditions": [
95-
[
96-
'OS=="mac"',
97-
{
98-
# Linker flags:
99-
"ldflags": [
100-
"-undefined dynamic_lookup",
101-
"-Wl,-no-pie",
102-
"-Wl,-search_paths_first",
103-
],
104-
},
105-
], # end condition (OS=="mac")
106-
[
107-
'OS!="win"',
108-
{
109-
# C/C++ flags:
110-
"cflags": [
111-
# Generate platform-independent code:
112-
"-fPIC",
113-
],
114-
},
115-
], # end condition (OS!="win")
116-
], # end conditions
117-
}, # end target <(addon_target_name)
118-
# Target to copy a generated add-on to a standard location:
128+
},
129+
], # end condition (OS!="win")
130+
], # end conditions
131+
}, # end target <(addon_target_name)
132+
133+
# Target to copy a generated add-on to a standard location:
134+
{
135+
'target_name': 'copy_addon',
136+
137+
# Declare that the output of this target is not linked:
138+
'type': 'none',
139+
140+
# Define dependencies:
141+
'dependencies': [
142+
# Require that the add-on be generated before building this target:
143+
'<(addon_target_name)',
144+
],
145+
146+
# Define a list of actions:
147+
'actions': [
119148
{
120-
"target_name": "copy_addon",
121-
# Declare that the output of this target is not linked:
122-
"type": "none",
123-
# Define dependencies:
124-
"dependencies": [
125-
# Require that the add-on be generated before building this target:
126-
"<(addon_target_name)",
127-
],
128-
# Define a list of actions:
129-
"actions": [
130-
{
131-
"action_name": "copy_addon",
132-
"message": "Copying addon...",
133-
# Explicitly list the inputs in the command-line invocation below:
134-
"inputs": [],
135-
# Declare the expected outputs:
136-
"outputs": [
137-
"<(addon_output_dir)/<(addon_target_name).node",
138-
],
139-
# Define the command-line invocation:
140-
"action": [
141-
"cp",
142-
"<(PRODUCT_DIR)/<(addon_target_name).node",
143-
"<(addon_output_dir)/<(addon_target_name).node",
144-
],
145-
},
146-
], # end actions
147-
}, # end target copy_addon
148-
], # end targets
149+
'action_name': 'copy_addon',
150+
'message': 'Copying addon...',
151+
152+
# Explicitly list the inputs in the command-line invocation below:
153+
'inputs': [],
154+
155+
# Declare the expected outputs:
156+
'outputs': [
157+
'<(addon_output_dir)/<(addon_target_name).node',
158+
],
159+
160+
# Define the command-line invocation:
161+
'action': [
162+
'cp',
163+
'<(PRODUCT_DIR)/<(addon_target_name).node',
164+
'<(addon_output_dir)/<(addon_target_name).node',
165+
],
166+
},
167+
], # end actions
168+
}, # end target copy_addon
169+
], # end targets
149170
}

lib/node_modules/@stdlib/stats/base/dists/degenerate/mean/examples/c/example.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dists/degenerate/mean.h"
20-
#include <stdlib.h>
2120
#include <stdio.h>
21+
#include <stdlib.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 m;
31-
int i;
29+
double mu;
30+
double m;
31+
int i;
3232

33-
for ( i = 0; i < 10; i++ ) {
34-
mu = random_uniform( -20.0, 20.0 );
35-
m = stdlib_base_dists_degenerate_mean( mu );
33+
for ( i = 0; i < 10; i++ ) {
34+
mu = random_uniform( 0.0, 20.0 );
35+
m = stdlib_base_dists_degenerate_mean( mu );
3636

37-
printf( "mu: %lf, Mean: %lf\n", mu, m );
38-
}
37+
printf( "µ: %lf, E(X;µ): %lf\n", mu, m );
38+
}
3939

40-
return 0;
40+
return 0;
4141
}

0 commit comments

Comments
 (0)