6 #ifndef __remez_gmp_h__
7 #define __remez_gmp_h__
33 RemezGMP(
const Real& lower,
const Real& upper,
long prec);
39 void setBounds(
const Real& lower,
const Real& upper);
126 int simq(multi1d<bigfloat>&
A, multi1d<bigfloat>& B, multi1d<bigfloat>& X,
int n);
129 void allocate(
int num_degree,
int den_degree);
Remez algorithm for finding nth roots.
Primary include file for CHROMA library code.
bigfloat polyDiff(const bigfloat &x, const multi1d< bigfloat > &poly, long size)
Evaluate the differential of the polynomial.
bigfloat getErr(const bigfloat &x, int &sign)
Compute size and sign of the approximation error at x.
bool alloc
Flag to determine whether the arrays have been allocated.
int simq(multi1d< bigfloat > &A, multi1d< bigfloat > &B, multi1d< bigfloat > &X, int n)
Solve the system AX=B.
bigfloat func(const bigfloat &x)
Calculate function required for the approximation.
void allocate(int num_degree, int den_degree)
Free memory and reallocate as necessary.
int neq
The number of equations we must solve at each iteration (n+d+1)
bigfloat approx(const bigfloat &x)
void initialGuess()
Initial values of maximal and minmal errors.
bigfloat rtnewt(const multi1d< bigfloat > &poly, long i, const bigfloat &x1, const bigfloat &x2, const bigfloat &xacc)
Newton's method to calculate roots.
RemezCoeff_t getIPFE()
Return the partial fraction expansion of the approximation x^(-pnum/pden)
Real evalPFE(const Real &x, const RemezCoeff_t &coeff)
Given a partial fraction expansion, evaluate it at x.
multi1d< bigfloat > roots
int n
The numerator and denominator degree (n=d)
void stpini(multi1d< bigfloat > &step)
Initialise step sizes.
multi1d< bigfloat > poles
void pfe(multi1d< bigfloat > &res, multi1d< bigfloat > &poles, const bigfloat &norm)
bigfloat polyEval(const bigfloat &x, const multi1d< bigfloat > &poly, long size)
Evaluate the polynomial.
multi1d< bigfloat > param
RemezGMP()
Default constructor.
RemezCoeff_t getPFE()
Return the partial fraction expansion of the approximation x^(pnum/pden)
unsigned long power_num
the numerator and denominator of the power we are approximating
bigfloat apstrt
The bounds of the approximation.
void search(multi1d< bigfloat > &step)
Search for error maxima and minima.
void setBounds(const Real &lower, const Real &upper)
Reset the bounds of the approximation.
long prec
The precision of the GNU MP library.
int root()
Calculate the roots of the approximation.
Real generateApprox(int num_degree, int den_degree, unsigned long power_num, unsigned long power_den)
Generate the rational approximation x^(pnum/pden)
int nd1
Variables used to calculate the approximation.
void equations()
Solve the equations.
Asqtad Staggered-Dirac operator.
Remez algorithm coefficients.
Convenient structure to package Remez coeffs.