Struct Graph

Source
pub struct Graph { /* private fields */ }

Implementations§

Source§

impl Graph

Source

pub fn new(n: u64, weighted: bool, directed: bool, edges_indexed: bool) -> Self

Source

pub fn add_edge( &mut self, u: u64, v: u64, ew: Option<f64>, check_multi_edge: bool, ) -> bool

Source

pub fn add_node(&mut self) -> u64

Source

pub fn add_nodes(&mut self, number_of_new_nodes: u64) -> u64

Source

pub fn check_consistency(&self) -> bool

Source

pub fn compact_edges(&mut self)

Source

pub unsafe fn degree_unchecked(&self, v: u64) -> u64

Source

pub fn degree(&self, v: u64) -> Result<u64>

Source

pub unsafe fn degree_in_unchecked(&self, v: u64) -> u64

Source

pub fn degree_in(&self, v: u64) -> Result<u64>

Source

pub unsafe fn degree_out_unchecked(&self, v: u64) -> u64

Source

pub fn degree_out(&self, v: u64) -> Result<u64>

Source

pub fn edge_id(&self, u: u64, v: u64) -> Result<u64>

Source

pub fn has_edge(&self, u: u64, v: u64) -> bool

Source

pub fn has_edge_ids(&self) -> bool

Source

pub fn has_node(&self, v: u64) -> bool

Source

pub unsafe fn increase_weight_unchecked( &mut self, u: u64, v: u64, ew: f64, ) -> Result<()>

Source

pub fn increase_weight(&mut self, u: u64, v: u64, ew: f64) -> Result<()>

Source

pub fn index_edges(&mut self, force: bool)

Source

pub fn is_directed(&self) -> bool

Source

pub unsafe fn is_isolated_unchecked(&self, u: u64) -> Result<bool>

Source

pub fn is_isolated(&self, u: u64) -> Result<bool>

Source

pub fn is_weighted(&self) -> bool

Source

pub fn number_of_edges(&self) -> u64

Source

pub fn number_of_nodes(&self) -> u64

Source

pub fn number_of_self_loops(&self) -> u64

Source

pub fn remove_all_edges(&mut self)

Source

pub fn remove_edge(&mut self, u: u64, v: u64) -> Result<()>

Source

pub fn remove_multi_edges(&mut self)

Source

pub unsafe fn remove_node_unchecked(&mut self, u: u64)

Source

pub fn remove_node(&mut self, u: u64) -> Result<()>

Source

pub fn remove_self_loops(&mut self)

Source

pub unsafe fn restore_node_unchecked(&mut self, u: u64)

Source

pub fn restore_node(&mut self, u: u64) -> Result<()>

Source

pub unsafe fn set_weight_unchecked( &mut self, u: u64, v: u64, ew: f64, ) -> Result<()>

Source

pub fn set_weight(&mut self, u: u64, v: u64, ew: f64) -> Result<()>

Source

pub fn sort_edges(&mut self)

Source

pub unsafe fn swap_edge_unchecked(&mut self, s1: u64, t1: u64, s2: u64, t2: u64)

Source

pub fn swap_edge(&mut self, s1: u64, t1: u64, s2: u64, t2: u64) -> Result<()>

Source

pub fn total_edge_weight(&self) -> f64

Source

pub fn upper_edge_id_bound(&self) -> u64

Source

pub fn upper_node_id_bound(&self) -> u64

Source

pub unsafe fn weight_unchecked(&self, u: u64, v: u64) -> f64

Source

pub fn weight(&self, u: u64, v: u64) -> Result<f64>

Source

pub unsafe fn weighted_degree_unchecked( self: &Graph, u: u64, count_self_loops_twice: bool, ) -> f64

Source

pub fn weighted_degree( &self, u: u64, count_self_loops_twice: bool, ) -> Result<f64>

Source

pub unsafe fn weighted_degree_in_unchecked( self: &Graph, u: u64, count_self_loops_twice: bool, ) -> f64

Source

pub fn weighted_degree_in( &self, u: u64, count_self_loops_twice: bool, ) -> Result<f64>

Source

pub fn iter_nodes<'a>(&'a self) -> impl Iterator<Item = u64> + 'a

Source

pub fn iter_edges<'a>(&'a self) -> impl Iterator<Item = (u64, u64)> + 'a

Source

pub fn iter_edges_weight<'a>( &'a self, ) -> impl Iterator<Item = (u64, u64, f64)> + 'a

Source

pub fn iter_neighbours<'a>( &'a self, u: u64, ) -> Result<impl Iterator<Item = u64> + 'a>

Source

pub fn iter_in_neighbours<'a>( &'a self, u: u64, ) -> Result<impl Iterator<Item = u64> + 'a>

Source

pub fn iter_neighbours_weight<'a>( &'a self, u: u64, ) -> Result<impl Iterator<Item = (u64, f64)> + 'a>

Source

pub fn iter_in_neighbours_weight<'a>( &'a self, u: u64, ) -> Result<impl Iterator<Item = (u64, f64)> + 'a>

Trait Implementations§

Source§

impl Clone for Graph

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for Graph

Source§

type Target = Graph

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<UniquePtr<Graph>> for Graph

Source§

fn from(value: UniquePtr<Graph>) -> Self

Converts to this type from the input type.
Source§

impl Send for Graph

Auto Trait Implementations§

§

impl Freeze for Graph

§

impl RefUnwindSafe for Graph

§

impl !Sync for Graph

§

impl Unpin for Graph

§

impl UnwindSafe for Graph

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.