pub struct TransitiveClosure {
pub n: usize,
/* private fields */
}Expand description
Dense boolean reachability relation for an n-vertex digraph.
The matrix is stored row-major: entry (u, v) lives at index u * n + v.
Fields§
§n: usizeNumber of vertices.
Implementations§
Source§impl TransitiveClosure
impl TransitiveClosure
Sourcepub fn reachable(&self, u: usize, v: usize) -> GraphalgResult<bool>
pub fn reachable(&self, u: usize, v: usize) -> GraphalgResult<bool>
Is v reachable from u? Returns GraphalgError::IndexOutOfBounds if
either index is >= n.
Sourcepub fn matrix(&self) -> &[bool]
pub fn matrix(&self) -> &[bool]
Borrow the underlying row-major reachability matrix (n * n bits).
Sourcepub fn is_reflexive(&self) -> bool
pub fn is_reflexive(&self) -> bool
Whether this closure was built with the reflexive diagonal forced on.
Trait Implementations§
Source§impl Clone for TransitiveClosure
impl Clone for TransitiveClosure
Source§fn clone(&self) -> TransitiveClosure
fn clone(&self) -> TransitiveClosure
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 moreSource§impl Debug for TransitiveClosure
impl Debug for TransitiveClosure
impl Eq for TransitiveClosure
Source§impl PartialEq for TransitiveClosure
impl PartialEq for TransitiveClosure
Source§fn eq(&self, other: &TransitiveClosure) -> bool
fn eq(&self, other: &TransitiveClosure) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TransitiveClosure
Auto Trait Implementations§
impl Freeze for TransitiveClosure
impl RefUnwindSafe for TransitiveClosure
impl Send for TransitiveClosure
impl Sync for TransitiveClosure
impl Unpin for TransitiveClosure
impl UnsafeUnpin for TransitiveClosure
impl UnwindSafe for TransitiveClosure
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