Skip to content

Commit fef6708

Browse files
authored
Update ndarray.js
Signed-off-by: JaySoni1 <[email protected]>
1 parent 49632ac commit fef6708

File tree

1 file changed

+14
-0
lines changed
  • lib/node_modules/@stdlib/stats/base/meanpn/lib

1 file changed

+14
-0
lines changed

lib/node_modules/@stdlib/stats/base/meanpn/lib/ndarray.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818

1919
'use strict';
2020

21+
2122
// MODULES //
2223

2324
var gsumpw = require( '@stdlib/blas/ext/base/gsumpw' ).ndarray;
2425
var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ).ndarray;
2526

27+
2628
// MAIN //
2729

2830
/**
@@ -53,6 +55,17 @@ var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ).ndarray;
5355
* // returns 1.25
5456
*/
5557
// cspell:ignore meanpn
58+
59+
/**
60+
* Computes the arithmetic mean of a strided array using a two-pass error correction algorithm.
61+
*
62+
* @private
63+
* @param {PositiveInteger} N - number of indexed elements
64+
* @param {NumericArray} x - input array
65+
* @param {integer} stride - stride length
66+
* @param {NonNegativeInteger} offset - starting index
67+
* @returns {number} arithmetic mean
68+
*/
5669
function meanpn( N, x, stride, offset ) {
5770
var mu;
5871
var c;
@@ -72,6 +85,7 @@ function meanpn( N, x, stride, offset ) {
7285
return mu + c;
7386
}
7487

88+
7589
// EXPORTS //
7690

7791
module.exports = meanpn;

0 commit comments

Comments
 (0)