X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=linux%2Fmean_and_variance.c;fp=linux%2Fmean_and_variance.c;h=21ec6afc6788413a35c815cef827ef8a25891329;hb=7a716b76b5963dc2d158883f4497bab221932412;hp=b93d150ddf801628f4d08d0b6b6ef3892ed74c24;hpb=9e6d9560d070bc14e1498a24ef6634d2b99f7e84;p=bcachefs-tools-debian diff --git a/linux/mean_and_variance.c b/linux/mean_and_variance.c index b93d150..21ec6af 100644 --- a/linux/mean_and_variance.c +++ b/linux/mean_and_variance.c @@ -102,6 +102,8 @@ EXPORT_SYMBOL_GPL(mean_and_variance_get_stddev); * mean_and_variance_weighted_update() - exponentially weighted variant of mean_and_variance_update() * @s: mean and variance number of samples and their sums * @x: new value to include in the &mean_and_variance_weighted + * @initted: caller must track whether this is the first use or not + * @weight: ewma weight * * see linked pdf: function derived from equations 140-143 where alpha = 2^w. * values are stored bitshifted for performance and added precision. @@ -132,6 +134,7 @@ EXPORT_SYMBOL_GPL(mean_and_variance_weighted_update); /** * mean_and_variance_weighted_get_mean() - get mean from @s * @s: mean and variance number of samples and their sums + * @weight: ewma weight */ s64 mean_and_variance_weighted_get_mean(struct mean_and_variance_weighted s, u8 weight) @@ -143,6 +146,7 @@ EXPORT_SYMBOL_GPL(mean_and_variance_weighted_get_mean); /** * mean_and_variance_weighted_get_variance() -- get variance from @s * @s: mean and variance number of samples and their sums + * @weight: ewma weight */ u64 mean_and_variance_weighted_get_variance(struct mean_and_variance_weighted s, u8 weight) @@ -155,6 +159,7 @@ EXPORT_SYMBOL_GPL(mean_and_variance_weighted_get_variance); /** * mean_and_variance_weighted_get_stddev() - get standard deviation from @s * @s: mean and variance number of samples and their sums + * @weight: ewma weight */ u32 mean_and_variance_weighted_get_stddev(struct mean_and_variance_weighted s, u8 weight)