Skip to main content

Module fold

Module fold 

Source
Expand description

Fixing the highest variable of a multilinear to a value.

Fixing one variable of an n-variate multilinear leaves an (n-1)-variate one:

g(X_0, ..., X_{n-2}) = f(X_0, ..., X_{n-2}, r)

Coefficients are stored with the highest variable selecting which half of the buffer a coefficient falls in. So fixing the highest variable pairs the two halves and leaves the result in the first one.

Every routine here specializes a generic hypercube routine to the basis (1 - X, X).

Functionsยง

fold_highest_var
Fixes the highest variable of a multilinear to a value, writing into memory from an allocator.
fold_highest_var_inplace
Fixes the highest variable of a multilinear to a value, in place.