Skip to content

Commit 61d6511

Browse files
refactor: test and repl
--- 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: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: passed - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent 521f17c commit 61d6511

File tree

6 files changed

+27
-57
lines changed

6 files changed

+27
-57
lines changed

lib/node_modules/@stdlib/stats/base/dvarmpn/benchmark/c/benchmark.length.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ int main( void ) {
182182
printf( "ok %d benchmark finished\n", count );
183183
}
184184
}
185-
for ( i = MIN; i <= MAX; i++ ) {
185+
for ( i = MIN; i <= MAX - 3; i++ ) {
186186
len = pow( 10, i );
187187
iter = ITERATIONS;
188188
for ( j = 0; j < REPEATS; j++ ) {

lib/node_modules/@stdlib/stats/base/dvarmpn/docs/repl.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
{{alias}}( N, mean, correction, x, stride )
2+
{{alias}}( N, mean, correction, x, strideX )
33
Computes the variance of a double-precision floating-point strided array
44
provided a known mean and using Neely's correction algorithm.
55

6-
The `N` and `stride` parameters determine which elements in `x` are accessed
7-
at runtime.
6+
The `N` and stride parameters determine which elements in the strided array
7+
are accessed at runtime.
88

99
Indexing is relative to the first index. To introduce an offset, use a typed
1010
array view.
@@ -34,8 +34,8 @@
3434
x: Float64Array
3535
Input array.
3636

37-
stride: integer
38-
Index increment.
37+
strideX: integer
38+
Stride Length.
3939

4040
Returns
4141
-------
@@ -49,20 +49,19 @@
4949
> {{alias}}( x.length, 1.0/3.0, 1, x, 1 )
5050
~4.3333
5151

52-
// Using `N` and `stride` parameters:
52+
// Using `N` and stride parameters:
5353
> x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] );
54-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
55-
> {{alias}}( N, 1.0/3.0, 1, x, 2 )
54+
> {{alias}}( 3, 1.0/3.0, 1, x, 2 )
5655
~4.3333
5756

5857
// Using view offsets:
5958
> var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, 1.0 ] );
6059
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
61-
> N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
62-
> {{alias}}( N, 1.0/3.0, 1, x1, 2 )
60+
> {{alias}}( 3, 1.0/3.0, 1, x1, 2 )
6361
~4.3333
6462

65-
{{alias}}.ndarray( N, mean, correction, x, stride, offset )
63+
64+
{{alias}}.ndarray( N, mean, correction, x, strideX, offsetX )
6665
Computes the variance of a double-precision floating-point strided array
6766
provided a known mean and using Neely's correction algorithm and alternative
6867
indexing semantics.
@@ -94,10 +93,10 @@
9493
x: Float64Array
9594
Input array.
9695

97-
stride: integer
98-
Index increment.
96+
strideX: integer
97+
Stride Length.
9998

100-
offset: integer
99+
offsetX: integer
101100
Starting index.
102101

103102
Returns
@@ -114,8 +113,7 @@
114113

115114
// Using offset parameter:
116115
> var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, 1.0 ] );
117-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
118-
> {{alias}}.ndarray( N, 1.0/3.0, 1, x, 2, 1 )
116+
> {{alias}}.ndarray( 3, 1.0/3.0, 1, x, 2, 1 )
119117
~4.3333
120118

121119
See Also

lib/node_modules/@stdlib/stats/base/dvarmpn/test/test.dvarmpn.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var floor = require( '@stdlib/math/base/special/floor' );
2524
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2625
var Float64Array = require( '@stdlib/array/float64' );
2726
var dvarmpn = require( './../lib/dvarmpn.js' );
@@ -121,7 +120,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
121120
});
122121

123122
tape( 'the function supports a `stride` parameter', function test( t ) {
124-
var N;
125123
var x;
126124
var v;
127125

@@ -136,15 +134,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
136134
2.0
137135
]);
138136

139-
N = floor( x.length / 2 );
140-
v = dvarmpn( N, 1.25, 1, x, 2 );
137+
v = dvarmpn( 4, 1.25, 1, x, 2 );
141138

142139
t.strictEqual( v, 6.25, 'returns expected value' );
143140
t.end();
144141
});
145142

146143
tape( 'the function supports a negative `stride` parameter', function test( t ) {
147-
var N;
148144
var x;
149145
var v;
150146

@@ -159,8 +155,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
159155
2.0
160156
]);
161157

162-
N = floor( x.length / 2 );
163-
v = dvarmpn( N, 1.25, 1, x, -2 );
158+
v = dvarmpn( 4, 1.25, 1, x, -2 );
164159

165160
t.strictEqual( v, 6.25, 'returns expected value' );
166161
t.end();
@@ -181,7 +176,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
181176
tape( 'the function supports view offsets', function test( t ) {
182177
var x0;
183178
var x1;
184-
var N;
185179
var v;
186180

187181
x0 = new Float64Array([
@@ -197,9 +191,8 @@ tape( 'the function supports view offsets', function test( t ) {
197191
]);
198192

199193
x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
200-
N = floor(x1.length / 2);
201194

202-
v = dvarmpn( N, 1.25, 1, x1, 2 );
195+
v = dvarmpn( 4, 1.25, 1, x1, 2 );
203196
t.strictEqual( v, 6.25, 'returns expected value' );
204197

205198
t.end();

lib/node_modules/@stdlib/stats/base/dvarmpn/test/test.dvarmpn.native.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
25-
var floor = require( '@stdlib/math/base/special/floor' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var Float64Array = require( '@stdlib/array/float64' );
2827
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -130,7 +129,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
130129
});
131130

132131
tape( 'the function supports a `stride` parameter', opts, function test( t ) {
133-
var N;
134132
var x;
135133
var v;
136134

@@ -145,15 +143,13 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
145143
2.0
146144
]);
147145

148-
N = floor( x.length / 2 );
149-
v = dvarmpn( N, 1.25, 1, x, 2 );
146+
v = dvarmpn( 4, 1.25, 1, x, 2 );
150147

151148
t.strictEqual( v, 6.25, 'returns expected value' );
152149
t.end();
153150
});
154151

155152
tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
156-
var N;
157153
var x;
158154
var v;
159155

@@ -168,8 +164,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
168164
2.0
169165
]);
170166

171-
N = floor( x.length / 2 );
172-
v = dvarmpn( N, 1.25, 1, x, -2 );
167+
v = dvarmpn( 4, 1.25, 1, x, -2 );
173168

174169
t.strictEqual( v, 6.25, 'returns expected value' );
175170
t.end();
@@ -190,7 +185,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
190185
tape( 'the function supports view offsets', opts, function test( t ) {
191186
var x0;
192187
var x1;
193-
var N;
194188
var v;
195189

196190
x0 = new Float64Array([
@@ -206,9 +200,8 @@ tape( 'the function supports view offsets', opts, function test( t ) {
206200
]);
207201

208202
x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
209-
N = floor(x1.length / 2);
210203

211-
v = dvarmpn( N, 1.25, 1, x1, 2 );
204+
v = dvarmpn( 4, 1.25, 1, x1, 2 );
212205
t.strictEqual( v, 6.25, 'returns expected value' );
213206

214207
t.end();

lib/node_modules/@stdlib/stats/base/dvarmpn/test/test.ndarray.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var floor = require( '@stdlib/math/base/special/floor' );
2524
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2625
var Float64Array = require( '@stdlib/array/float64' );
2726
var dvarmpn = require( './../lib/ndarray.js' );
@@ -121,7 +120,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
121120
});
122121

123122
tape( 'the function supports a `stride` parameter', function test( t ) {
124-
var N;
125123
var x;
126124
var v;
127125

@@ -136,15 +134,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
136134
2.0
137135
]);
138136

139-
N = floor( x.length / 2 );
140-
v = dvarmpn( N, 1.25, 1, x, 2, 0 );
137+
v = dvarmpn( 4, 1.25, 1, x, 2, 0 );
141138

142139
t.strictEqual( v, 6.25, 'returns expected value' );
143140
t.end();
144141
});
145142

146143
tape( 'the function supports a negative `stride` parameter', function test( t ) {
147-
var N;
148144
var x;
149145
var v;
150146

@@ -159,8 +155,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
159155
2.0
160156
]);
161157

162-
N = floor( x.length / 2 );
163-
v = dvarmpn( N, 1.25, 1, x, -2, 6 );
158+
v = dvarmpn( 4, 1.25, 1, x, -2, 6 );
164159

165160
t.strictEqual( v, 6.25, 'returns expected value' );
166161
t.end();
@@ -179,7 +174,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
179174
});
180175

181176
tape( 'the function supports an `offset` parameter', function test( t ) {
182-
var N;
183177
var x;
184178
var v;
185179

@@ -193,9 +187,8 @@ tape( 'the function supports an `offset` parameter', function test( t ) {
193187
3.0,
194188
4.0 // 3
195189
]);
196-
N = floor( x.length / 2 );
197190

198-
v = dvarmpn( N, 1.25, 1, x, 2, 1 );
191+
v = dvarmpn( 4, 1.25, 1, x, 2, 1 );
199192
t.strictEqual( v, 6.25, 'returns expected value' );
200193

201194
t.end();

lib/node_modules/@stdlib/stats/base/dvarmpn/test/test.ndarray.native.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
25-
var floor = require( '@stdlib/math/base/special/floor' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var Float64Array = require( '@stdlib/array/float64' );
2827
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -130,7 +129,6 @@ tape( 'if provided a `correction` parameter yielding `N-correction` less than or
130129
});
131130

132131
tape( 'the function supports a `stride` parameter', opts, function test( t ) {
133-
var N;
134132
var x;
135133
var v;
136134

@@ -145,15 +143,13 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) {
145143
2.0
146144
]);
147145

148-
N = floor( x.length / 2 );
149-
v = dvarmpn( N, 1.25, 1, x, 2, 0 );
146+
v = dvarmpn( 4, 1.25, 1, x, 2, 0 );
150147

151148
t.strictEqual( v, 6.25, 'returns expected value' );
152149
t.end();
153150
});
154151

155152
tape( 'the function supports a negative `stride` parameter', opts, function test( t ) {
156-
var N;
157153
var x;
158154
var v;
159155

@@ -168,8 +164,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test
168164
2.0
169165
]);
170166

171-
N = floor( x.length / 2 );
172-
v = dvarmpn( N, 1.25, 1, x, -2, 6 );
167+
v = dvarmpn( 4, 1.25, 1, x, -2, 6 );
173168

174169
t.strictEqual( v, 6.25, 'returns expected value' );
175170
t.end();
@@ -188,7 +183,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0`',
188183
});
189184

190185
tape( 'the function supports an `offset` parameter', opts, function test( t ) {
191-
var N;
192186
var x;
193187
var v;
194188

@@ -202,9 +196,8 @@ tape( 'the function supports an `offset` parameter', opts, function test( t ) {
202196
3.0,
203197
4.0 // 3
204198
]);
205-
N = floor( x.length / 2 );
206199

207-
v = dvarmpn( N, 1.25, 1, x, 2, 1 );
200+
v = dvarmpn( 4, 1.25, 1, x, 2, 1 );
208201
t.strictEqual( v, 6.25, 'returns expected value' );
209202

210203
t.end();

0 commit comments

Comments
 (0)