Skip to content

Commit fb8c8a0

Browse files
chore: minor clean up
1 parent fdb5b88 commit fb8c8a0

File tree

6 files changed

+15
-91
lines changed

6 files changed

+15
-91
lines changed

lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ bench( pkg, function benchmark( b ) {
3939
len = 100;
4040
p = new Float64Array( len );
4141
for ( i = 0; i < len; i++ ) {
42-
p[ i ] = uniform( 0.0, 1.0 );
42+
p[ i ] = uniform( 0.0, 10.0 );
4343
}
4444

4545
b.tic();
4646
for ( i = 0; i < b.iterations; i++ ) {
47-
y = skewness( p[ i%100 ] );
47+
y = skewness( p[ i % len ] );
4848
if ( isnan( y ) ) {
4949
b.fail( 'should not return NaN' );
5050
}

lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/benchmark/benchmark.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4848
len = 100;
4949
p = new Float64Array( len );
5050
for ( i = 0; i < len; i++ ) {
51-
p[ i ] = uniform( 0.0, 1.0 );
51+
p[ i ] = uniform( 0.0, 10.0 );
5252
}
5353

5454
b.tic();
5555
for ( i = 0; i < b.iterations; i++ ) {
56-
y = skewness( p[ i%100 ] );
56+
y = skewness( p[ i % len ] );
5757
if ( isnan( y ) ) {
5858
b.fail( 'should not return NaN' );
5959
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ static double benchmark( void ) {
9999
int i;
100100

101101
for ( i = 0; i < 100; i++ ) {
102-
p[ i ] = random_uniform( 0.1, 10.0 );
102+
p[ i ] = random_uniform( 0.0, 10.0 );
103103
}
104104

105105
t = tic();
106106
for ( i = 0; i < ITERATIONS; i++ ) {
107-
y = stdlib_base_dists_bernoulli_skewness( p[ i%100 ] );
107+
y = stdlib_base_dists_bernoulli_skewness( p[ i % 100 ] );
108108
if ( y != y ) {
109109
printf( "should not return NaN\n" );
110110
break;

lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/include/stdlib/stats/base/dists/bernoulli/skewness.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Returns the skewness of a Bernoulli distribution.
30+
* Returns the skewness of a Bernoulli distribution with success probability 'p'.
3131
*/
3232
double stdlib_base_dists_bernoulli_skewness( const double p );
3333

lib/node_modules/@stdlib/stats/base/dists/bernoulli/skewness/src/Makefile

Lines changed: 6 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -45,102 +45,26 @@ endif
4545
endif
4646
endif
4747

48-
# Define the program used for compiling C source files:
49-
ifdef C_COMPILER
50-
CC := $(C_COMPILER)
51-
else
52-
CC := gcc
53-
endif
54-
55-
# Define the command-line options when compiling C files:
56-
CFLAGS ?= \
57-
-std=c99 \
58-
-O3 \
59-
-Wall \
60-
-pedantic
61-
62-
# Determine whether to generate position independent code ([1][1], [2][2]).
63-
#
64-
# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
65-
# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option
66-
ifeq ($(OS), WINNT)
67-
fPIC ?=
68-
else
69-
fPIC ?= -fPIC
70-
endif
71-
72-
# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`):
73-
INCLUDE ?=
74-
75-
# List of source files:
76-
SOURCE_FILES ?=
77-
78-
# List of libraries (e.g., `-lopenblas -lpthread`):
79-
LIBRARIES ?=
80-
81-
# List of library paths (e.g., `-L /foo/bar -L /beep/boop`):
82-
LIBPATH ?=
83-
84-
# List of C targets:
85-
c_targets := benchmark.out
86-
8748

8849
# RULES #
8950

9051
#/
91-
# Compiles source files.
92-
#
93-
# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`)
94-
# @param {string} [CFLAGS] - C compiler options
95-
# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
96-
# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`)
97-
# @param {string} [SOURCE_FILES] - list of source files
98-
# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
99-
# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`)
100-
#
101-
# @example
102-
# make
103-
#
104-
# @example
105-
# make all
106-
#/
107-
all: $(c_targets)
108-
109-
.PHONY: all
110-
111-
#/
112-
# Compiles C source files.
113-
#
114-
# @private
115-
# @param {string} CC - C compiler (e.g., `gcc`)
116-
# @param {string} CFLAGS - C compiler options
117-
# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`)
118-
# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`)
119-
# @param {string} SOURCE_FILES - list of source files
120-
# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`)
121-
# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`)
122-
#/
123-
$(c_targets): %.out: %.c
124-
$(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES)
125-
126-
#/
127-
# Runs compiled benchmarks.
52+
# Removes generated files for building an add-on.
12853
#
12954
# @example
130-
# make run
55+
# make clean-addon
13156
#/
132-
run: $(c_targets)
133-
$(QUIET) ./$<
57+
clean-addon:
58+
$(QUIET) -rm -f *.o *.node
13459

135-
.PHONY: run
60+
.PHONY: clean-addon
13661

13762
#/
13863
# Removes generated files.
13964
#
14065
# @example
14166
# make clean
14267
#/
143-
clean:
144-
$(QUIET) -rm -f *.o *.out
68+
clean: clean-addon
14569

14670
.PHONY: clean

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "stdlib/constants/float64/ninf.h"
2424

2525
/**
26-
* Returns the skewness of a Bernoulli distribution.
26+
* Returns the skewness of a Bernoulli distribution with success probability 'p'.
2727
*
2828
* @param p success probability
2929
* @returns skewness
@@ -58,5 +58,5 @@ double stdlib_base_dists_bernoulli_skewness( const double p ) {
5858
if ( p == 1.0 ) {
5959
return STDLIB_CONSTANT_FLOAT64_NINF;
6060
}
61-
return ( 1.0 - ( 2.0*p ) ) / stdlib_base_sqrt( p * ( 1.0-p ) );
61+
return ( 1.0 - ( 2.0 * p ) ) / stdlib_base_sqrt( p * ( 1.0 - p ) );
6262
}

0 commit comments

Comments
 (0)