Struct qmc::util::bondcontainer::BondContainer [−][src]
A HashSet with random sampling.
Implementations
impl<T: Clone + Into<usize>> BondContainer<T>
[src]
pub fn get_total_weight(&self) -> f64
[src]
Return sum of all weights in BondContainer.
pub fn get_random<R: Rng>(&self, r: R) -> Option<&(T, f64)>
[src]
Get a random weighted entry.
pub fn remove(&mut self, value: &T) -> bool
[src]
Remove a given value.
pub fn contains(&self, value: &T) -> bool
[src]
Check if a given element has been inserted.
pub fn get_weight(&self, value: &T) -> Option<f64>
[src]
Get the weight of the value if it’s in the container.
pub fn insert(&mut self, value: T, weight: f64) -> bool
[src]
Insert an element. Returns true if the element is new.
pub fn clear(&mut self)
[src]
Clear the set
pub fn len(&self) -> usize
[src]
Get number of elements in set.
pub fn is_empty(&self) -> bool
[src]
Check if empty.
pub fn iter(&self) -> impl Iterator<Item = &(T, f64)>
[src]
Iterate through items.
Trait Implementations
impl<T: Clone + Into<usize>> Clone for BondContainer<T>
[src]
fn clone(&self) -> BondContainer<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + Clone + Into<usize>> Debug for BondContainer<T>
[src]
impl<T: Default + Clone + Into<usize>> Default for BondContainer<T>
[src]
fn default() -> BondContainer<T>
[src]
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BondContainer<VarPos>> for FastOpsTemplate<O, ALLOC>
[src]
fn get_instance(&mut self) -> BondContainer<VarPos>
[src]
fn return_instance(&mut self, t: BondContainer<VarPos>)
[src]
impl Factory<BondContainer<VarPos>> for DefaultFastOpAllocator
[src]
fn get_instance(&mut self) -> BondContainer<VarPos>
[src]
fn return_instance(&mut self, t: BondContainer<VarPos>)
[src]
impl<ALLOC: FastOpAllocator> Factory<BondContainer<VarPos>> for SwitchableFastOpAllocator<ALLOC>
[src]
fn get_instance(&mut self) -> BondContainer<VarPos>
[src]
fn return_instance(&mut self, t: BondContainer<VarPos>)
[src]
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BondContainer<usize>> for FastOpsTemplate<O, ALLOC>
[src]
fn get_instance(&mut self) -> BondContainer<usize>
[src]
fn return_instance(&mut self, t: BondContainer<usize>)
[src]
impl Factory<BondContainer<usize>> for DefaultFastOpAllocator
[src]
fn get_instance(&mut self) -> BondContainer<usize>
[src]
fn return_instance(&mut self, t: BondContainer<usize>)
[src]
impl<ALLOC: FastOpAllocator> Factory<BondContainer<usize>> for SwitchableFastOpAllocator<ALLOC>
[src]
fn get_instance(&mut self) -> BondContainer<usize>
[src]
fn return_instance(&mut self, t: BondContainer<usize>)
[src]
impl<T: Clone + Into<usize>> Reset for BondContainer<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for BondContainer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for BondContainer<T> where
T: Send,
T: Send,
impl<T> Sync for BondContainer<T> where
T: Sync,
T: Sync,
impl<T> Unpin for BondContainer<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BondContainer<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,