Make increment
and add_inner
private
They mess up invariants if not used correctly and don't have to be public anymore.
This commit is contained in:
parent
30622be775
commit
978f6ec10e
@ -42,7 +42,7 @@ impl Mean {
|
||||
///
|
||||
/// This does not update anything else.
|
||||
#[inline]
|
||||
pub fn increment(&mut self) {
|
||||
fn increment(&mut self) {
|
||||
self.n += 1;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ impl Mean {
|
||||
/// size was already updated.
|
||||
///
|
||||
/// This is useful for avoiding unnecessary divisions in the inner loop.
|
||||
pub fn add_inner(&mut self, delta_n: f64) {
|
||||
fn add_inner(&mut self, delta_n: f64) {
|
||||
// This algorithm introduced by Welford in 1962 trades numerical
|
||||
// stability for a division inside the loop.
|
||||
//
|
||||
|
@ -39,7 +39,7 @@ impl Variance {
|
||||
///
|
||||
/// This does not update anything else.
|
||||
#[inline]
|
||||
pub fn increment(&mut self) {
|
||||
fn increment(&mut self) {
|
||||
self.avg.increment();
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ impl Variance {
|
||||
/// size was already updated.
|
||||
///
|
||||
/// This is useful for avoiding unnecessary divisions in the inner loop.
|
||||
pub fn add_inner(&mut self, delta_n: f64) {
|
||||
fn add_inner(&mut self, delta_n: f64) {
|
||||
// This algorithm introduced by Welford in 1962 trades numerical
|
||||
// stability for a division inside the loop.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user