pub struct SimdTraversal;Expand description
SIMD-accelerated operations for BFS/DFS distance and level vectors.
Provides optimized initialization, update, and reduction operations on the distance/level arrays used in graph traversals.
Implementations§
Source§impl SimdTraversal
impl SimdTraversal
Sourcepub fn relax_neighbors(
distances: &mut Array1<f64>,
adjacency_row: &ArrayView1<'_, f64>,
current_distance: f64,
) -> Vec<usize>
pub fn relax_neighbors( distances: &mut Array1<f64>, adjacency_row: &ArrayView1<'_, f64>, current_distance: f64, ) -> Vec<usize>
SIMD-accelerated BFS frontier relaxation.
For each node in the current frontier, attempts to relax the distance of its neighbors. This is the inner loop of BFS.
§Arguments
distances- Current distance vector (modified in place)adjacency_row- Adjacency row for the current nodecurrent_distance- Distance of the current node
§Returns
Vector of neighbor indices that were relaxed (for the next frontier).
Sourcepub fn eccentricity(distances: &ArrayView1<'_, f64>) -> f64
pub fn eccentricity(distances: &ArrayView1<'_, f64>) -> f64
Sourcepub fn count_reachable(distances: &ArrayView1<'_, f64>) -> usize
pub fn count_reachable(distances: &ArrayView1<'_, f64>) -> usize
Sourcepub fn sum_finite_distances(distances: &ArrayView1<'_, f64>) -> f64
pub fn sum_finite_distances(distances: &ArrayView1<'_, f64>) -> f64
Sourcepub fn element_wise_min(
a: &ArrayView1<'_, f64>,
b: &ArrayView1<'_, f64>,
) -> Array1<f64>
pub fn element_wise_min( a: &ArrayView1<'_, f64>, b: &ArrayView1<'_, f64>, ) -> Array1<f64>
Sourcepub fn diameter_from_distance_matrix(
distance_matrix: &ArrayView2<'_, f64>,
) -> f64
pub fn diameter_from_distance_matrix( distance_matrix: &ArrayView2<'_, f64>, ) -> f64
Auto Trait Implementations§
impl Freeze for SimdTraversal
impl RefUnwindSafe for SimdTraversal
impl Send for SimdTraversal
impl Sync for SimdTraversal
impl Unpin for SimdTraversal
impl UnsafeUnpin for SimdTraversal
impl UnwindSafe for SimdTraversal
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> 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