pub struct DenseMatrix<T> { /* private fields */ }Implementations§
Source§impl<T> DenseMatrix<T>
impl<T> DenseMatrix<T>
Sourcepub fn try_new(node_count: usize) -> Result<Self>
pub fn try_new(node_count: usize) -> Result<Self>
Creates a fixed-size directed adjacency matrix.
§Errors
Returns an error when the dimensions exceed index or address capacity.
pub const fn node_count(&self) -> usize
pub const fn edge_count(&self) -> usize
pub fn get(&self, source: NodeIndex, target: NodeIndex) -> Option<&T>
pub fn get_mut( &mut self, source: NodeIndex, target: NodeIndex, ) -> Option<&mut T>
Sourcepub fn insert(
&mut self,
source: NodeIndex,
target: NodeIndex,
value: T,
) -> Result<Option<T>>
pub fn insert( &mut self, source: NodeIndex, target: NodeIndex, value: T, ) -> Result<Option<T>>
Inserts or replaces one directed edge value.
§Errors
Returns an error when either endpoint is outside the fixed matrix.
pub fn remove(&mut self, source: NodeIndex, target: NodeIndex) -> Option<T>
pub fn outgoing( &self, source: NodeIndex, ) -> impl Iterator<Item = (NodeIndex, &T)>
pub fn incoming( &self, target: NodeIndex, ) -> impl Iterator<Item = (NodeIndex, &T)>
pub fn edges(&self) -> impl Iterator<Item = (NodeIndex, NodeIndex, &T)>
Trait Implementations§
Source§impl<T: Clone> Clone for DenseMatrix<T>
impl<T: Clone> Clone for DenseMatrix<T>
Source§fn clone(&self) -> DenseMatrix<T>
fn clone(&self) -> DenseMatrix<T>
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<T: Debug> Debug for DenseMatrix<T>
impl<T: Debug> Debug for DenseMatrix<T>
Source§impl<'de, T> Deserialize<'de> for DenseMatrix<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for DenseMatrix<T>where
T: Deserialize<'de>,
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<T: Eq> Eq for DenseMatrix<T>
Source§impl<T: PartialEq> PartialEq for DenseMatrix<T>
impl<T: PartialEq> PartialEq for DenseMatrix<T>
Source§impl<T> Serialize for DenseMatrix<T>where
T: Serialize,
impl<T> Serialize for DenseMatrix<T>where
T: Serialize,
impl<T: PartialEq> StructuralPartialEq for DenseMatrix<T>
Auto Trait Implementations§
impl<T> Freeze for DenseMatrix<T>
impl<T> RefUnwindSafe for DenseMatrix<T>where
T: RefUnwindSafe,
impl<T> Send for DenseMatrix<T>where
T: Send,
impl<T> Sync for DenseMatrix<T>where
T: Sync,
impl<T> Unpin for DenseMatrix<T>where
T: Unpin,
impl<T> UnsafeUnpin for DenseMatrix<T>
impl<T> UnwindSafe for DenseMatrix<T>where
T: UnwindSafe,
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