Small improvements to Histogram docs

This commit is contained in:
Vinzent Steinberg 2018-07-06 10:52:19 +02:00
parent 7f8663c23e
commit ef41836ec5
3 changed files with 12 additions and 2 deletions

View File

@ -23,7 +23,9 @@ macro_rules! define_histogram {
/// A histogram with a number of bins known at compile time.
#[derive(Debug, Clone)]
pub struct $name {
/// The ranges defining the bins of the histogram.
range: [f64; LEN + 1],
/// The bins of the histogram.
bin: [u64; LEN],
}

View File

@ -14,7 +14,7 @@
//! Everything is calculated iteratively in a single pass using constant memory,
//! so the sequence of numbers can be an iterator. The used algorithms try to
//! avoid numerical instabilities.
//!
//!
//! If you want [Serde](https://github.com/serde-rs/serde) support,
//! include `"serde"` in your list of features.
//!
@ -45,6 +45,7 @@
//! * Quantiles ([`Quantile`]).
//! * Minimum ([`Min`]) and maximum ([`Max`]).
//!
//!
//! ## Estimating several statistics at once
//!
//! The estimators are designed to have minimal state. The recommended way to
@ -59,6 +60,12 @@
//! only need to include the highest moment in your struct.
//!
//!
//! ## Calculating histograms
//!
//! The [`define_histogram`] macro can be used to define a histogram struct that
//! uses constant memory.
//!
//!
//! [`Mean`]: ./struct.Mean.html
//! [`MeanWithError`]: ./type.MeanWithError.html
//! [`WeightedMean`]: ./struct.WeightedMean.html
@ -70,6 +77,7 @@
//! [`Min`]: ./struct.Min.html
//! [`Max`]: ./struct.Max.html
//! [`concatenate`]: ./macro.concatenate.html
//! [`define_histogram`]: ./macro.define_histogram.html
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp))]

View File

@ -55,7 +55,7 @@ pub trait Histogram:
/// Return an iterator over the bin variances.
///
/// This is more efficient than using `variance()` each bin.
/// This is more efficient than calling `variance()` for each bin.
#[inline]
fn variances(&self) -> IterVariances<<&Self as IntoIterator>::IntoIter> {
let sum: u64 = self.bins().iter().sum();