|  | 
| 23 | 23 | /** | 
| 24 | 24 | * Computes the variance of a double-precision floating-point strided array using Welford's algorithm. | 
| 25 | 25 | * | 
| 26 |  | -* @param N            number of indexed elements | 
| 27 |  | -* @param correction   degrees of freedom adjustment | 
| 28 |  | -* @param X            input array | 
| 29 |  | -* @param strideX      stride length | 
| 30 |  | -* @return             output value | 
| 31 |  | -*/ | 
| 32 |  | -double API_SUFFIX(stdlib_strided_dvariancewd)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX ) { | 
| 33 |  | -	const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); | 
| 34 |  | -	return API_SUFFIX(stdlib_strided_dvariancewd_ndarray)( N, correction, X, strideX, ox ); | 
| 35 |  | -} | 
| 36 |  | - | 
| 37 |  | -/** | 
| 38 |  | -* Computes the variance of a double-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. | 
| 39 |  | -* | 
| 40 | 26 | * ## Method | 
| 41 | 27 | * | 
| 42 | 28 | * -   This implementation uses Welford's algorithm for efficient computation, which can be derived as follows. Let | 
| @@ -80,6 +66,20 @@ double API_SUFFIX(stdlib_strided_dvariancewd)( const CBLAS_INT N, const double c | 
| 80 | 66 | * @param correction   degrees of freedom adjustment | 
| 81 | 67 | * @param X            input array | 
| 82 | 68 | * @param strideX      stride length | 
|  | 69 | +* @return             output value | 
|  | 70 | +*/ | 
|  | 71 | +double API_SUFFIX(stdlib_strided_dvariancewd)( const CBLAS_INT N, const double correction, const double *X, const CBLAS_INT strideX ) { | 
|  | 72 | +	const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX ); | 
|  | 73 | +	return API_SUFFIX(stdlib_strided_dvariancewd_ndarray)( N, correction, X, strideX, ox ); | 
|  | 74 | +} | 
|  | 75 | + | 
|  | 76 | +/** | 
|  | 77 | +* Computes the variance of a double-precision floating-point strided array using Welford's algorithm and alternative indexing semantics. | 
|  | 78 | +* | 
|  | 79 | +* @param N            number of indexed elements | 
|  | 80 | +* @param correction   degrees of freedom adjustment | 
|  | 81 | +* @param X            input array | 
|  | 82 | +* @param strideX      stride length | 
| 83 | 83 | * @param offsetX      starting index for X | 
| 84 | 84 | * @return             output value | 
| 85 | 85 | */ | 
|  | 
0 commit comments