The current interface feels quite clunky. For example, the passed-in primitive root of unity omega and the $\mathsf{log}_2(\mathtt{x.len()})$ have restrictions that are so tight that they might as well be computed inside the function.
Admittedly, the current signature seems to have some merit – sometimes, it is actually used on sub-slices. However, most of time, a mutable reference to an entire vector is passed in. Maybe the above suggestion is a wrapper for an internal fn ntt_mut_slice(…). Looking at how we use ntt, it seems that this wrapper would become the default use.
I think it's time we rework the
ntt
interface from its currentto be something like
The current interface feels quite clunky. For example, the passed-in primitive root of unity
omega
and the $\mathsf{log}_2(\mathtt{x.len()})$ have restrictions that are so tight that they might as well be computed inside the function.Admittedly, the current signature seems to have some merit – sometimes, it is actually used on sub-slices. However, most of time, a mutable reference to an entire vector is passed in. Maybe the above suggestion is a wrapper for an internal
fn ntt_mut_slice(…)
. Looking at how we usentt
, it seems that this wrapper would become the default use.