pub struct WeightedSampler {
n: usize,
prob: Vec<f64>,
alias: Vec<usize>,
}Fields§
§n: usize§prob: Vec<f64>§alias: Vec<usize>Implementations§
Source§impl WeightedSampler
impl WeightedSampler
pub fn new(weights: impl IntoIterator<Item = f64>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WeightedSampler
impl RefUnwindSafe for WeightedSampler
impl Send for WeightedSampler
impl Sync for WeightedSampler
impl Unpin for WeightedSampler
impl UnwindSafe for WeightedSampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more