next up previous contents
Next: Main Program Up: shor.cxx Previous: shor.cxx   Contents

Functions


int factorize(word n,word *a,word *b);
        returns 0 and sets *a and *b if n = (*a) * (*b)
        returns 1 if n is a prime number 

int testpower(word p,word b);
        returns 1 if p is a power of b and 0 otherwise

word powmod(word x,word a,word n);
        returns x^a mod n

int gcd(int a,int b);
        returns the greatest common divisor of a and b

int randcoprime(n);
        returns a random number 1 < r < (n-1) coprime to n

void approx(double x,word qmax,word *p,word *q);
        finds the best rational approximation (*p)/(*q) to x with 
        denominator < qmax and sets *p and *q accordingly. 

opVar opFFT(int n);
        performs a fast Fourier transformation on qs using
        Coppersmith's algorithm




(c) Bernhard Ömer - oemer@tph.tuwien.ac.at - http://tph.tuwien.ac.at/~oemer/