Enum net_ensembles::er_c::ErStepC
source · [−]pub enum ErStepC {
Nothing,
AddedEdge((usize, usize)),
RemovedEdge((usize, usize)),
GError(GraphErrors),
}
Expand description
Variants
Nothing
nothing was changed
AddedEdge((usize, usize))
an edge was added
RemovedEdge((usize, usize))
an edge was removed
GError(GraphErrors)
a GraphError occured and is wrapped here
Implementations
sourceimpl ErStepC
impl ErStepC
sourcepub fn valid_or_panic(&self)
pub fn valid_or_panic(&self)
panic!
if self
is GError
variant
sourcepub fn valid_or_panic_msg(&self, msg: &str)
pub fn valid_or_panic_msg(&self, msg: &str)
panic!(msg)
if self
is GError
variant
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ErStepC
impl<'de> Deserialize<'de> for ErStepC
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T, R> MarkovChain<ErStepC, ErStepC> for ErEnsembleC<T, R>where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> MarkovChain<ErStepC, ErStepC> for ErEnsembleC<T, R>where
T: Node + SerdeStateConform,
R: Rng,
sourcefn m_step(&mut self) -> ErStepC
fn m_step(&mut self) -> ErStepC
Markov step
- use this to perform a markov step, e.g., to create a markov chain
- result
ErStepC
can be used to undo the step withself.undo_step(result)
sourcefn undo_step(&mut self, step: &ErStepC) -> ErStepC
fn undo_step(&mut self, step: &ErStepC) -> ErStepC
Undo a markcov step
- adds removed edge, or removes added edge, or does nothing
- if it returns an Err value, you probably used the function wrong
Important:
Restored graph is the same as before the random step except the order of nodes in the adjacency list might be shuffled!
sourcefn undo_step_quiet(&mut self, step: &ErStepC)
fn undo_step_quiet(&mut self, step: &ErStepC)
Undo a markov step
- adds removed edge, or removes added edge, or does nothing
- if it returns an Err value, you probably used the function wrong
Important:
Restored graph is the same as before the random step except the order of nodes in the adjacency list might be shuffled!
sourcefn m_steps_quiet(&mut self, count: usize)
fn m_steps_quiet(&mut self, count: usize)
Markov steps without return Read more
sourcefn m_step_acc<Acc, AccFn>(&mut self, acc: &mut Acc, acc_fn: AccFn) -> Swhere
AccFn: FnMut(&Self, &S, &mut Acc),
fn m_step_acc<Acc, AccFn>(&mut self, acc: &mut Acc, acc_fn: AccFn) -> Swhere
AccFn: FnMut(&Self, &S, &mut Acc),
Accumulating markov step Read more
sourcefn m_steps_acc<Acc, AccFn>(
&mut self,
count: usize,
steps: &mut Vec<S, Global>,
acc: &mut Acc,
acc_fn: AccFn
)where
AccFn: FnMut(&Self, &S, &mut Acc),
fn m_steps_acc<Acc, AccFn>(
&mut self,
count: usize,
steps: &mut Vec<S, Global>,
acc: &mut Acc,
acc_fn: AccFn
)where
AccFn: FnMut(&Self, &S, &mut Acc),
Accumulating markov steps Read more
sourcefn m_steps_acc_quiet<Acc, AccFn>(
&mut self,
count: usize,
acc: &mut Acc,
acc_fn: AccFn
)where
AccFn: FnMut(&Self, &S, &mut Acc),
fn m_steps_acc_quiet<Acc, AccFn>(
&mut self,
count: usize,
acc: &mut Acc,
acc_fn: AccFn
)where
AccFn: FnMut(&Self, &S, &mut Acc),
Accumulating markov steps Read more
sourcefn undo_steps_quiet(&mut self, steps: &[S])
fn undo_steps_quiet(&mut self, steps: &[S])
Undo markov steps Read more
sourcefn steps_accepted(&mut self, _steps: &[S])
fn steps_accepted(&mut self, _steps: &[S])
Function called whenever the steps are accepted. Read more
sourcefn steps_rejected(&mut self, _steps: &[S])
fn steps_rejected(&mut self, _steps: &[S])
Function called whenever the steps are rejected. Read more
impl Copy for ErStepC
Auto Trait Implementations
impl RefUnwindSafe for ErStepC
impl Send for ErStepC
impl Sync for ErStepC
impl Unpin for ErStepC
impl UnwindSafe for ErStepC
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
fn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
fn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more