Skip to main content

parallel_reduce_custom

Function parallel_reduce_custom 

Source
pub fn parallel_reduce_custom(
    data: &[f64],
    identity: f64,
    op: impl Fn(f64, f64) -> f64 + Sync + Send,
) -> f64
Expand description

Parallel reduction with a custom binary operator.

identity is the identity element for the operator (e.g. 0.0 for add). op must be associative and commutative for correctness.