File tree 2 files changed +6
-4
lines changed
src/distributions/weighted
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ use Rng;
54
54
/// }
55
55
/// ```
56
56
///
57
- /// [`WeightedIndex<W>`]: WeightedIndex
58
- /// [`Weight`]: Weight
57
+ /// [`WeightedIndex<W>`]: crate::distributions::weighted::alias_method:: WeightedIndex
58
+ /// [`Weight`]: crate::distributions::weighted::alias_method:: Weight
59
59
/// [`Vec<usize>`]: Vec
60
60
/// [`Uniform<usize>::sample`]: Distribution::sample
61
61
/// [`Uniform<W>::sample`]: Distribution::sample
@@ -282,7 +282,9 @@ pub trait Weight:
282
282
/// Element of `Self` equivalent to 0.
283
283
const ZERO : Self ;
284
284
285
- /// Converts a [`usize`] to a `Self`, rounding if necessary.
285
+ /// Produce an instance of `Self` from a `usize` value, or return `None` if
286
+ /// out of range. Loss of precision (where `Self` is a floating point type)
287
+ /// is acceptable.
286
288
fn try_from_usize_lossy ( n : usize ) -> Option < Self > ;
287
289
288
290
/// Sums all values in slice `values`.
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ use core::fmt;
73
73
/// ```
74
74
///
75
75
/// [`Uniform<X>`]: crate::distributions::uniform::Uniform
76
- /// [`RngCore`]: rand_core ::RngCore
76
+ /// [`RngCore`]: crate ::RngCore
77
77
#[ derive( Debug , Clone ) ]
78
78
pub struct WeightedIndex < X : SampleUniform + PartialOrd > {
79
79
cumulative_weights : Vec < X > ,
You can’t perform that action at this time.
0 commit comments