Searched refs:WeightedError (Results 1 – 5 of 5) sorted by relevance
/external/rust/crates/rand/src/distributions/ |
D | weighted_index.rs | 96 pub fn new<I>(weights: I) -> Result<WeightedIndex<X>, WeightedError> in new() 103 let mut total_weight: X = iter.next().ok_or(WeightedError::NoItem)?.borrow().clone(); in new() 107 return Err(WeightedError::InvalidWeight); in new() 115 return Err(WeightedError::InvalidWeight); in new() 122 return Err(WeightedError::AllWeightsZero); in new() 142 pub fn update_weights(&mut self, new_weights: &[(usize, &X)]) -> Result<(), WeightedError> in update_weights() 161 return Err(WeightedError::InvalidWeight); in update_weights() 165 return Err(WeightedError::InvalidWeight); in update_weights() 168 return Err(WeightedError::TooMany); in update_weights() 185 return Err(WeightedError::AllWeightsZero); in update_weights() [all …]
|
D | weighted.rs | 14 pub use super::{WeightedIndex, WeightedError}; 23 use super::WeightedError; 30 pub fn new(_weights: Vec<W>) -> Result<Self, WeightedError> { in new() argument 31 Err(WeightedError::NoItem) in new()
|
D | mod.rs | 105 pub use self::weighted_index::{WeightedError, WeightedIndex};
|
/external/rust/crates/rand/src/seq/ |
D | mod.rs | 38 #[cfg(feature = "alloc")] use crate::distributions::WeightedError; 145 ) -> Result<&Self::Item, WeightedError> in choose_weighted() 173 ) -> Result<&mut Self::Item, WeightedError> in choose_weighted_mut() 222 ) -> Result<SliceChooseIter<Self, Self::Item>, WeightedError> in choose_multiple_weighted() 528 ) -> Result<&Self::Item, WeightedError> in choose_weighted() 547 ) -> Result<&mut Self::Item, WeightedError> in choose_weighted_mut() 566 ) -> Result<SliceChooseIter<Self, Self::Item>, WeightedError> in choose_multiple_weighted() 1096 Err(WeightedError::NoItem) in test_weighted() 1100 Err(WeightedError::NoItem) in test_weighted() 1104 Err(WeightedError::AllWeightsZero) in test_weighted() [all …]
|
D | index.rs | 22 use crate::distributions::WeightedError; 279 ) -> Result<IndexVec, WeightedError> in sample_weighted() 311 ) -> Result<IndexVec, WeightedError> in sample_efraimidis_spirakis() 357 return Err(WeightedError::InvalidWeight); in sample_efraimidis_spirakis() 392 return Err(WeightedError::InvalidWeight); in sample_efraimidis_spirakis()
|