pub struct DequeSolutionSet<T, Q = f64>{ /* private fields */ }Expand description
SolutionSet implementation backed by VecDeque.
Useful when frequent pushes and pops from the front/back are expected.
Implementations§
Trait Implementations§
Source§impl<T, Q> Clone for DequeSolutionSet<T, Q>
impl<T, Q> Clone for DequeSolutionSet<T, Q>
Source§fn clone(&self) -> DequeSolutionSet<T, Q>
fn clone(&self) -> DequeSolutionSet<T, Q>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, Q> SolutionSet<T, Q> for DequeSolutionSet<T, Q>
impl<T, Q> SolutionSet<T, Q> for DequeSolutionSet<T, Q>
Source§fn iter(&self) -> Box<dyn Iterator<Item = &Solution<T, Q>> + '_>
fn iter(&self) -> Box<dyn Iterator<Item = &Solution<T, Q>> + '_>
Returns an iterator over all solutions in the set.
Source§fn push_solution(&mut self, solution: Solution<T, Q>)
fn push_solution(&mut self, solution: Solution<T, Q>)
Appends one solution to the set.
Source§fn pop_solution(&mut self) -> Option<Solution<T, Q>>
fn pop_solution(&mut self) -> Option<Solution<T, Q>>
Removes one solution from the tail of the set semantics.
Source§fn clear_solutions(&mut self)
fn clear_solutions(&mut self)
Removes all solutions from the set.
Source§fn get_solution(&self, index: usize) -> Option<&Solution<T, Q>>
fn get_solution(&self, index: usize) -> Option<&Solution<T, Q>>
Returns one solution by index when indexable.
Source§fn get_solution_mut(&mut self, index: usize) -> Option<&mut Solution<T, Q>>
fn get_solution_mut(&mut self, index: usize) -> Option<&mut Solution<T, Q>>
Returns one mutable solution by index when indexable.
fn add_solution(&mut self, solution: Solution<T, Q>)
Source§fn remove_solution(&mut self) -> Option<Solution<T, Q>>
fn remove_solution(&mut self) -> Option<Solution<T, Q>>
Remove the last solution
fn best_solution<P>(&self, problem: &P) -> Option<&Solution<T, Q>>
fn best_solution_value<P>(&self, problem: &P) -> Option<f64>
fn best_solution_value_or<P>(&self, problem: &P, default: f64) -> f64
fn get(&self, index: usize) -> Option<&Solution<T, Q>>
fn get_mut(&mut self, index: usize) -> Option<&mut Solution<T, Q>>
Auto Trait Implementations§
impl<T, Q> Freeze for DequeSolutionSet<T, Q>
impl<T, Q> RefUnwindSafe for DequeSolutionSet<T, Q>where
Q: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Q> Send for DequeSolutionSet<T, Q>
impl<T, Q> Sync for DequeSolutionSet<T, Q>
impl<T, Q> Unpin for DequeSolutionSet<T, Q>
impl<T, Q> UnsafeUnpin for DequeSolutionSet<T, Q>
impl<T, Q> UnwindSafe for DequeSolutionSet<T, Q>where
Q: UnwindSafe,
T: UnwindSafe,
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