Skip to main content

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]>,
Expand description

Overwrites a buffer with the high fold of a bit sequence by a tensor.

The bits are the coefficients of a multilinear whose values are all zero or one. Each output vertex fixes that polynomial’s low-indexed variables to that vertex. What remains is then paired with the tensor.

This runs on one thread.

§Preconditions

  • the bit count must be a power of two
  • the bit count must equal the output length times the tensor length