pub struct GreedyForestPacking {
pub num_forests: usize,
/* private fields */
}Expand description
Greedy forest packing structure
Fields§
§num_forests: usizeNumber of forests
Implementations§
Source§impl GreedyForestPacking
impl GreedyForestPacking
Sourcepub fn new(num_forests: usize) -> Self
pub fn new(num_forests: usize) -> Self
Create new forest packing with k forests Per paper: k = 6λ_max · log m / ε²
Sourcepub fn insert_edge(&mut self, u: VertexId, v: VertexId) -> Option<usize>
pub fn insert_edge(&mut self, u: VertexId, v: VertexId) -> Option<usize>
Insert edge greedily into first available forest
Sourcepub fn delete_edge(&mut self, u: VertexId, v: VertexId) -> Option<usize>
pub fn delete_edge(&mut self, u: VertexId, v: VertexId) -> Option<usize>
Delete edge from its forest
Sourcepub fn is_tree_edge(&self, u: VertexId, v: VertexId) -> bool
pub fn is_tree_edge(&self, u: VertexId, v: VertexId) -> bool
Check if edge is a tree edge in some forest
Trait Implementations§
Source§impl Clone for GreedyForestPacking
impl Clone for GreedyForestPacking
Source§fn clone(&self) -> GreedyForestPacking
fn clone(&self) -> GreedyForestPacking
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GreedyForestPacking
impl RefUnwindSafe for GreedyForestPacking
impl Send for GreedyForestPacking
impl Sync for GreedyForestPacking
impl Unpin for GreedyForestPacking
impl UnwindSafe for GreedyForestPacking
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more