// -*- C++ -*-

// ===== FUNCTIONS declared in mod/ntt.h: =====

// ----- SRCFILE=mod/nttdit4.cc: -----
void ntt_dit4(mod *f, ulong ldn, int is);
// radix 4 decimation in time mod fft

// ----- SRCFILE=mod/nttdif4.cc: -----
void ntt_dif4(mod *f, ulong ldn, int is);
// radix 4 decimation in frequency mod fft

// ----- SRCFILE=mod/nttdit2.cc: -----
void ntt_dit2(mod *f, ulong ldn, int is);
// radix 2 decimation in time mod fft

// ----- SRCFILE=mod/nttdif2.cc: -----
void ntt_dif2(mod *f, ulong ldn, int is);
// radix 2 decimation in frequency mod fft

// ----- SRCFILE=mod/nttdif2nc.cc: -----
void ntt_dif2_noncyclic(mod *f, ulong ldn, int is);
// radix 2 decimation in frequency mod fft
// for noncyclic Z/mZ
// where the element of order 2 isn't ==-1 

// ----- SRCFILE=mod/nttcnvl.cc: -----
inline void check_two_invertible(ulong ldn);

void ntt_auto_convolution(mod *f, ulong ldn);
// _cyclic_ (self-)convolution
// (use zero padded data for usual co.)

void ntt_convolution(mod *f, mod *g, ulong ldn);
// _cyclic_ convolution
// (use zero padded data for usual co.)
// result in g[]

void ntt_convolution(mod *f, mod *g, mod *h, ulong ldn);
// _cyclic_ convolution of f[] and g[]
// (use zero padded data for usual co.)
// result in h[]
// f[] and g[] are left intact

void double_to_mod_by_force(double *f, ulong n);
// just forces doubles into mods

void mod_to_double_by_force(mod *m, ulong n);
// just forces mods into doubles

void ntt_convolution(double *f, double *g, ulong ldn);

void ntt_auto_convolution(double *f, ulong ldn);

// ----- SRCFILE=mod/slownttcnvl.cc: -----
void slow_mod_convolution(mod *f, mod *g, ulong n);
// _cyclic_ convolution
// (use zero padded data for usual co.)

void slow_mod_convolution(mod *f, mod *g, ulong nu);
// _cyclic_ convolution
// result in g
// alternative version

// ----- SRCFILE=mod/nttskip.cc: -----
void skip_ntt(mod *f, ulong n, ulong d, mod *w, int is);
// compute ntt of the n elements
// [0],[d],[2d],[3d],...,[(n-1)*d]

void skip_ntt0(mod *f, ulong n, ulong d, mod *w, int is);
// compute ntt of the n elements
// [0],[d],[2d],[3d],...,[(n-1)*d]

// ----- SRCFILE=mod/nttndim.cc: -----
void ntt_ndim(mod *f, ulong ndim, ulong *ldn, int is);
// ndim must be 1,2,3,4 or 5
// ldn[] contains base 2 logarithms of dimensions

// ----- SRCFILE=mod/slowntt.cc: -----
void slow_ntt(mod *f, ulong n, int is);

// ----- SRCFILE=mod/mrevbinpermute.cc: -----
void revbin_permute(mod *fr, ulong n);

void revbin_permute0(mod *fr, ulong n);

// ----- SRCFILE=mod/nttaux.cc: -----
void sumdiff2(mod *f, ulong n);

ulong ld(ulong x)  ;

