Skip to content

Commit

Permalink
Fix nightly feature
Browse files Browse the repository at this point in the history
  • Loading branch information
vks committed Apr 30, 2021
1 parent 0002210 commit 44e8aea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/histogram_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ where [u8; LEN + 1]: Sized {
}

/// Iterate over all `(range, count)` pairs in the histogram.
#[derive(Clone, Debug)]
pub struct IterHistogram<'a> {
remaining_bin: &'a [u64],
remaining_range: &'a [f64],
Expand Down Expand Up @@ -281,6 +282,7 @@ fn multinomal_variance(n: f64, n_tot_inv: f64) -> f64 {
}

/// Iterate over the bins normalized by bin width.
#[derive(Clone, Debug)]
pub struct IterNormalized<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand All @@ -299,6 +301,7 @@ impl<T> Iterator for IterNormalized<T>
}

/// Iterate over the widths of the bins.
#[derive(Clone, Debug)]
pub struct IterWidths<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand All @@ -317,6 +320,7 @@ impl<T> Iterator for IterWidths<T>
}

/// Iterate over the bin centers.
#[derive(Clone, Debug)]
pub struct IterBinCenters<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand All @@ -335,6 +339,7 @@ impl<T> Iterator for IterBinCenters<T>
}

/// Iterate over the variances.
#[derive(Clone, Debug)]
pub struct IterVariances<T>
where T: Iterator<Item = ((f64, f64), u64)>
{
Expand All @@ -352,4 +357,4 @@ impl<T> Iterator for IterVariances<T>
self.histogram_iter.next()
.map(|(_, n)| multinomal_variance(n as f64, self.sum_inv))
}
}
}
2 changes: 1 addition & 1 deletion tests/integration/histogram_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rand_distr::Distribution;

use average::{Merge, assert_almost_eq};
use average::histogram_const::{Histogram, InvalidRangeError,
SampleOutOfRangeError};
SampleOutOfRangeError};

type Histogram10 = Histogram<10>;

Expand Down

0 comments on commit 44e8aea

Please sign in to comment.