pub struct Graph {
pub first_out: Vec<u32>,
pub head: Vec<u32>,
pub weight: Vec<u32>,
}Expand description
A directed, weighted graph stored in Compressed-Sparse-Row format.
Invariants (caller-enforced at construction time):
first_out.len() == node_count + 1head.len() == arc_countandweight.len() == arc_countfirst_outis non-decreasing;first_out[0] == 0;first_out[node_count] == arc_count
Fields§
§first_out: Vec<u32>CSR row-pointer array; length node_count + 1.
head: Vec<u32>Arc target nodes; length arc_count.
weight: Vec<u32>Arc weights; length arc_count.
Implementations§
Trait Implementations§
impl Eq for Graph
impl StructuralPartialEq for Graph
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
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