[][src]Struct qmc::util::bondcontainer::BondContainer

pub struct BondContainer<T: Clone + Into<usize>> { /* fields omitted */ }

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 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]

impl<T: Debug + Clone + Into<usize>> Debug for BondContainer<T>[src]

impl<T: Default + Clone + Into<usize>> Default for BondContainer<T>[src]

impl<O: Op + Clone> Factory<BondContainer<usize>> for FastOpsTemplate<O>[src]

impl<T: Clone + Into<usize>> Reset for BondContainer<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for BondContainer<T> where
    T: RefUnwindSafe

impl<T> Send for BondContainer<T> where
    T: Send

impl<T> Sync for BondContainer<T> where
    T: Sync

impl<T> Unpin for BondContainer<T> where
    T: Unpin

impl<T> UnwindSafe for BondContainer<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,