pub struct AdjacencyMatrix {
pub n: usize,
pub mat: Vec<bool>,
}Expand description
Unweighted graph stored as a dense row-major boolean matrix.
Fields§
§n: usize§mat: Vec<bool>Implementations§
Source§impl AdjacencyMatrix
impl AdjacencyMatrix
Sourcepub fn set(&mut self, u: usize, v: usize, value: bool) -> GraphalgResult<()>
pub fn set(&mut self, u: usize, v: usize, value: bool) -> GraphalgResult<()>
Set the directed edge u -> v to value.
Sourcepub fn add_undirected_edge(&mut self, u: usize, v: usize) -> GraphalgResult<()>
pub fn add_undirected_edge(&mut self, u: usize, v: usize) -> GraphalgResult<()>
Add an undirected edge (u, v).
Trait Implementations§
Source§impl Clone for AdjacencyMatrix
impl Clone for AdjacencyMatrix
Source§fn clone(&self) -> AdjacencyMatrix
fn clone(&self) -> AdjacencyMatrix
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AdjacencyMatrix
impl RefUnwindSafe for AdjacencyMatrix
impl Send for AdjacencyMatrix
impl Sync for AdjacencyMatrix
impl Unpin for AdjacencyMatrix
impl UnsafeUnpin for AdjacencyMatrix
impl UnwindSafe for AdjacencyMatrix
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