binary_fold_high

Function binary_fold_high 

Source
pub fn binary_fold_high<P, DataOut, DataIn>(
    values: &mut FieldBuffer<P, DataOut>,
    tensor: &FieldBuffer<P, DataIn>,
    bits: impl RandomAccessSequence<bool> + Sync,
)
where P: PackedField, DataOut: DerefMut<Target = [P]>, DataIn: Deref<Target = [P]> + Sync,
Expand description

Computes the fold high of a binary multilinear with a fold tensor.

Binary multilinear is represented transparently by a boolean sequence. Fold high meaning: for every hypercube vertex of the result, we specialize lower indexed variables of the binary multilinear to the vertex coordinates and take an inner product of the remaining multilinear and the tensor.

This method is single threaded.

ยงPreconditions

  • bits.len() must be a power of two
  • bits.len() must equal values.len() * tensor.len()