ICentralWorkspace

Struct ICentralWorkspace 

Source
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

Source

pub fn clear_parents(&mut self)

Source

pub fn clear_node_parents(&mut self, node: NodeId)

Source

pub fn parents_for_node(&self, v_n: NodeId) -> Vec<NodeId>

Source

pub fn num_parents_for_node(&self, v_n: NodeId) -> usize

Source

pub fn set_single_parent(&mut self, node: NodeId, parent: NodeId)

Source

pub fn set_parents_for_node(&mut self, node: NodeId, parents: Vec<NodeId>)

Source

pub fn has_parent(&self, node: NodeId, candidate: NodeId) -> bool

Source

pub fn add_parent(&mut self, node: NodeId, parent: NodeId)

Source

pub fn reinit_parents(&mut self, len: usize)

Source

pub fn fill_to_len(&mut self, len: usize, val: Vec<NodeId>)

Source§

impl ICentralWorkspace

Source

pub fn visited(&self, id: NodeId) -> bool

Source

pub fn unvisited(&self, id: NodeId) -> bool

Source

pub fn visit(&mut self, id: NodeId)

Source

pub fn unvisit(&mut self, id: NodeId)

Source

pub fn reinit_visit_markers(&mut self, len: usize)

Source

pub fn fill_visit_markers(&mut self, val: bool)

Source

pub fn fill_visit_markers_to_len(&mut self, len: usize, val: bool)

Source§

impl ICentralWorkspace

Source

pub fn stack_push(&mut self, n: NodeId)

Source

pub fn stack_pop(&mut self) -> Option<NodeId>

Source

pub fn stack_len(&self) -> usize

Source

pub fn stack_node_at_index(&self, idx: usize) -> NodeId

Source

pub fn stack_set_node_at_index(&mut self, idx: usize, n: NodeId)

Source§

impl ICentralWorkspace

Source

pub fn distance_is_farther_away(&self, x: NodeId, y: NodeId) -> bool

Source

pub fn distance_is_farther_than_one_away(&self, x: NodeId, y: NodeId) -> bool

Source

pub fn distance_is_one_step_away(&self, x: NodeId, y: NodeId) -> bool

Source

pub fn distance_is_infinite(&self, node: NodeId) -> bool

Source

pub fn distance(&self, node: NodeId) -> f64

Source

pub fn set_distance_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn set_distance_one_step_away(&mut self, dst: NodeId, src: NodeId)

Source

pub fn set_distance_zero(&mut self, source: NodeId)

Source

pub fn distance_reinit(&mut self, len: usize)

Source§

impl ICentralWorkspace

Source

pub fn sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)

Source

pub fn sigma_set_node_to_zero(&mut self, node: NodeId)

Source

pub fn sigma_set_node_to_one(&mut self, node: NodeId)

Source

pub fn increment_sigma_value_for_node(&mut self, v_n: NodeId, c_t: f64)

Source

pub fn reinit_sigmas(&mut self, len: usize)

Source

pub fn sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn fill_sigmas(&mut self, val: f64)

Source§

impl ICentralWorkspace

Source

pub fn new_sigmas_sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)

Source

pub fn new_sigmas_sigma_set_node_to_zero(&mut self, node: NodeId)

Source

pub fn new_sigmas_sigma_set_node_to_one(&mut self, node: NodeId)

Source

pub fn new_sigmas_sigma_value_for_node(&self, node: NodeId) -> f64

Source

pub fn new_sigmas_set_sigma_value_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn new_sigmas_increment_sigma_value_for_node( &mut self, v_n: NodeId, c_t: f64, )

Source

pub fn reinit_new_sigmas(&mut self, len: usize)

Source

pub fn new_sigmas_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn new_sigmas_fill_sigmas(&mut self, val: f64)

Source§

impl ICentralWorkspace

Source

pub fn inc_sigmas_sigma_update(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)

Source

pub fn inc_sigmas_sigma_set_node_to_zero(&mut self, node: NodeId)

Source

pub fn inc_sigmas_sigma_set_node_to_one(&mut self, node: NodeId)

Source

pub fn inc_sigmas_sigma_value_for_node(&self, node: NodeId) -> f64

Source

pub fn inc_sigmas_set_sigma_value_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn inc_sigmas_increment_sigma_value_for_node( &mut self, v_n: NodeId, c_t: f64, )

Source

pub fn reinit_inc_sigmas(&mut self, len: usize)

Source

pub fn inc_sigmas_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn inc_sigmas_fill_sigmas(&mut self, val: f64)

Source§

impl ICentralWorkspace

Source

pub fn update_delta_value(&mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64)

Source

pub fn set_delta_value_to_zero(&mut self, node: NodeId)

Source

pub fn set_delta_value_to_one(&mut self, node: NodeId)

Source

pub fn delta_value_for_node(&self, node: NodeId) -> f64

Source

pub fn set_delta_value_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn increment_delta_value_for_node(&mut self, v_n: NodeId, c_t: f64)

Source

pub fn attenuate_delta_value_for_node(&mut self, v_n: NodeId, c_t: f64)

Source

pub fn delta_reinit(&mut self, len: usize)

Source

pub fn delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn deltas_fill_to_len(&mut self, len: usize, val: f64)

Source§

impl ICentralWorkspace

Source

pub fn new_deltas_update_delta_value( &mut self, v_p: NodeId, v_n: NodeId, sp_sn: f64, )

Source

pub fn new_deltas_set_delta_value_to_zero(&mut self, node: NodeId)

Source

pub fn new_deltas_set_delta_value_to_one(&mut self, node: NodeId)

Source

pub fn new_deltas_delta_value_for_node(&self, node: NodeId) -> f64

Source

pub fn new_deltas_set_delta_value_for_node(&mut self, node: NodeId, val: f64)

Source

pub fn new_deltas_increment_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )

Source

pub fn new_deltas_attenuate_delta_value_for_node( &mut self, v_n: NodeId, c_t: f64, )

Source

pub fn new_deltas_delta_reinit(&mut self, len: usize)

Source

pub fn new_deltas_delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn new_deltas_deltas_fill_to_len(&mut self, len: usize, val: f64)

Source§

impl ICentralWorkspace

Source§

impl ICentralWorkspace

Source§

impl ICentralWorkspace

Source

pub fn new_sigmas(&self) -> &SigmaMap

Source

pub fn sigmas(&self) -> &SigmaMap

Source

pub fn set_new_sigmas_from(&mut self, other: &SigmaMap)

Source

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

Source

pub fn compute_new_path_counts_and_paths(&mut self, src: NodeId, dst: NodeId)

Source

pub fn update_for_partial_bbfs_addition( &mut self, queue: &mut NodeIdQueue, w: NodeId, v: NodeId, )

Source

pub fn deltas(&self) -> &DeltaMap

Source

pub fn get_new_delta_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn set_deltas_from_new_deltas(&mut self)

Source

pub fn set_sigmas_from_other(&mut self, new: &SigmaMap)

Source

pub fn get_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn get_new_sigma_ratio(&self, v_p: NodeId, v_n: NodeId) -> f64

Source

pub fn update_new_capital_deltas_with_new_delta_ratio( &mut self, v_p: NodeId, v_n: NodeId, )

Source

pub fn update_new_capital_deltas_with_new_sigma_ratio( &mut self, v_p: NodeId, v_n: NodeId, )

Source

pub fn update_new_deltas_with_new_delta_ratio( &mut self, v_p: NodeId, v_n: NodeId, )

Source

pub fn update_new_deltas_with_new_sigma_ratio( &mut self, v_p: NodeId, v_n: NodeId, )

Source

pub fn maybe_update_capital_deltas( &mut self, component: &Component, source: NodeId, v_p: NodeId, v_n: NodeId, )

Source

pub fn maybe_update_new_capital_deltas( &mut self, component: &Component, source: NodeId, v_p: NodeId, v_n: NodeId, )

Source

pub fn update_capital_deltas(&mut self, v_p: NodeId, v_n: NodeId)

Source

pub fn update_deltas_for_each_p( &mut self, component: &Component, source: NodeId, v_n: NodeId, )

Source

pub fn update_all_deltas_for_component( &mut self, component: &Component, source: NodeId, v_p: NodeId, v_n: NodeId, )

Source

pub fn update_deltas(&mut self, v_p: NodeId, v_n: NodeId)

Source

pub fn maybe_update_capital_deltas_for_component( &mut self, component: &Component, source: NodeId, v_n: NodeId, )

Source

pub fn update_both_capital_deltas_for_component( &mut self, component: &Component, source: NodeId, v_n: NodeId, )

Source

pub fn process_outer_layer_neighbor( &mut self, bc_mem: &mut BcMemWorkspace, neighbor: NodeId, queue: &mut NodeIdQueue, v: NodeId, ) -> Result<(), BetweennessCentralityError>

Source

pub fn process_first_layer_neighbor( &mut self, bc_mem: &mut BcMemWorkspace, neighbor: NodeId, queue: &mut NodeIdQueue, v: NodeId, ) -> Result<(), BetweennessCentralityError>

Source

pub fn attenuate_deltas(&mut self, src: NodeId, dst: NodeId)

Source

pub fn calculate_deltas_step_with_sigma_ratio( &self, sigma_ratio: f64, w: NodeId, ) -> f64

Source

pub fn calculate_deltas_step(&self, v: NodeId, w: NodeId) -> f64

Source

pub fn update_delta_bc_of_vertices_for_node( &self, w: NodeId, delta_bc_of_vertices: &mut BetweennessScores, )

Source

pub fn refill_deltass(&mut self, len: usize)

Source§

impl ICentralWorkspace

Source

pub fn new_init_all(n: usize, name: &str) -> Self

Source

pub fn init_all(&mut self, n: usize)

Source

pub fn init_new(&mut self, n: usize)

| needed for d=1 only |

Trait Implementations§

Source§

impl Clone for ICentralWorkspace

Source§

fn clone(&self) -> ICentralWorkspace

Returns a duplicate 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 CreateNamedEmpty for ICentralWorkspace

Source§

fn empty(name: &str) -> Self

TODO: try to eliminate this if possible

Source§

impl Debug for ICentralWorkspace

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ICentralWorkspace

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl GetSigmaValueForNode for ICentralWorkspace

Source§

impl SetSigmaValueForNode for ICentralWorkspace

Source§

fn set_sigma_value_for_node(&mut self, node: NodeId, val: f64)

Auto Trait Implementations§

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PoisonMessage for T
where T: Debug,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more