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

// ========== HEADER FILE src/aux0/aux0double.h: ==========

// ----- SRCFILE=src/aux0/aux0double.cc: -----
double pythag(double a, double b);
// return sqrt(a*a+b*b) avoiding overflow.
// Shouldn't be necessary with type double and sane algorithms/code

double extr3_estimate(const double *f);
// return extremum (y-value) of parabola through
// the points (-1,a), (0,b), (+1,c)

double extr3_estimate(const double *f, double &xval);
// return extremum (y-value) of parabola through
// the points (-1,a), (0,b), (+1,c)
// Put get the corrsponding x-value into xval

double sinc(double x);
// return sin(pi*x)/(pi*x)

void chop(double &x, double eps=1e-6);
// set to zero if tiny

// ----- SRCFILE=src/aux0/aux0print.cc: -----
void print_fixed(const char *bla, double v, long nd, bool sq);
// Print exactly nd digits of v
// Print sign if sq!=0

// ========== HEADER FILE src/aux0/binomial.h: ==========

inline ulong binomial(ulong n, ulong k);

// ========== HEADER FILE src/aux0/cmult.h: ==========

static inline void csqr(double &u, double &v);
// {u,v} <--| {u*u-v*v, 2*u*v}

static inline void csqr_n(double &u, double &v, double dn);
// {u,v} <--| {dn*(u*u-v*v), dn*(2*u*v)}

static inline void csqr(double a, double b, double &u, double &v);
// {u,v} <--| {a*a-b*b, 2*a*b}

static inline void cmult(double c, double s, double &u, double &v);
// {u,v} <--| u = u*c-v*s;  v = u*s+v*c

static inline void cmult_n(double c, double s, double &u, double &v, double dn);
// {u,v} <--| {dn*(u*c-v*s), dn*(u*s+v*c)}

static inline void cmult(double c, double s, double x, double y, double &u, double &v);
// {u,v} <--| {x*c-y*s, x*s+y*c}

static inline void cmult(double c, double s, Complex x, Complex y, Complex &u, Complex &v);
// {u,v} <--| {x*c-y*s, x*s+y*c}
// used in generated complex fhts

static inline void cmult(Complex c, Complex s, Complex x, Complex y, Complex &u, Complex &v);
// {u,v} <--| {x*c-y*s, x*s+y*c}
// used in generated complex fhts

static inline void cmult_inv(double c, double s, double x, double y, double &u, double &v);
// {u,v} <--| {x*c+y*s, -x*s+y*c}
// same as cmult(c, -s, x, y, u, v)

static inline void cmult_inv(double c, double s, Complex x, Complex y, Complex &u, Complex &v);
// {u,v} <--| {x*c+y*s, -x*s+y*c}
// same as cmult(c, -s, x, y, u, v)
// used in generated complex fhts

static inline void cmult_inv(Complex c, Complex s, Complex x, Complex y, Complex &u, Complex &v);
// {u,v} <--| {x*c+y*s, -x*s+y*c}
// same as cmult(c, -s, x, y, u, v)
// used in generated complex fhts

// ========== HEADER FILE src/aux0/constants.h: ==========

// ========== HEADER FILE src/aux0/csincos.h: ==========

static inline Complex SinCos(double phi);

static inline void SinCos(double phi, Complex *z);

// ========== HEADER FILE src/aux0/factorial.h: ==========

inline ulong factorial(ulong n);
// Return n!

// ========== HEADER FILE src/aux0/ldn2rc.h: ==========

static inline void ldn2rc(ulong ldn, ulong &nr, ulong &nc);
// Input ldn := log_2(n)
// nr, nc are set so that nr*nc = n and ldr>=ldc
// Used in (matrix-fft based) convolution

// ========== HEADER FILE src/aux0/rand-idx.h: ==========

inline ulong rand_idx(ulong m);
// Return random number in the range [0, 1, ..., m-1].
// Must have m>0.

// ========== HEADER FILE src/aux0/randf.h: ==========

// ----- SRCFILE=src/aux0/randf.cc: -----
uint rseed(uint s/*=0*/);

double rnd01();
// Random number in [0,1[

void rnd01(double *f, ulong n);
// Fill with random numbers in [0,1[

double white_noise();
// Return one sample of white noise (with mean=0, sigma=1).

void white_noise(double *f, ulong n);
// Fill array with samples of white noise (with mean=0, sigma=1).

// ========== HEADER FILE src/aux0/range.h: ==========

static inline bool in_range_q(Type xmin, Type xmax, Type x);
// Return whether xmin<= x <=xmax
// precondition:  xmin<=xmax

static inline bool off_range_q(Type x, Type xmin, Type xmax);
// Return whether x<xmin or x>xmax
// precondition:  xmin<=xmax

static inline void wrap_range(Type xmin, Type xmax, Type &x);
// toroidal rules apply
// precondition:  xmin<=xmax

static inline void clip_range(Type xmin, Type xmax, Type &x);
// force x into [xmin, xmax]
// precondition:  xmin<=xmax

static inline bool clip_range_q(Type xmin, Type xmax, Type &x);
// force x into [xmin, xmax]
// return whether clipping occurred
// precondition:  xmin<=xmax

static inline void clip_range0(Type xmax, Type &x);
// force x into [0, xmax]

static inline bool intersect_range_o(Type xmin, Type xmax, Type &x1, Type &x2);
// push  [x1,x2]  into  [xmin,xmax]
// return:  0  if  completely outside  1  else
// precondition:  xmin<=xmax
// precondition:  x1<=x2

static inline bool intersect_range(Type xmin, Type xmax, Type &x1, Type &x2);
// push  [x1,x2]  into  [xmin,xmax]
// return:  0  if  completely outside  1  else
// precondition:  xmin<=xmax

// ========== HEADER FILE src/aux0/sign.h: ==========

static inline Type  sign(const Type &x);
// Return sign(x)

static inline Type  sign1(const Type &x);
// Return 1 if x==0, else sign(x)

static inline int sign_bit(const Type &x);
// Return 1 if x<0, else 0

static inline Type  abs(const Type &x);
// Return abs(x)

// ========== HEADER FILE src/aux0/sincos.h: ==========

static inline void SinCos(double a, double *s, double *c);

static inline void SinCos(double a, double *s, double *c);

// ========== HEADER FILE src/aux0/sumdiff.h: ==========

static inline void sumdiff(Type &a, Type &b);
// {a, b}  <--| {a+b, a-b}

static inline void sumdiff_r(Type &a, Type &b);
// {a, b}  <--| {a+b, b-a}

static inline void sumdiff05(Type &a, Type &b);
// {a, b}  <--| {0.5*(a+b),  0.5*(a-b)}

static inline void sumdiff05_r(Type &a, Type &b);
// {a, b}  <--| {0.5*(a+b), 0.5*(b-a)}

static inline void diffsum(Type &a, Type &b);
// {a, b}  <--| {a-b, a+b}

static inline void sumdiff(Type a, Type b, Type &s, Type &d);
// {s, d}  <--| {a+b, a-b}

static inline void sumdiff05(Type a, Type b, Type &s, Type &d);
// {s, d}  <--| {0.5*(a+b), 0.5*(a-b)}

static inline void sumdiff3(Type &a, Type b, Type &d);
// {a, b, d} <--| {a+b, b, a-b}  (used in split-radix FFTs)
// NEVER call like func(a,b,a) or func(a,b,b)

static inline void sumdiff3_r(Type &a, Type b, Type &d);
// {a,b,d} <--| {a+b, b, b-a}  (used in split-radix FFTs)
// NEVER call like func(a,b,a) or func(a,b,b)

static inline void diffsum3(Type a, Type &b, Type &s);
// {a, b, s} <--| {a, a-b, a+b}  (used in split-radix FFTs)
// NEVER call like func(a,b,a) or func(a,b,b)

static inline void diffsum3_r(Type a, Type &b, Type &s);
// {a, b, s} <--| {a, b-a, a+b}  (used in split-radix FFTs)
// NEVER call like func(a,b,a) or func(a,b,b)

// ========== HEADER FILE src/aux0/swap.h: ==========

static inline void  swap2(Type &x, Type &y);
// swap values

static inline void  swap0(Type &x, Type &y);
// swap() for y known to be zero

// ========== HEADER FILE src/aux0/timer.h: ==========

inline double timediff(timeval &x, timeval &y);
// Return time difference in seconds.
// Usage:
//    timeval t0, t1;
//    gettimeofday(&t0, 0);
//    big_computation();
//    gettimeofday(&t1, 0);
//    double elapsed_time = timediff(t0, t1);

// ========== HEADER FILE src/aux0/trigrec.h: ==========

class trigrec;
// Type either double or long double.

// ========== HEADER FILE src/aux0/version.h: ==========

// ----- SRCFILE=src/aux0/version.cc: -----
void print_fxt_version();
// print fxt version, compile date and flags

