pub struct Graph {
pub cap_stats: EdgeCapStats,
/* private fields */
}Fields§
§cap_stats: EdgeCapStatsImplementations§
Source§impl Graph
impl Graph
pub fn new() -> Self
pub fn edge_category( &self, src: &FragmentId, dst: &FragmentId, ) -> Option<EdgeCategory>
pub fn for_each_categorized_edge<F: FnMut(&FragmentId, &FragmentId, EdgeCategory)>( &self, f: F, )
pub fn insert_edge_category( &mut self, src: FragmentId, dst: FragmentId, cat: EdgeCategory, )
pub fn categorized_edge_count(&self) -> usize
pub fn add_node(&mut self, node: FragmentId)
pub fn add_edge(&mut self, src: FragmentId, dst: FragmentId, weight: f64)
pub fn node_count(&self) -> usize
pub fn nodes(&self) -> impl Iterator<Item = &FragmentId>
pub fn edge_count(&self) -> usize
Sourcepub fn freeze(&mut self)
pub fn freeze(&mut self)
Convert the build-time hashmap representation into CSR and drop the hashmaps. After freeze, fwd/rev are empty and all reads go through CSR.
pub fn to_csr(&mut self) -> &(CsrGraph, CsrGraph)
pub fn fwd_csr(&self) -> Option<&CsrGraph>
pub fn rev_csr(&self) -> Option<&CsrGraph>
Sourcepub fn forward_edge_weight(
&self,
src: &FragmentId,
dst: &FragmentId,
) -> Option<f64>
pub fn forward_edge_weight( &self, src: &FragmentId, dst: &FragmentId, ) -> Option<f64>
Look up the weight of edge src -> dst in the forward CSR.
Sourcepub fn for_each_forward_neighbor<F: FnMut(&FragmentId, f64)>(
&self,
node: &FragmentId,
f: F,
)
pub fn for_each_forward_neighbor<F: FnMut(&FragmentId, f64)>( &self, node: &FragmentId, f: F, )
Invoke f(neighbor_id, weight) for each forward neighbor of node.
pub fn ego_graph( &self, seeds: &FxHashSet<FragmentId>, radius: usize, ) -> FxHashMap<FragmentId, f64>
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more