pub struct ParallelLevelUpdater { /* private fields */ }Expand description
Parallel level updater using Rayon
Implementations§
Source§impl ParallelLevelUpdater
impl ParallelLevelUpdater
Sourcepub fn with_config(config: ParallelConfig) -> Self
pub fn with_config(config: ParallelConfig) -> Self
Create with custom config
Sourcepub fn try_update_min(&self, value: f64, level: usize) -> bool
pub fn try_update_min(&self, value: f64, level: usize) -> bool
Update global minimum atomically
Sourcepub fn global_min(&self) -> f64
pub fn global_min(&self) -> f64
Get current global minimum
Sourcepub fn best_level(&self) -> Option<usize>
pub fn best_level(&self) -> Option<usize>
Get best level
Sourcepub fn process_parallel<F>(
&self,
levels: &[usize],
process_fn: F,
) -> Vec<LevelUpdateResult>
pub fn process_parallel<F>( &self, levels: &[usize], process_fn: F, ) -> Vec<LevelUpdateResult>
Process levels in parallel (scalar fallback)
Sourcepub fn process_with_stealing<F>(
&self,
work_items: Vec<WorkItem>,
process_fn: F,
) -> Vec<LevelUpdateResult>
pub fn process_with_stealing<F>( &self, work_items: Vec<WorkItem>, process_fn: F, ) -> Vec<LevelUpdateResult>
Process work items (scalar fallback)
Sourcepub fn process_vertices_parallel<F, R>(
&self,
vertices: &[VertexId],
process_fn: F,
) -> Vec<R>
pub fn process_vertices_parallel<F, R>( &self, vertices: &[VertexId], process_fn: F, ) -> Vec<R>
Batch vertex processing (scalar fallback)
Sourcepub fn parallel_reduce<T, F, R>(
&self,
items: &[T],
identity: R,
map_fn: F,
reduce_fn: fn(R, R) -> R,
) -> R
pub fn parallel_reduce<T, F, R>( &self, items: &[T], identity: R, map_fn: F, reduce_fn: fn(R, R) -> R, ) -> R
Parallel reduction (scalar fallback)
Sourcepub fn scheduler(&self) -> &Arc<WorkStealingScheduler>
pub fn scheduler(&self) -> &Arc<WorkStealingScheduler>
Get scheduler reference
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ParallelLevelUpdater
impl RefUnwindSafe for ParallelLevelUpdater
impl Send for ParallelLevelUpdater
impl Sync for ParallelLevelUpdater
impl Unpin for ParallelLevelUpdater
impl UnwindSafe for ParallelLevelUpdater
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