Skip to main content

parallel_map_reduce

Function parallel_map_reduce 

Source
pub fn parallel_map_reduce<T: Send + Sync>(
    data: &[T],
    map_fn: impl Fn(&T) -> f64 + Sync + Send,
    identity: f64,
    reduce_fn: impl Fn(f64, f64) -> f64 + Sync + Send,
) -> f64
Expand description

Parallel map-reduce: map each element, then reduce results.

Combines mapping and reduction in a single parallel pass.