pub struct BitMatrix { /* private fields */ }Implementations§
Source§impl BitMatrix
impl BitMatrix
Sourcepub fn try_new(node_count: usize) -> Result<Self>
pub fn try_new(node_count: usize) -> Result<Self>
Creates an empty directed bit-packed adjacency matrix.
§Errors
Returns an error when its dimensions exceed index or address capacity.
pub const fn node_count(&self) -> usize
pub const fn edge_count(&self) -> usize
pub fn storage_bytes(&self) -> usize
pub fn contains(&self, source: NodeIndex, target: NodeIndex) -> bool
Sourcepub fn insert(&mut self, source: NodeIndex, target: NodeIndex) -> Result<bool>
pub fn insert(&mut self, source: NodeIndex, target: NodeIndex) -> Result<bool>
Inserts one directed edge and reports whether it was new.
§Errors
Returns an error when either endpoint is outside the matrix.
Sourcepub fn insert_undirected(
&mut self,
left: NodeIndex,
right: NodeIndex,
) -> Result<usize>
pub fn insert_undirected( &mut self, left: NodeIndex, right: NodeIndex, ) -> Result<usize>
Inserts both directions of one undirected relation.
§Errors
Returns an error when either endpoint is outside the matrix.
pub fn remove(&mut self, source: NodeIndex, target: NodeIndex) -> bool
pub fn outgoing( &self, source: NodeIndex, ) -> impl Iterator<Item = NodeIndex> + '_
pub fn incoming( &self, target: NodeIndex, ) -> impl Iterator<Item = NodeIndex> + '_
pub fn edges(&self) -> impl Iterator<Item = EdgeEndpoints> + '_
Sourcepub fn to_topology(&self) -> Result<Topology>
pub fn to_topology(&self) -> Result<Topology>
Materializes a compact dual-CSR topology.
§Errors
Returns an error only if the matrix violates topology capacity.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BitMatrix
impl<'de> Deserialize<'de> for BitMatrix
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for BitMatrix
impl StructuralPartialEq for BitMatrix
Auto Trait Implementations§
impl Freeze for BitMatrix
impl RefUnwindSafe for BitMatrix
impl Send for BitMatrix
impl Sync for BitMatrix
impl Unpin for BitMatrix
impl UnsafeUnpin for BitMatrix
impl UnwindSafe for BitMatrix
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