Skip to content

Commit

Permalink
Fix doc links for new weighted code
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Mar 27, 2019
1 parent 131035e commit ef9e6a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/distributions/weighted/alias_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ use Rng;
/// }
/// ```
///
/// [`WeightedIndex<W>`]: WeightedIndex
/// [`Weight`]: Weight
/// [`WeightedIndex<W>`]: crate::distributions::weighted::alias_method::WeightedIndex
/// [`Weight`]: crate::distributions::weighted::alias_method::Weight
/// [`Vec<usize>`]: Vec
/// [`Uniform<usize>::sample`]: Distribution::sample
/// [`Uniform<W>::sample`]: Distribution::sample
Expand Down Expand Up @@ -282,7 +282,9 @@ pub trait Weight:
/// Element of `Self` equivalent to 0.
const ZERO: Self;

/// Converts a [`usize`] to a `Self`, rounding if necessary.
/// Produce an instance of `Self` from a `usize` value, or return `None` if
/// out of range. Loss of precision (where `Self` is a floating point type)
/// is acceptable.
fn try_from_usize_lossy(n: usize) -> Option<Self>;

/// Sums all values in slice `values`.
Expand Down
2 changes: 1 addition & 1 deletion src/distributions/weighted/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ use core::fmt;
/// ```
///
/// [`Uniform<X>`]: crate::distributions::uniform::Uniform
/// [`RngCore`]: rand_core::RngCore
/// [`RngCore`]: crate::RngCore
#[derive(Debug, Clone)]
pub struct WeightedIndex<X: SampleUniform + PartialOrd> {
cumulative_weights: Vec<X>,
Expand Down

0 comments on commit ef9e6a0

Please sign in to comment.