// -*- C++ -*-
// automatically generated by autodoc

// ========== HEADER FILE src/mult/diskaux.h: ==========

// ----- SRCFILE=src/mult/diskaux.cc: -----
static void tell_lseek_err();
// Check errno and print info if set.

static void tell_read_err();
// Check errno and print info if set.

void seek_read(int fd, ulong off, double *f, ulong fn);
// Read doubles f[0..fn-1] from file with filedescriptor fd.
// Start in file after (double) offset off.

void v_seek_read(int fd, ulong off, void *f, ulong fn);
// From file with filedescriptor fd read fn bytes into f[].
// Start in file after (byte) offset off.
// Called by seek_read().

static void tell_write_err();
// Check errno and print info if set.

void seek_write(int fd, ulong off, double *f, ulong fn);
// Write doubles from f[0..fn-1] to file with filedescriptor fd.
// Start in file after (double) offset off.

void v_seek_write(int fd, ulong off, void *f, ulong fn);
// To file with filedescriptor fd write fn bytes from f[].
// Start in file after (byte) offset off.
// Called by seek_write().

void open_or_die(const char *fn, int *fd);
// Open file.  Die if that fails.

void close_or_die(int fd);
// Close file.  Die if that fails.

// ----- SRCFILE=src/mult/diskaux2.cc: -----
void disk_carry_thru_2limb(double *f, ulong fn, ulong al,
                      int fd,
                      uint rx, ulong &cyi,
                      LIMB *c, ulong cn, ulong coff,
                      ulong &si);
// Expect al*fn doubles on disk.
// Carry thru (from right to left) using f[0..fn-1] as workspace.
// Compute sum of digits and put to si.

void zeros2disk(double *f, ulong fn, ulong al,
            int fd, ulong off/*=0*/);
// Write  al*fn zeros to the file with filedescriptor fd.
// Start at offset off.

void limb2disk(const LIMB *a, ulong an,
          double *f, ulong fn, ulong al,
          int fd);
// Write a[0..an-1] as doubles to the file with filedescriptor fd.
// If al*fn > an  then append al*fn-an zeros.

// ========== HEADER FILE src/mult/diskconvolution.h: ==========

// ----- SRCFILE=src/mult/diskcnvla.cc: -----
void disk_weighted_complex_auto_convolution(int fd1, int fd2,
                                       double *fr, ulong fn, ulong al,
                                       double w,
                                       double nx,
                                       int zq1/*=0*/, int zq3/*=0*/);
// fd1/fd2: real/imag part of data  (#= fn*al)
// fr[0,...,fn-1]: workspace
// w:  weight for whole convolution
// nx: additional normalization factor (cf. disk_row_pass())

// ========== HEADER FILE src/mult/fxtmult.h: ==========

class fxtmult;
// class to handle FFT multiplications

// ----- SRCFILE=src/mult/fxtmult.cc: -----
void copy_out(const LIMB *a, ulong an, double *f, ulong fn);

void copy_in(const double *f, ulong fn, LIMB *a, ulong an);

ulong my_carry(double *a, ulong n, uint rx);

// ----- SRCFILE=src/mult/auxil.cc: -----
ulong next_dfxtlen(ulong n);

ulong previous_dfxtlen(ulong n);

ulong sum_of_digits(const double *a, ulong n,
              double nine, ulong su);

ulong sum_of_digits(const LIMB *a, ulong n,
              ulong nine, ulong s);

ulong mult_sum_of_digits(const LIMB *a, ulong an,
                   const LIMB *b, ulong bn,
                   ulong nine);

ulong sqr_sum_of_digits(const LIMB *a, ulong an,
                  ulong nine);

// ----- SRCFILE=src/mult/carry.cc: -----
static inline void divmod(double &a, double &cy, double drx, double d1rx);
// With drx==(double)R (radix),  d1rx==1/drx,  cy==carry (in)
//   set cy=(a-a%R)/R (carry out)  and  a=a%R

void carry_thru(double *a, ulong n, uint rx, double &cy);
// Carry through region a[n-1,...,0]

ulong carry(double *a, ulong n, uint rx);
// Carry operation for fft-multiplication.
// Return zero if no overflow happened
// else the new most significant digit.

static inline void divmod(umod_t &a, umod_t &cy, umod_t rx);

void carry_thru(umod_t *a, ulong n, uint rx, umod_t &cy);
// Carry through region a[n-1,...,0]

ulong carry(umod_t *a, ulong n, uint rx);
// Carry operation for fft-multiplication.
// Return zero if no overflow happened
// else the new most significant digit.

// ========== HEADER FILE src/mult/workspace.h: ==========

class  workspace_init;

class workspace;
// Auxiliary class for FFT multiplication algorithms

