Home
last modified time | relevance | path

Searched refs:WeightedError (Results 1 – 5 of 5) sorted by relevance

/external/rust/crates/rand/src/distributions/
Dweighted_index.rs96 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 …]
Dweighted.rs14 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()
Dmod.rs105 pub use self::weighted_index::{WeightedError, WeightedIndex};
/external/rust/crates/rand/src/seq/
Dmod.rs38 #[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 …]
Dindex.rs22 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()