Skip to content

Commit b6126f7

Browse files
chore: minor 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: passed - task: lint_javascript_src status: passed - 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: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - 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: na - 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 3db0802 commit b6126f7

File tree

7 files changed

+34
-52
lines changed

7 files changed

+34
-52
lines changed

lib/node_modules/@stdlib/stats/base/dmeanpn/README.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,16 @@ The function has the following parameters:
6969

7070
- **N**: number of indexed elements.
7171
- **x**: input [`Float64Array`][@stdlib/array/float64].
72-
- **strideX**: index increment for `x`.
72+
- **strideX**: stride increment for `x`.
7373

7474
The `N` and `strideX` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`,
7575

7676
```javascript
7777
var Float64Array = require( '@stdlib/array/float64' );
78-
var floor = require( '@stdlib/math/base/special/floor' );
7978

8079
var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
81-
var N = floor( x.length / 2 );
8280

83-
var v = dmeanpn( N, x, 2 );
81+
var v = dmeanpn( 4, x, 2 );
8482
// returns 1.25
8583
```
8684

@@ -90,18 +88,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [
9088

9189
```javascript
9290
var Float64Array = require( '@stdlib/array/float64' );
93-
var floor = require( '@stdlib/math/base/special/floor' );
9491

9592
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
9693
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
9794

98-
var N = floor( x0.length / 2 );
99-
100-
var v = dmeanpn( N, x1, 2 );
95+
var v = dmeanpn( 4, x1, 2 );
10196
// returns 1.25
10297
```
10398

104-
#### dmeanpn.ndarray( N, x, stridXe, offset )
99+
#### dmeanpn.ndarray( N, x, strideX, offsetX )
105100

106101
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array using a two-pass error correction algorithm and alternative indexing semantics.
107102

@@ -117,18 +112,16 @@ var v = dmeanpn.ndarray( N, x, 1, 0 );
117112

118113
The function has the following additional parameters:
119114

120-
- **offset**: starting index for `x`.
115+
- **offsetX**: starting index for `x`.
121116

122117
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other value in `x` starting from the second value
123118

124119
```javascript
125120
var Float64Array = require( '@stdlib/array/float64' );
126-
var floor = require( '@stdlib/math/base/special/floor' );
127121

128122
var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
129-
var N = floor( x.length / 2 );
130123

131-
var v = dmeanpn.ndarray( N, x, 2, 1 );
124+
var v = dmeanpn.ndarray( 4, x, 2, 1 );
132125
// returns 1.25
133126
```
134127

@@ -213,7 +206,7 @@ Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-p
213206
```c
214207
const double x[] = { 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 };
215208

216-
double v = stdlib_strided_dmeankbn2_ndarray( 4, x, 2, 1 );
209+
double v = stdlib_strided_dmeanpn_ndarray( 4, x, 2, 1 );
217210
// returns 1.25
218211
```
219212
@@ -254,14 +247,8 @@ int main( void ) {
254247
// Create a strided array:
255248
const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
256249

257-
// Specify the number of elements:
258-
const int N = 4;
259-
260-
// Specify the stride length:
261-
const int strideX = 2;
262-
263250
// Compute the arithmetic mean:
264-
double v = stdlib_strided_dmeanpn( N, x, strideX );
251+
double v = stdlib_strided_dmeanpn( 4, x, 2 );
265252

266253
// Print the result:
267254
printf( "mean: %lf\n", v );

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

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

2-
{{alias}}( N, x, stride )
2+
{{alias}}( N, x, strideX )
33
Computes the arithmetic mean of a double-precision floating-point strided
44
array using a two-pass error 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.
@@ -19,8 +19,8 @@
1919
x: Float64Array
2020
Input array.
2121

22-
stride: integer
23-
Index increment.
22+
strideX: integer
23+
Stride length.
2424

2525
Returns
2626
-------
@@ -34,28 +34,25 @@
3434
> {{alias}}( x.length, x, 1 )
3535
~0.3333
3636

37-
// Using `N` and `stride` parameters:
37+
// Using `N` and stride parameters:
3838
> x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] );
39-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
40-
> var stride = 2;
41-
> {{alias}}( N, x, stride )
39+
> {{alias}}( 3, x, 2 )
4240
~0.3333
4341

4442
// Using view offsets:
4543
> var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
4644
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
47-
> N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
48-
> stride = 2;
49-
> {{alias}}( N, x1, stride )
45+
> {{alias}}( 3, x1, 2 )
5046
~-0.3333
5147

52-
{{alias}}.ndarray( N, x, stride, offset )
48+
49+
{{alias}}.ndarray( N, x, strideX, offsetX )
5350
Computes the arithmetic mean of a double-precision floating-point strided
5451
array using a two-pass error correction algorithm and alternative indexing
5552
semantics.
5653

5754
While typed array views mandate a view offset based on the underlying
58-
buffer, the `offset` parameter supports indexing semantics based on a
55+
buffer, the offset parameter supports indexing semantics based on a
5956
starting index.
6057

6158
Parameters
@@ -66,10 +63,10 @@
6663
x: Float64Array
6764
Input array.
6865

69-
stride: integer
70-
Index increment.
66+
strideX: integer
67+
Stride length.
7168

72-
offset: integer
69+
offsetX: integer
7370
Starting index.
7471

7572
Returns
@@ -86,8 +83,7 @@
8683

8784
// Using offset parameter:
8885
> var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
89-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
90-
> {{alias}}.ndarray( N, x, 2, 1 )
86+
> {{alias}}.ndarray( 3, x, 2, 1 )
9187
~-0.3333
9288

9389
See Also

lib/node_modules/@stdlib/stats/base/dmeanpn/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface Routine {
2727
*
2828
* @param N - number of indexed elements
2929
* @param x - input array
30-
* @param stride - stride length
30+
* @param strideX - stride length
3131
* @returns arithmetic mean
3232
*
3333
* @example
@@ -38,15 +38,15 @@ interface Routine {
3838
* var v = dmeanpn( x.length, x, 1 );
3939
* // returns ~0.3333
4040
*/
41-
( N: number, x: Float64Array, stride: number ): number;
41+
( N: number, x: Float64Array, strideX: number ): number;
4242

4343
/**
4444
* Computes the arithmetic mean of a double-precision floating-point strided array using a two-pass error correction algorithm and alternative indexing semantics.
4545
*
4646
* @param N - number of indexed elements
4747
* @param x - input array
48-
* @param stride - stride length
49-
* @param offset - starting index
48+
* @param strideX - stride length
49+
* @param offsetX - starting index
5050
* @returns arithmetic mean
5151
*
5252
* @example
@@ -57,15 +57,15 @@ interface Routine {
5757
* var v = dmeanpn.ndarray( x.length, x, 1, 0 );
5858
* // returns ~0.3333
5959
*/
60-
ndarray( N: number, x: Float64Array, stride: number, offset: number ): number;
60+
ndarray( N: number, x: Float64Array, strideX: number, offsetX: number ): number;
6161
}
6262

6363
/**
6464
* Computes the arithmetic mean of a double-precision floating-point strided array using a two-pass error correction algorithm.
6565
*
6666
* @param N - number of indexed elements
6767
* @param x - input array
68-
* @param stride - stride length
68+
* @param strideX - stride length
6969
* @returns arithmetic mean
7070
*
7171
* @example

lib/node_modules/@stdlib/stats/base/dmeanpn/examples/c/example.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dmeanpn.h"
20-
#include <stdint.h>
2120
#include <stdio.h>
2221

2322
int main( void ) {

lib/node_modules/@stdlib/stats/base/dmeanpn/lib/dmeanpn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var ndarray = require( './ndarray.js' );
4848
*
4949
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
5050
*
51-
* var v = dmeanpn( 3, x, 1 );
51+
* var v = dmeanpn( x.length, x, 1 );
5252
* // returns ~0.3333
5353
*/
5454
function dmeanpn( N, x, strideX ) {

lib/node_modules/@stdlib/stats/base/dmeanpn/lib/dmeanpn.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var addon = require( './../src/addon.node' );
3838
*
3939
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
4040
*
41-
* var v = dmeanpn( 3, x, 1 );
41+
* var v = dmeanpn( x.length, x, 1 );
4242
* //returns ~0.3333
4343
*/
4444
function dmeanpn( N, x, strideX ) {

lib/node_modules/@stdlib/stats/base/dmeanpn/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
*
2828
* @param N number of indexed elements
2929
* @param X input array
30-
* @param strideX strideX length
31-
* @return output value
30+
* @param strideX stride length
31+
* @return output value
3232
*/
3333
double API_SUFFIX( stdlib_strided_dmeanpn )( const CBLAS_INT N, const double *X, const CBLAS_INT strideX ) {
3434
const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
@@ -40,7 +40,7 @@ double API_SUFFIX( stdlib_strided_dmeanpn )( const CBLAS_INT N, const double *X,
4040
*
4141
* @param N - number of indexed elements
4242
* @param x - input array
43-
* @param strideX - strideX length
43+
* @param strideX - stride length
4444
* @param offsetX - starting index
4545
* @returns {double} arithmetic mean
4646
*/

0 commit comments

Comments
 (0)