Skip to content

Commit 7a3a72c

Browse files
committed
refactor: formatting files based on PR feedback
--- 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: passed - 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 25efb5a commit 7a3a72c

File tree

7 files changed

+201
-187
lines changed

7 files changed

+201
-187
lines changed

lib/node_modules/@stdlib/stats/base/dists/chisquare/kurtosis/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,15 @@ static double random_uniform( const double min, const double max ) {
188188
}
189189
190190
int main( void ) {
191-
double k;
192191
double result;
192+
double k;
193193
int i;
194194
195195
for ( i = 0; i < 10; i++ ) {
196196
k = random_uniform( 0.1, 10.0 ); // Ensure `k` is positive
197197
result = stdlib_base_dists_chisquare_kurtosis( k );
198198
199-
printf( "k: %lf, Excess Kurtosis: %lf \n", k, result );
199+
printf( "k: %lf, Kurt(X,k): %lf \n", k, result );
200200
}
201201
202202
return 0;

lib/node_modules/@stdlib/stats/base/dists/chisquare/kurtosis/benchmark/c/benchmark.c

Lines changed: 7 additions & 7 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/chisquare/kurtosis.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 "chisquare-kurtosis"
2727
#define ITERATIONS 1000000
@@ -52,7 +52,7 @@ static void print_results( double elapsed ) {
5252
static double tic( void ) {
5353
struct timeval now;
5454
gettimeofday( &now, NULL );
55-
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
55+
return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
5656
}
5757

5858
static double random_uniform( const double min, const double max ) {
@@ -73,7 +73,7 @@ static double benchmark( void ) {
7373

7474
start = tic();
7575
for ( i = 0; i < ITERATIONS; i++ ) {
76-
y = stdlib_base_dists_chisquare_kurtosis( k[ i%100 ] );
76+
y = stdlib_base_dists_chisquare_kurtosis( k[ i % 100 ] );
7777
if ( isnan( y ) ) {
7878
printf( "should not return NaN\n" );
7979
break;
@@ -91,15 +91,15 @@ int main( void ) {
9191
double elapsed;
9292
int i;
9393

94-
// Seed the random number generator:
94+
// Seed the random number generator:
9595
srand( time( NULL ) );
9696

9797
print_version();
9898
for ( i = 0; i < REPEATS; i++ ) {
9999
printf( "# c::%s\n", NAME );
100100
elapsed = benchmark();
101101
print_results( elapsed );
102-
printf( "ok %d benchmark finished\n", i+1 );
102+
printf( "ok %d benchmark finished\n", i + 1 );
103103
}
104104
print_summary( REPEATS, REPEATS );
105105
}
Lines changed: 145 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @license Apache-2.0
22
#
3-
# Copyright (c) 2025 The Stdlib Authors.
3+
# Copyright (c) 2024 The Stdlib Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -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/chisquare/kurtosis/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/chisquare/kurtosis.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 k;
30-
double result;
31-
int i;
29+
double result;
30+
double k;
31+
int i;
3232

33-
for ( i = 0; i < 10; i++ ) {
34-
k = random_uniform( 0.1, 10.0 ); // Ensure `k` is positive
35-
result = stdlib_base_dists_chisquare_kurtosis( k );
33+
for ( i = 0; i < 10; i++ ) {
34+
k = random_uniform( 0.1, 10.0 ); // Ensure `k` is positive
35+
result = stdlib_base_dists_chisquare_kurtosis( k );
3636

37-
printf( "k: %lf, Excess Kurtosis: %lf \n", k, result );
38-
}
37+
printf( "k: %lf, Kurt(X,k): %lf \n", k, result );
38+
}
3939

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

0 commit comments

Comments
 (0)