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:
Vinzent Steinberg 2017-05-28 21:15:59 +02:00
parent 30622be775
commit 978f6ec10e
2 changed files with 4 additions and 4 deletions

View File

@ -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.
//

View File

@ -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.
//