Skip to main content

pairs

Function pairs 

Source
pub fn pairs<X, Y, B>(
    x: Arg<'_, X>,
    y: Arg<'_, Y>,
    n: usize,
    out: &mut Vec<B>,
    f: impl Fn(X, Y) -> (B, bool) + Sync,
) -> bool
where X: Copy + Sync, Y: Copy + Sync, B: Send,
Expand description

Appends f on each of n pairs of items to out, and gives whether f said true for every pair. An Arg::One pairs with every item of the other argument. The loops write straight into out’s spare capacity, which is never zeroed first. This is the loop that rustymath’s slice forms run, and a caller’s own kernels can run it too, as basedpl’s arithmetic does. A long call splits across threads, as parallel describes.