Skip to content

Commit 2ab9bc5

Browse files
chore: suggestions from code review
1 parent 1297c71 commit 2ab9bc5

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ double v = stdlib_strided_dsmean( 4, x, 2 );
185185
The function accepts the following arguments:
186186
187187
- **N**: `[in] CBLAS_INT` number of indexed elements.
188-
- **X**: `[in] double*` input array.
188+
- **X**: `[in] float*` input array.
189189
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
190190
191191
```c
192-
double stdlib_strided_dsmean( const CBLAS_INT N, const double *X, const CBLAS_INT strideX );
192+
double stdlib_strided_dsmean( const CBLAS_INT N, const float *X, const CBLAS_INT strideX );
193193
```
194194

195195
#### stdlib_strided_dsmean_ndarray( N, \*X, strideX, offsetX )
@@ -206,12 +206,12 @@ double v = stdlib_strided_dsmean_ndarray( 4, x, 2, 0 );
206206
The function accepts the following arguments:
207207
208208
- **N**: `[in] CBLAS_INT` number of indexed elements.
209-
- **X**: `[in] double*` input array.
209+
- **X**: `[in] float*` input array.
210210
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
211211
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
212212
213213
```c
214-
double stdlib_strided_dsmean_ndarray( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
214+
double stdlib_strided_dsmean_ndarray( const CBLAS_INT N, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
215215
```
216216

217217
</section>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ interface Routine {
8282
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
8383
*
8484
* var v = dsmean.ndarray( x.length, x, 1, 0 );
85-
* // returns ~1.25
85+
* // returns ~0.3333
8686
*/
8787
declare var dsmean: Routine;
8888

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
100100
2.0
101101
]);
102102

103-
v = dsmean( 4, x, 2, 0 );
103+
v = dsmean( 4, x, 2 );
104104

105105
t.strictEqual( v, 1.25, 'returns expected value' );
106106
t.end();
@@ -121,7 +121,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
121121
2.0
122122
]);
123123

124-
v = dsmean( 4, x, -2, 6 );
124+
v = dsmean( 4, x, -2 );
125125

126126
t.strictEqual( v, 1.25, 'returns expected value' );
127127
t.end();
@@ -139,22 +139,26 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
139139
t.end();
140140
});
141141

142-
tape( 'the function supports an `offset` parameter', function test( t ) {
143-
var x;
142+
tape( 'the function supports view offsets', function test( t ) {
143+
var x0;
144+
var x1;
144145
var v;
145146

146-
x = new Float32Array([
147+
x0 = new Float32Array([
147148
2.0,
148149
1.0, // 0
149150
2.0,
150151
-2.0, // 1
151152
-2.0,
152153
2.0, // 2
153154
3.0,
154-
4.0 // 3
155+
4.0, // 3
156+
6.0
155157
]);
156158

157-
v = dsmean( 4, x, 2, 1 );
159+
x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
160+
161+
v = dsmean( 4, x1, 2 );
158162
t.strictEqual( v, 1.25, 'returns expected value' );
159163

160164
t.end();

0 commit comments

Comments
 (0)