26 ASSERT (integer != 0 && integer != 1 && integer != -1,
27 "non-zero non-unit expected");
36 while ((
i != 1) && (
i%2 == 0))
44 for (
int k= 0;
k <
exp;
k++)
53 while ((
i != 1) && (
j < 31937))
56 while ((
i != 1) && (
i%next_prime == 0))
67 for (
int k= 0;
k <
exp;
k++)
77 ASSERT (
j < 31397,
"integer factorizer ran out of primes");
88 for (
int i= 1;
i < factors_length;
i++)
90 if (factors[
i - 1] != factors[
i])
112 int prime_factors_length;
113 int distinct_factors_length;
115 int* distinct_factors=
makeDistinct (prime_factors, prime_factors_length,
116 distinct_factors_length);
117 delete [] prime_factors;
122 for (
int i= 0;
i < distinct_factors_length;
i++)
125 prod *= distinct_factors[
i];
127 delete [] distinct_factors;
#define ASSERT(expression, message)
int * integerFactorizer(const long integer, int &length, bool &fail)
integer factorization using table look-ups, function may fail if integer contains primes which exceed...
CanonicalForm cyclotomicPoly(int n, bool &fail)
compute the n-th cyclotomic polynomial, function may fail if integer_factorizer fails to factorize n
static int * makeDistinct(int *factors, const int factors_length, int &length)
make prime factorization distinct
bool isPrimitive(const Variable &alpha, bool &fail)
checks if alpha is a primitive element, alpha is assumed to be an algebraic variable over some finite...
int ipower(int b, int m)
int ipower ( int b, int m )
factory's class for variables
static BOOLEAN length(leftv result, leftv arg)
gmp_float exp(const gmp_float &a)
int status int void * buf
CanonicalForm getMipo(const Variable &alpha, const Variable &x)