pub struct GraphBuilder<W: Debug + Default + Clone, N: Debug + Default + Clone> { /* private fields */ }
Implementations§
Source§impl<W: Debug + Default + Clone + AddAssign<W>, N: Debug + Default + Clone> GraphBuilder<W, N>
impl<W: Debug + Default + Clone + AddAssign<W>, N: Debug + Default + Clone> GraphBuilder<W, N>
pub fn new() -> GraphBuilder<W, N>
Sourcepub fn restore(&mut self) -> bool
pub fn restore(&mut self) -> bool
Restore a previously saved state. Returns false, if no saved state exists on the stack.
pub fn count_nodes(&self) -> usize
pub fn visit_nodes<F: FnMut(usize, &N)>(&self, callback: F)
pub fn visit_edges<F: FnMut((usize, usize), &W)>(&self, callback: F)
pub fn to_edge_list(&self) -> Vec<Option<(N, Vec<(usize, W)>)>>
pub fn apply_operation<NT: NthEdge>(&mut self, op: EdgeOperation<W, N, NT>)where
W: Neg<Output = W>,
Sourcepub fn update_edge_weight(&mut self, weight: W)
pub fn update_edge_weight(&mut self, weight: W)
decrease-weight or increase-weight, depending on the sign of the weight. Updates the weight of the current edge, or in case of a virtual edge, creates a new edge with that weight.
Sourcepub fn add_self_loop(&mut self, weight: W)
pub fn add_self_loop(&mut self, weight: W)
Adds a loop to the current edge’s target neuron.
Trait Implementations§
Auto Trait Implementations§
impl<W, N> Freeze for GraphBuilder<W, N>
impl<W, N> RefUnwindSafe for GraphBuilder<W, N>where
N: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, N> Send for GraphBuilder<W, N>
impl<W, N> Sync for GraphBuilder<W, N>
impl<W, N> Unpin for GraphBuilder<W, N>where
N: Unpin,
impl<W, N> UnwindSafe for GraphBuilder<W, N>where
W: RefUnwindSafe,
N: 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