pub struct ICentralWorkspace { /* private fields */ }Expand description
| Stores the information used in one iteration | of iCentral | | Namely, \sigma \parents \delta \D \S both before | edge insertion and after edge insertion | | TODO study the effectiveness of storing | old/new | | TODO reconsider what to store and what | not to (after the iCentral is implemented) | | TODO reconsider the names of the structures |
Implementations§
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn clear_parents(&mut self)
pub fn clear_node_parents(&mut self, node: NodeId)
pub fn parents_for_node(&self, v_n: NodeId) -> Vec<NodeId>
pub fn num_parents_for_node(&self, v_n: NodeId) -> usize
pub fn set_single_parent(&mut self, node: NodeId, parent: NodeId)
pub fn set_parents_for_node(&mut self, node: NodeId, parents: Vec<NodeId>)
pub fn has_parent(&self, node: NodeId, candidate: NodeId) -> bool
pub fn add_parent(&mut self, node: NodeId, parent: NodeId)
pub fn reinit_parents(&mut self, len: usize)
pub fn fill_to_len(&mut self, len: usize, val: Vec<NodeId>)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn visited(&self, id: NodeId) -> bool
pub fn unvisited(&self, id: NodeId) -> bool
pub fn visit(&mut self, id: NodeId)
pub fn unvisit(&mut self, id: NodeId)
pub fn reinit_visit_markers(&mut self, len: usize)
pub fn fill_visit_markers(&mut self, val: bool)
pub fn fill_visit_markers_to_len(&mut self, len: usize, val: bool)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn distance_is_farther_away(&self, x: NodeId, y: NodeId) -> bool
pub fn distance_is_farther_than_one_away(&self, x: NodeId, y: NodeId) -> bool
pub fn distance_is_one_step_away(&self, x: NodeId, y: NodeId) -> bool
pub fn distance_is_infinite(&self, node: NodeId) -> bool
pub fn distance(&self, node: NodeId) -> f64
pub fn set_distance_for_node(&mut self, node: NodeId, val: f64)
pub fn set_distance_one_step_away(&mut self, dst: NodeId, src: NodeId)
pub fn set_distance_zero(&mut self, source: NodeId)
pub fn distance_reinit(&mut self, len: usize)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)
pub fn sigma_set_node_to_zero(&mut self, node: NodeId)
pub fn sigma_set_node_to_one(&mut self, node: NodeId)
pub fn increment_sigma_value_for_node(&mut self, v_n: NodeId, c_t: f64)
pub fn reinit_sigmas(&mut self, len: usize)
pub fn sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn fill_sigmas(&mut self, val: f64)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn new_sigmas_sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)
pub fn new_sigmas_sigma_set_node_to_zero(&mut self, node: NodeId)
pub fn new_sigmas_sigma_set_node_to_one(&mut self, node: NodeId)
pub fn new_sigmas_sigma_value_for_node(&self, node: NodeId) -> f64
pub fn new_sigmas_set_sigma_value_for_node(&mut self, node: NodeId, val: f64)
pub fn new_sigmas_increment_sigma_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn reinit_new_sigmas(&mut self, len: usize)
pub fn new_sigmas_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn new_sigmas_fill_sigmas(&mut self, val: f64)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn inc_sigmas_sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)
pub fn inc_sigmas_sigma_set_node_to_zero(&mut self, node: NodeId)
pub fn inc_sigmas_sigma_set_node_to_one(&mut self, node: NodeId)
pub fn inc_sigmas_sigma_value_for_node(&self, node: NodeId) -> f64
pub fn inc_sigmas_set_sigma_value_for_node(&mut self, node: NodeId, val: f64)
pub fn inc_sigmas_increment_sigma_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn reinit_inc_sigmas(&mut self, len: usize)
pub fn inc_sigmas_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn inc_sigmas_fill_sigmas(&mut self, val: f64)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn update_delta_value(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)
pub fn set_delta_value_to_zero(&mut self, node: NodeId)
pub fn set_delta_value_to_one(&mut self, node: NodeId)
pub fn delta_value_for_node(&self, node: NodeId) -> f64
pub fn set_delta_value_for_node(&mut self, node: NodeId, val: f64)
pub fn increment_delta_value_for_node(&mut self, v_n: NodeId, c_t: f64)
pub fn attenuate_delta_value_for_node(&mut self, v_n: NodeId, c_t: f64)
pub fn delta_reinit(&mut self, len: usize)
pub fn delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn deltas_fill_to_len(&mut self, len: usize, val: f64)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn new_deltas_update_delta_value( &mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64, )
pub fn new_deltas_set_delta_value_to_zero(&mut self, node: NodeId)
pub fn new_deltas_set_delta_value_to_one(&mut self, node: NodeId)
pub fn new_deltas_delta_value_for_node(&self, node: NodeId) -> f64
pub fn new_deltas_set_delta_value_for_node(&mut self, node: NodeId, val: f64)
pub fn new_deltas_increment_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn new_deltas_attenuate_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn new_deltas_delta_reinit(&mut self, len: usize)
pub fn new_deltas_delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn new_deltas_deltas_fill_to_len(&mut self, len: usize, val: f64)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn capital_deltas_update_delta_value( &mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64, )
pub fn capital_deltas_set_delta_value_to_zero(&mut self, node: NodeId)
pub fn capital_deltas_set_delta_value_to_one(&mut self, node: NodeId)
pub fn capital_deltas_delta_value_for_node(&self, node: NodeId) -> f64
pub fn capital_deltas_set_delta_value_for_node( &mut self, node: NodeId, val: f64, )
pub fn capital_deltas_increment_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn capital_deltas_attenuate_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn capital_deltas_delta_reinit(&mut self, len: usize)
pub fn capital_deltas_delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn capital_deltas_deltas_fill_to_len(&mut self, len: usize, val: f64)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn new_capital_deltas_update_delta_value( &mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64, )
pub fn new_capital_deltas_set_delta_value_to_zero(&mut self, node: NodeId)
pub fn new_capital_deltas_set_delta_value_to_one(&mut self, node: NodeId)
pub fn new_capital_deltas_delta_value_for_node(&self, node: NodeId) -> f64
pub fn new_capital_deltas_set_delta_value_for_node( &mut self, node: NodeId, val: f64, )
pub fn new_capital_deltas_increment_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn new_capital_deltas_attenuate_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )
pub fn new_capital_deltas_delta_reinit(&mut self, len: usize)
pub fn new_capital_deltas_delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn new_capital_deltas_deltas_fill_to_len(&mut self, len: usize, val: f64)
Source§impl ICentralWorkspace
impl ICentralWorkspace
pub fn new_sigmas(&self) -> &SigmaMap
pub fn sigmas(&self) -> &SigmaMap
pub fn set_new_sigmas_from(&mut self, other: &SigmaMap)
Sourcepub fn fix_order_of_workspace_stack(&mut self)
pub fn fix_order_of_workspace_stack(&mut self)
fix order of workspace.stack
IMP::THIS CAN BE MADE much BETTER!
HEAP FOR EXAMPLE
EVEN THE SWAPPING CAN BE DONE MORE EFFICIENTLY
for now it’s not a bottleneck
pub fn compute_new_path_counts_and_paths(&mut self, src: NodeId, dst: NodeId)
pub fn update_for_partial_bbfs_addition( &mut self, queue: &mut NodeIdQueue, w: NodeId, v: NodeId, )
pub fn deltas(&self) -> &DeltaMap
pub fn get_new_delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn set_deltas_from_new_deltas(&mut self)
pub fn set_sigmas_from_other(&mut self, new: &SigmaMap)
pub fn get_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn get_new_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64
pub fn update_new_capital_deltas_with_new_delta_ratio( &mut self, v_p: NodeId, v_n: NodeId, )
pub fn update_new_capital_deltas_with_new_sigma_ratio( &mut self, v_p: NodeId, v_n: NodeId, )
pub fn update_new_deltas_with_new_delta_ratio( &mut self, v_p: NodeId, v_n: NodeId, )
pub fn update_new_deltas_with_new_sigma_ratio( &mut self, v_p: NodeId, v_n: NodeId, )
pub fn maybe_update_capital_deltas( &mut self, component: &Component, source: NodeId, v_p: NodeId, v_n: NodeId, )
pub fn maybe_update_new_capital_deltas( &mut self, component: &Component, source: NodeId, v_p: NodeId, v_n: NodeId, )
pub fn update_capital_deltas(&mut self, v_p: NodeId, v_n: NodeId)
pub fn update_deltas_for_each_p( &mut self, component: &Component, source: NodeId, v_n: NodeId, )
pub fn update_all_deltas_for_component( &mut self, component: &Component, source: NodeId, v_p: NodeId, v_n: NodeId, )
pub fn update_deltas(&mut self, v_p: NodeId, v_n: NodeId)
pub fn maybe_update_capital_deltas_for_component( &mut self, component: &Component, source: NodeId, v_n: NodeId, )
pub fn update_both_capital_deltas_for_component( &mut self, component: &Component, source: NodeId, v_n: NodeId, )
pub fn process_outer_layer_neighbor( &mut self, bc_mem: &mut BcMemWorkspace, neighbor: NodeId, queue: &mut NodeIdQueue, v: NodeId, ) -> Result<(), BetweennessCentralityError>
pub fn process_first_layer_neighbor( &mut self, bc_mem: &mut BcMemWorkspace, neighbor: NodeId, queue: &mut NodeIdQueue, v: NodeId, ) -> Result<(), BetweennessCentralityError>
pub fn attenuate_deltas(&mut self, src: NodeId, dst: NodeId)
pub fn calculate_deltas_step_with_sigma_ratio( &self, sigma_ratio: f64, w: NodeId, ) -> f64
pub fn calculate_deltas_step(&self, v: NodeId, w: NodeId) -> f64
pub fn update_delta_bc_of_vertices_for_node( &self, w: NodeId, delta_bc_of_vertices: &mut BetweennessScores, )
pub fn refill_deltass(&mut self, len: usize)
Trait Implementations§
Source§impl Clone for ICentralWorkspace
impl Clone for ICentralWorkspace
Source§fn clone(&self) -> ICentralWorkspace
fn clone(&self) -> ICentralWorkspace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CreateNamedEmpty for ICentralWorkspace
impl CreateNamedEmpty for ICentralWorkspace
Source§impl Debug for ICentralWorkspace
impl Debug for ICentralWorkspace
Source§impl Default for ICentralWorkspace
impl Default for ICentralWorkspace
Source§impl GetSigmaValueForNode for ICentralWorkspace
impl GetSigmaValueForNode for ICentralWorkspace
fn sigma_value_for_node(&self, node: NodeId) -> f64
Source§impl SetSigmaValueForNode for ICentralWorkspace
impl SetSigmaValueForNode for ICentralWorkspace
fn set_sigma_value_for_node(&mut self, node: NodeId, val: f64)
Auto Trait Implementations§
impl Freeze for ICentralWorkspace
impl RefUnwindSafe for ICentralWorkspace
impl Send for ICentralWorkspace
impl Sync for ICentralWorkspace
impl Unpin for ICentralWorkspace
impl UnwindSafe for ICentralWorkspace
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PoisonMessage for Twhere
T: Debug,
impl<T> PoisonMessage for Twhere
T: Debug,
fn poison_message(&self) -> String
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.