Struct lattice_qcd_rs::simulation::monte_carlo::hybrid::HybridMethodVec
source · pub struct HybridMethodVec<'a, State, E, const D: usize>where
State: LatticeState<D>,{ /* private fields */ }
Expand description
hybrid method that combine multiple methods. It requires that all methods return the same error.
You can use AdaptorMethodError
to convert the error.
If you want type with different error you can use HybridMethodCouple
.
Example
see level module example super
.
Implementations§
source§impl<'a, State, E, const D: usize> HybridMethodVec<'a, State, E, D>where
State: LatticeState<D>,
impl<'a, State, E, const D: usize> HybridMethodVec<'a, State, E, D>where State: LatticeState<D>,
sourcepub fn methods(&self) -> &Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
pub fn methods(&self) -> &Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
get the methods
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create an empty Self where the vector is preallocated for capacity
element.
sourcepub fn new(methods: Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>) -> Self
pub fn new(methods: Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>) -> Self
Create a new Self from a list of MonteCarlo
sourcepub fn methods_mut(
&mut self
) -> &mut Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
pub fn methods_mut( &mut self ) -> &mut Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
Get a mutable reference to the methods used,
sourcepub fn push_method(
&mut self,
mc_ref: &'a mut dyn MonteCarlo<State, D, Error = E>
)
pub fn push_method( &mut self, mc_ref: &'a mut dyn MonteCarlo<State, D, Error = E> )
Add a method at the end.
sourcepub fn pop_method(
&mut self
) -> Option<&'a mut dyn MonteCarlo<State, D, Error = E>>
pub fn pop_method( &mut self ) -> Option<&'a mut dyn MonteCarlo<State, D, Error = E>>
Remove a method at the end an returns it. Return None if the methods is empty.
Trait Implementations§
source§impl<'a, State, E, const D: usize> AsMut<Vec<&'a mut (dyn MonteCarlo<State, D, Error = E> + 'a), Global>> for HybridMethodVec<'a, State, E, D>where
State: LatticeState<D>,
impl<'a, State, E, const D: usize> AsMut<Vec<&'a mut (dyn MonteCarlo<State, D, Error = E> + 'a), Global>> for HybridMethodVec<'a, State, E, D>where State: LatticeState<D>,
source§fn as_mut(&mut self) -> &mut Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
fn as_mut(&mut self) -> &mut Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl<'a, State, E, const D: usize> AsRef<Vec<&'a mut (dyn MonteCarlo<State, D, Error = E> + 'a), Global>> for HybridMethodVec<'a, State, E, D>where
State: LatticeState<D>,
impl<'a, State, E, const D: usize> AsRef<Vec<&'a mut (dyn MonteCarlo<State, D, Error = E> + 'a), Global>> for HybridMethodVec<'a, State, E, D>where State: LatticeState<D>,
source§fn as_ref(&self) -> &Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
fn as_ref(&self) -> &Vec<&'a mut dyn MonteCarlo<State, D, Error = E>>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<'a, State, E, const D: usize> Default for HybridMethodVec<'a, State, E, D>where
State: LatticeState<D>,
impl<'a, State, E, const D: usize> Default for HybridMethodVec<'a, State, E, D>where State: LatticeState<D>,
source§impl<'a, State, E, const D: usize> MonteCarlo<State, D> for HybridMethodVec<'a, State, E, D>where
State: LatticeState<D>,
impl<'a, State, E, const D: usize> MonteCarlo<State, D> for HybridMethodVec<'a, State, E, D>where State: LatticeState<D>,
§type Error = HybridMethodVecError<E>
type Error = HybridMethodVecError<E>
Error returned while getting the next element.
Auto Trait Implementations§
impl<'a, State, E, const D: usize> !RefUnwindSafe for HybridMethodVec<'a, State, E, D>
impl<'a, State, E, const D: usize> !Send for HybridMethodVec<'a, State, E, D>
impl<'a, State, E, const D: usize> !Sync for HybridMethodVec<'a, State, E, D>
impl<'a, State, E, const D: usize> Unpin for HybridMethodVec<'a, State, E, D>
impl<'a, State, E, const D: usize> !UnwindSafe for HybridMethodVec<'a, State, E, D>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.