Function fold_left_lerp

Source
pub fn fold_left_lerp<P>(
    evals: &[P],
    log_evals_size: usize,
    lerp_query: P::Scalar,
    out: &mut [MaybeUninit<P>],
) -> Result<(), Error>
where P: PackedField,
Expand description

Left linear interpolation (lerp, single variable) fold

Please note that this method is single threaded. Currently we always have some parallelism above this level, so it’s not a problem. Having no parallelism inside allows us to use more efficient optimizations for special cases. If we ever need a parallel version of this function, we can implement it separately.

Also note that left folds are often intended to be used with non-indexable packed fields that have inefficient scalar access; fully generic handling of all interesting cases that can leverage spread multiplication requires dynamically checking the PackedExtension relations, so for now we just handle the simplest yet important case of a single variable left fold in packed field P with a lerp query of its scalar (and not a nontrivial extension field!).