40# define OSTREAM std::ostream
41# define ISTREAM std::istream
42# elif defined(HAVE_IOSTREAM_H)
44# define OSTREAM ostream
45# define ISTREAM istream
82#define LEVELBASE -1000000
83#define LEVELTRANS -500000
84#define LEVELQUOT 1000000
85#define LEVELEXPR 1000001
218 return ( ((
int)((intptr_t)ptr)) & 3 );
504 return power(
f.mvar(),
f.degree() ) *
f.LC();
811 bool ispoly, hasterms;
1124int igcd (
int a,
int b);
1208 if (
this != &value )
1236 bool removeContents=
true);
1251 bool removeContents=
true);
bool operator!=(const Rational &a, const Rational &b)
bool operator<(const Rational &a, const Rational &b)
bool operator==(const Rational &a, const Rational &b)
Rational abs(const Rational &a)
bool operator>(const Rational &a, const Rational &b)
bool operator<=(const Rational &a, const Rational &b)
bool operator>=(const Rational &a, const Rational &b)
CanonicalForm Prem(const CanonicalForm &F, const CanonicalForm &G)
pseudo remainder of F by G with certain factors of LC (g) cancelled
CanonicalForm normalize(const CanonicalForm &F)
normalize a poly, i.e. in char 0 clear denominators, remove integer content in char p divide by leadi...
CFList charSetViaCharSetN(const CFList &PS)
compute a characteristic set via medial set
CFList charSetViaModCharSet(const CFList &PS, StoreFactors &StoredFactors, bool removeContents)
characteristic set via modified medial set
ListCFList charSeries(const CFList &L)
characteristic series
CFList charSet(const CFList &PS)
characteristic set
ListCFList irrCharSeries(const CFList &PS)
irreducible characteristic series
CFList charSetN(const CFList &PS)
medial set
CFList basicSet(const CFList &PS)
basic set in the sense of Wang a.k.a. minimal ascending set in the sense of Greuel/Pfister
CFList newordercf(const CFList &PolyList)
CFList modCharSet(const CFList &L, StoreFactors &StoredFactors, bool removeContents)
modified medial set
CFList reorder(const Varlist &betterorder, const CFList &PS)
IntList neworderint(const CFList &PolyList)
Varlist neworder(const CFList &PolyList)
const CanonicalForm CFMap CFMap & N
CanonicalForm resultantZ(const CanonicalForm &A, const CanonicalForm &B, const Variable &x, bool prob)
modular resultant algorihtm over Z
CanonicalForm extgcd(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &a, CanonicalForm &b)
CanonicalForm extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a,...
CanonicalForm bCommonDen(const CanonicalForm &f)
void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r,...
CanonicalForm maxNorm(const CanonicalForm &f)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
CanonicalForm psq(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
cf_algorithm.cc - simple mathematical algorithms.
Variable get_max_degree_Variable(const CanonicalForm &f)
get_max_degree_Variable returns Variable with highest degree.
bool isPurePoly(const CanonicalForm &f)
bool isPurePoly_m(const CanonicalForm &f)
void psqr(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r, const Variable &x)
CanonicalForm FACTORY_PUBLIC determinant(const CFMatrix &M, int n)
CanonicalForm Farey(const CanonicalForm &f, const CanonicalForm &q)
Farey rational reconstruction.
CFFList FACTORY_PUBLIC sqrFree(const CanonicalForm &f, bool sort=false)
squarefree factorization
void getTerms(const CanonicalForm &f, const CanonicalForm &t, CFList &result)
get_Terms: Split the polynomial in the containing terms.
CFList get_Terms(const CanonicalForm &f)
CFArray subResChain(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ).
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
void FACTORY_PUBLIC chineseRemainder(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew)
void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2,...
bool tryFdivides(const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &M, bool &fail)
CanonicalForm psr(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm homogenize(const CanonicalForm &f, const Variable &x)
homogenize homogenizes f with Variable x
bool linearSystemSolve(CFMatrix &M)
EXTERN_VAR int singular_homog_flag
CanonicalForm euclideanNorm(const CanonicalForm &f)
CFFList FACTORY_PUBLIC factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
void FACTORY_PUBLIC chineseRemainderCached(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew, CFArray &inv)
CanonicalForm FACTORY_PUBLIC resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ).
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
static const int SW_USE_FL_GCD_P
set to 1 to use Flints gcd over F_p
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
static const int SW_USE_NTL_SORT
set to 1 to sort factors in a factorization
static const int SW_USE_FL_FAC_0
set to 1 to prefer flints multivariate factorization over Z/p
static const int SW_USE_FF_MOD_GCD
set to 1 to use modular GCD over F_q
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
static const int SW_SYMMETRIC_FF
set to 1 for symmetric representation over F_q
static const int SW_FAC_QUADRATICLIFT
static const int SW_USE_FL_GCD_0
set to 1 to use Flints gcd over Q/Z
static const int SW_USE_FL_FAC_0A
set to 1 to prefer flints multivariate factorization over Z/p(a)
static const int SW_USE_FL_FAC_P
set to 1 to prefer flints multivariate factorization over Z/p
static const int SW_BERLEKAMP
set to 1 to use Factorys Berlekamp alg.
const char factoryConfiguration[]
extern const char factoryConfiguration[];
CFMatrix * cf_LLL(CFMatrix &A)
performs LLL reduction.
CFMatrix * cf_HNF(CFMatrix &A)
The input matrix A is an n x m matrix of rank m (so n >= m), and D is a multiple of the determinant o...
CanonicalForm compress(const CanonicalForm &f, CFMap &m)
CanonicalForm compress ( const CanonicalForm & f, CFMap & m ).
ListIterator< MapPair > MPListIterator
int cf_getBigPrime(int i)
int cf_getNumSmallPrimes()
int cf_getSmallPrime(int i)
int factoryrandom(int n)
random integers with abs less than n
void factoryseed(int s)
random seed initializer
VAR void(*) factoryError(const char *s)
void factoryError_intern(const char *s)
int ipower(int b, int m)
int ipower ( int b, int m )
generate all elements in F_p(alpha) starting from 0
CanonicalForm item() const
CFGenerator * clone() const
AlgExtGenerator(const Variable &a)
AlgExtGenerator(const AlgExtGenerator &)
AlgExtGenerator & operator=(const AlgExtGenerator &)
generate random elements in F_p(alpha)
AlgExtRandomF(const Variable &v, CFRandom *g, int nn)
AlgExtRandomF & operator=(const AlgExtRandomF &)
AlgExtRandomF(const Variable &v1, const Variable &v2)
AlgExtRandomF(const Variable &v)
AlgExtRandomF(const AlgExtRandomF &)
CanonicalForm generate() const
static CFGenerator * generate()
virtual class for generators
virtual CFGenerator * clone() const
virtual CanonicalForm item() const
virtual bool hasItems() const
class to iterate through CanonicalForm's
CFIterator(const CFIterator &)
CF_NO_INLINE int exp() const
get the current exponent
CF_NO_INLINE CanonicalForm coeff() const
get the current coefficient
CFIterator(const CanonicalForm &, const Variable &)
CFIterator(const CanonicalForm &)
CF_NO_INLINE int hasTerms() const
check if iterator has reached the end of CanonicalForm
CanonicalForm operator()(const CanonicalForm &f) const
CanonicalForm CFMap::operator () ( const CanonicalForm & f ) const.
void newpair(const Variable &v, const CanonicalForm &s)
CFMap(const Variable &v, const CanonicalForm &s)
friend OSTREAM & operator<<(OSTREAM &s, const CFMap &m)
OSTREAM & operator << ( OSTREAM & s, const CFMap & m ).
CFMap & operator=(const CFMap &m)
CFMap & CFMap::operator = ( const CFMap & m ).
CFMap(const CanonicalForm &s)
static CFRandom * generate()
virtual class for random element generation
virtual CFRandom * clone() const
virtual CanonicalForm generate() const
class to evaluate a polynomial at points
void setValue(int i, const CanonicalForm &f)
CanonicalForm operator[](const Variable &v) const
Evaluation(int min0, int max0)
Evaluation & operator=(const Evaluation &e)
CanonicalForm operator()(const CanonicalForm &f) const
CanonicalForm operator[](int i) const
friend OSTREAM & operator<<(OSTREAM &s, const Evaluation &e)
Evaluation(const Evaluation &e)
generate all elements in F_p starting from 0
CanonicalForm item() const
CFGenerator * clone() const
generate random elements in F_p
CanonicalForm generate() const
generate all elements in GF starting from 0
CanonicalForm item() const
CFGenerator * clone() const
generate random elements in GF
CanonicalForm generate() const
generate integers starting from 0
CFGenerator * clone() const
CanonicalForm item() const
CanonicalForm generate() const
virtual class for internal CanonicalForm's
void print(OSTREAM &) const
MapPair(const Variable &v, const CanonicalForm &s)
friend OSTREAM & operator<<(OSTREAM &s, const MapPair &p)
OSTREAM & operator << ( OSTREAM & s, const MapPair & p ).
MapPair(const MapPair &p)
MapPair & operator=(const MapPair &p)
MapPair & MapPair::operator = ( const MapPair & p ).
CanonicalForm subst() const
class to generate random evaluation points
REvaluation(const REvaluation &e)
REvaluation(int min0, int max0, const CFRandom &sample)
REvaluation & operator=(const REvaluation &e)
class to store factors that get removed during char set computation
StoreFactors & operator=(const StoreFactors &value)
CFList FS2
candidate factors that might get removed
CFList FS1
factors that were removed
factory's class for variables
Variable(const Variable &v)
Variable(int l, bool flag)
friend void swap_levels()
static Variable highest()
friend Variable FACTORY_PUBLIC rootOf(const CanonicalForm &, char name)
returns a symbolic root of polynomial with name name.
Variable(int l, char name)
class to do operations mod p^k for int's p and k
CanonicalForm operator()(const CanonicalForm &f, bool symmetric=true) const
modpk & operator=(const modpk &m)
CanonicalForm inverse(const CanonicalForm &f, bool symmetric=true) const
CanonicalForm getpk() const
CFAFList absFactorize(const CanonicalForm &G)
absolute factorization of a multivariate poly over Q
const CanonicalForm int s
CFFList facAlgFunc(const CanonicalForm &f, const CFList &as)
factorize a polynomial modulo an extension given by an irreducible characteristic set
CFFList facAlgFunc2(const CanonicalForm &f, const CFList &as)
factorize a polynomial that is irreducible over the ground field modulo an extension given by an irre...
const Variable & v
< [in] a sqrfree bivariate poly
int probIrredTest(const CanonicalForm &F, double error)
given some error probIrredTest detects irreducibility or reducibility of F with confidence level 1-er...
void sort(CFArray &A, int l=0)
quick sort A
CanonicalForm replaceLc(const CanonicalForm &f, const CanonicalForm &c)
void setReduce(const Variable &alpha, bool reduce)
CanonicalForm FACTORY_PUBLIC make_cf(const mpz_ptr n)
Variable FACTORY_PUBLIC rootOf(const CanonicalForm &, char name='@')
returns a symbolic root of polynomial with name name Use it to define algebraic variables
CF_INLINE FACTORY_PUBLIC CanonicalForm operator+(const CanonicalForm &, const CanonicalForm &)
CF_INLINE CanonicalForm operator +, -, *, /, % ( const CanonicalForm & lhs, const CanonicalForm & rhs...
void prune1(const Variable &alpha)
CF_INLINE FACTORY_PUBLIC CanonicalForm operator*(const CanonicalForm &, const CanonicalForm &)
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator%(const CanonicalForm &, const CanonicalForm &)
CanonicalForm make_cf_from_gf(const int z)
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator-(const CanonicalForm &, const CanonicalForm &)
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
static const int SW_RATIONAL
set to 1 for computations over Q
int gf_value(const CanonicalForm &f)
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator/(const CanonicalForm &, const CanonicalForm &)
void FACTORY_PUBLIC prune(Variable &alpha)
void FACTORY_PUBLIC gmp_numerator(const CanonicalForm &f, mpz_ptr result)
void setMipo(const Variable &alpha, const CanonicalForm &mipo)
void FACTORY_PUBLIC gmp_denominator(const CanonicalForm &f, mpz_ptr result)
bool hasMipo(const Variable &alpha)
factoryconf.h' serves as a configuration file for the installed source files (templates and factory....
fglmVector operator-(const fglmVector &v)
Array< CanonicalForm > CFArray
int is_imm(const InternalCF *const ptr)
List< CanonicalForm > CFList
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
gmp_float max(const gmp_float &a, const gmp_float &b)
gmp_float sqrt(const gmp_float &a)
ostream & operator<<(ostream &s, const spectrum &spec)
int name
New type name for int.