Loading...
Searching...
No Matches
factory.h
Go to the documentation of this file.
/* factory.h automatically generated by makeheader from factory.template */
/* emacs edit mode for this file is -*- C++ -*- */
#ifndef INCL_FACTORY_H
#define INCL_FACTORY_H
/* factory.template is a template to generate `factory.h' */
/**
*
* @file factory.h
*
* `factory.h' is the user interface to Factory. Created
* automatically by `makeheader', it collects all important
* declarations from all important Factory header files into one
* overall header file leaving out all boring Factory internal
* stuff. See `./bin/makeheader' for an explanation of the syntax
* of this file.
*
* Note: In this file the order of "includes" matters (since this
* are not real includes)! In general, files at the end depend
* on files at the beginning.
*
**/
#include "factory/factoryconf.h"
#include "factory/globaldefs.h"
#include <stdint.h>
#include "factory/si_log2.h"
#ifdef HAVE_OMALLOC
#include "omalloc/omalloc.h"
#ifndef XMEMORY_H
#include "omalloc/omallocClass.h"
#endif
#endif
#ifndef NOSTREAMIO
# ifdef HAVE_IOSTREAM
# include <iostream>
# define OSTREAM std::ostream
# define ISTREAM std::istream
# elif defined(HAVE_IOSTREAM_H)
# include <iostream.h>
# define OSTREAM ostream
# define ISTREAM istream
# endif
#endif /* ! NOSTREAMIO */
#include "factory/cf_gmp.h"
#include "factory/templates/ftmpl_array.h"
#include "factory/templates/ftmpl_afactor.h"
#include "factory/templates/ftmpl_factor.h"
#include "factory/templates/ftmpl_list.h"
#include "factory/templates/ftmpl_matrix.h"
/* stuff included from ./cf_globals.h */
extern const char factoryConfiguration[];
/* stuff included from ./cf_primes.h */
int FACTORY_PUBLIC cf_getPrime( int i );
int FACTORY_PUBLIC cf_getNumPrimes();
int FACTORY_PUBLIC cf_getSmallPrime( int i );
int FACTORY_PUBLIC cf_getNumSmallPrimes();
int FACTORY_PUBLIC cf_getBigPrime( int i );
int FACTORY_PUBLIC cf_getNumBigPrimes();
/* stuff included from ./cf_defs.h */
#define LEVELBASE -1000000
#define LEVELTRANS -500000
#define LEVELQUOT 1000000
#define LEVELEXPR 1000001
/// set to 1 for computations over Q
static const int SW_RATIONAL = 0;
/// set to 1 for symmetric representation over F_q
static const int SW_SYMMETRIC_FF = 1;
/// set to 1 to use EZGCD over Z
static const int SW_USE_EZGCD = 2;
/// set to 1 to use EZGCD over F_q
static const int SW_USE_EZGCD_P = 3;
/// set to 1 to sort factors in a factorization
static const int SW_USE_NTL_SORT=4;
/// set to 1 to use modular gcd over Z
static const int SW_USE_CHINREM_GCD=5;
/// set to 1 to use Encarnacion GCD over Q(a)
static const int SW_USE_QGCD=6;
/// set to 1 to use modular GCD over F_q
static const int SW_USE_FF_MOD_GCD=7;
/// set to 1 to use Flints gcd over F_p
static const int SW_USE_FL_GCD_P=8;
/// set to 1 to use Flints gcd over Q/Z
static const int SW_USE_FL_GCD_0=9;
/// set to 1 to use Factorys Berlekamp alg.
static const int SW_BERLEKAMP=10;
static const int SW_FAC_QUADRATICLIFT=11;
/// set to 1 to prefer flints multivariate factorization over Z/p
static const int SW_USE_FL_FAC_P=12;
/// set to 1 to prefer flints multivariate factorization over Z/p
static const int SW_USE_FL_FAC_0=13;
/// set to 1 to prefer flints multivariate factorization over Z/p(a)
static const int SW_USE_FL_FAC_0A=14;
/* stuff included from ./variable.h */
class CanonicalForm;
/**
* factory's class for variables
**/
class FACTORY_PUBLIC Variable
{
private:
int _level;
Variable( int l, bool flag );
public:
Variable() : _level(LEVELBASE) {}
Variable( int l );
Variable( char name );
Variable( int l, char name );
Variable( const Variable & v ) : _level(v._level) {}
~Variable() {};
Variable& operator= ( const Variable & v )
{
_level = v._level;
return *this;
}
int level() const { return _level; }
char name() const;
static Variable highest() { return Variable( LEVELQUOT-1 ); }
Variable next() const { return Variable( _level+1 ); }
friend bool operator == ( const Variable & lhs, const Variable & rhs )
{
return lhs._level == rhs._level;
}
friend bool operator != ( const Variable & lhs, const Variable & rhs )
{
return lhs._level != rhs._level;
}
friend bool operator > ( const Variable & lhs, const Variable & rhs )
{
return lhs._level > rhs._level;
}
friend bool operator < ( const Variable & lhs, const Variable & rhs )
{
return lhs._level < rhs._level;
}
friend bool operator >= ( const Variable & lhs, const Variable & rhs )
{
return lhs._level >= rhs._level;
}
friend bool operator <= ( const Variable & lhs, const Variable & rhs )
{
return lhs._level <= rhs._level;
}
#ifndef NOSTREAMIO
friend OSTREAM & operator << ( OSTREAM & os, const Variable & v );
#endif /* NOSTREAMIO */
friend void swap_levels();
/** returns a symbolic root of polynomial with name @a name.
* Use it to define algebraic variables
* @note: algebraic variables have a level < 0
**/
friend Variable FACTORY_PUBLIC rootOf( const CanonicalForm &, char name );
};
/** returns a symbolic root of polynomial with name @a name
* Use it to define algebraic variables
* @note: algebraic variables have a level < 0
**/
Variable FACTORY_PUBLIC rootOf( const CanonicalForm &, char name = '@' );
inline int level( const Variable & v ) { return v.level(); }
inline char name( const Variable & v ) { return v.name(); }
void setReduce( const Variable & alpha, bool reduce );
void setMipo ( const Variable & alpha, const CanonicalForm & mipo);
CanonicalForm getMipo( const Variable & alpha, const Variable & x );
bool hasMipo( const Variable & alpha );
char getDefaultVarName();
char getDefaultExtName();
void FACTORY_PUBLIC prune (Variable& alpha);
void prune1 (const Variable& alpha);
int ExtensionLevel();
/* stuff included from ./canonicalform.h */
#undef CF_INLINE
#define CF_INLINE
#undef CF_NO_INLINE
#define CF_NO_INLINE
class InternalCF;
inline int is_imm ( const InternalCF * const ptr )
{
// returns 0 if ptr is not immediate
return ( ((int)((intptr_t)ptr)) & 3 );
}
/**
* factory's main class
*
* a CanonicalForm can represent a polynomial over or a constant in F_p,
* F_p(alpha), GF (F_p[t]/(Conway polynomial)), Z, or Q
*
* @sa int_poly.h, variable.h, ffops.h, gfops.h, imm.h, int_int.h, int_rat.h
**/
class FACTORY_PUBLIC CanonicalForm
#ifdef HAVE_OMALLOC
#ifndef XMEMORY_H
: public omallocClass
#endif
#endif
{
private:
InternalCF *value;
public:
// constructors, destructors, selectors
CF_INLINE CanonicalForm();
CF_INLINE CanonicalForm( const CanonicalForm& );
CF_INLINE CanonicalForm( InternalCF* );
CF_INLINE CanonicalForm( const int );
CF_INLINE CanonicalForm( const long );
CF_INLINE CanonicalForm( const Variable & );
CF_INLINE CanonicalForm( const Variable &, int );
CanonicalForm( const char *, const int base=10 ); // use with caution - does only handle integers !!!
CF_NO_INLINE ~CanonicalForm();
InternalCF* getval() const; // use with caution !!!
CanonicalForm deepCopy() const;
void mpzval(mpz_t val) const;
// predicates
CF_NO_INLINE bool isOne() const;
CF_NO_INLINE bool isZero() const;
inline bool isImm() const { return is_imm( value ); };
bool inZ() const;
bool inQ() const;
bool inFF() const;
bool inGF() const;
bool inBaseDomain() const;
bool inExtension() const;
bool inCoeffDomain() const;
bool inPolyDomain() const;
bool inQuotDomain() const;
bool isFFinGF() const;
bool isUnivariate() const;
bool isHomogeneous() const;
// conversion functions
long intval() const;
CanonicalForm mapinto () const;
CanonicalForm lc () const;
CanonicalForm Lc () const;
CanonicalForm LC () const;
CanonicalForm LC ( const Variable & v ) const;
int degree () const;
int degree ( const Variable & v ) const;
CanonicalForm tailcoeff () const;
CanonicalForm tailcoeff ( const Variable & v ) const;
int taildegree () const;
int level () const;
Variable mvar () const;
CanonicalForm num () const;
CanonicalForm den () const;
// assignment operators
CF_NO_INLINE CanonicalForm& operator = ( const CanonicalForm& );
CF_NO_INLINE CanonicalForm& operator = ( const long );
CanonicalForm& operator += ( const CanonicalForm& );
CanonicalForm& operator -= ( const CanonicalForm& );
CanonicalForm& operator *= ( const CanonicalForm& );
CanonicalForm& operator /= ( const CanonicalForm& );
CanonicalForm& operator %= ( const CanonicalForm& );
CanonicalForm& div ( const CanonicalForm& );
CanonicalForm& tryDiv (const CanonicalForm&, const CanonicalForm&, bool& );
CanonicalForm& mod ( const CanonicalForm& );
// evaluation operators
CanonicalForm operator () ( const CanonicalForm & f ) const;
CanonicalForm operator () ( const CanonicalForm & f, const Variable & v ) const;
CanonicalForm operator [] ( int i ) const;
CanonicalForm deriv() const;
CanonicalForm deriv( const Variable & x ) const;
int sign() const;
CanonicalForm sqrt() const;
int ilog2() const;
// comparison operators
friend FACTORY_PUBLIC bool operator == ( const CanonicalForm&, const CanonicalForm& );
friend FACTORY_PUBLIC bool operator != ( const CanonicalForm&, const CanonicalForm& );
friend FACTORY_PUBLIC bool operator > ( const CanonicalForm&, const CanonicalForm& );
friend FACTORY_PUBLIC bool operator < ( const CanonicalForm&, const CanonicalForm& );
// arithmetic operators
friend CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator - ( const CanonicalForm& );
friend FACTORY_PUBLIC void divrem ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& );
friend FACTORY_PUBLIC bool divremt ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& );
friend FACTORY_PUBLIC bool tryDivremt ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm&, const CanonicalForm&, bool& );
friend FACTORY_PUBLIC CanonicalForm bgcd ( const CanonicalForm &, const CanonicalForm & );
friend FACTORY_PUBLIC CanonicalForm bextgcd ( const CanonicalForm &, const CanonicalForm &, CanonicalForm &, CanonicalForm & );
// input/output
#ifndef NOSTREAMIO
void print( OSTREAM&, char * ) const;
void print( OSTREAM& ) const;
friend FACTORY_PUBLIC OSTREAM& operator << ( OSTREAM&, const CanonicalForm& );
friend FACTORY_PUBLIC ISTREAM& operator >> ( ISTREAM&, CanonicalForm& );
#endif /* NOSTREAMIO */
// obsolete methods
CanonicalForm genZero() const;
CanonicalForm genOne() const;
friend class CFIterator;
};
CF_INLINE FACTORY_PUBLIC CanonicalForm
operator + ( const CanonicalForm&, const CanonicalForm& );
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm
operator - ( const CanonicalForm&, const CanonicalForm& );
CF_INLINE FACTORY_PUBLIC CanonicalForm
operator * ( const CanonicalForm&, const CanonicalForm& );
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm
operator / ( const CanonicalForm&, const CanonicalForm& );
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm
operator % ( const CanonicalForm&, const CanonicalForm& );
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm
div ( const CanonicalForm&, const CanonicalForm& );
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm
mod ( const CanonicalForm&, const CanonicalForm& );
//{{{ function declarations from canonicalform.cc
CanonicalForm FACTORY_PUBLIC blcm ( const CanonicalForm & f, const CanonicalForm & g );
CanonicalForm FACTORY_PUBLIC power ( const CanonicalForm & f, int n );
CanonicalForm FACTORY_PUBLIC power ( const Variable & v, int n );
//}}}
//{{{ function declarations from cf_gcd.cc
CanonicalForm FACTORY_PUBLIC gcd ( const CanonicalForm&, const CanonicalForm& );
CanonicalForm FACTORY_PUBLIC gcd_poly ( const CanonicalForm & f, const CanonicalForm & g );
CanonicalForm FACTORY_PUBLIC lcm ( const CanonicalForm&, const CanonicalForm& );
CanonicalForm FACTORY_PUBLIC pp ( const CanonicalForm& );
CanonicalForm FACTORY_PUBLIC content ( const CanonicalForm& );
CanonicalForm FACTORY_PUBLIC content ( const CanonicalForm&, const Variable& );
CanonicalForm FACTORY_PUBLIC icontent ( const CanonicalForm & f );
CanonicalForm FACTORY_PUBLIC vcontent ( const CanonicalForm & f, const Variable & x );
//}}}
//{{{ function declarations from cf_ops.cc
CanonicalForm FACTORY_PUBLIC swapvar ( const CanonicalForm &, const Variable &, const Variable & );
CanonicalForm FACTORY_PUBLIC replacevar ( const CanonicalForm &, const Variable &, const Variable & );
int getNumVars( const CanonicalForm & f );
CanonicalForm getVars( const CanonicalForm & f );
CanonicalForm apply ( const CanonicalForm & f, void (*mf)( CanonicalForm &, int & ) );
CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) );
int * degrees ( const CanonicalForm & f, int * degs = 0 );
int totaldegree ( const CanonicalForm & f );
int totaldegree ( const CanonicalForm & f, const Variable & v1, const Variable & v2 );
int size ( const CanonicalForm & f, const Variable & v );
int size ( const CanonicalForm & f );
int size_maxexp ( const CanonicalForm & f, int& maxexp );
CanonicalForm reduce ( const CanonicalForm& f, const CanonicalForm & M);
bool hasFirstAlgVar( const CanonicalForm & f, Variable & a);
CanonicalForm leftShift (const CanonicalForm& F, int n);
//}}}
//{{{ inline functions corresponding to CanonicalForm methods
//{{{ docu
//
// - inline functions corresponding to CanonicalForm methods.
//
// These function exist for convenience only and because it is
// more beautiful to write 'degree( f )' than 'f.degree()'.
//
//}}}
inline CanonicalForm
lc ( const CanonicalForm & f ) { return f.lc(); }
inline CanonicalForm
Lc ( const CanonicalForm & f ) { return f.Lc(); }
inline CanonicalForm
LC ( const CanonicalForm & f ) { return f.LC(); }
inline CanonicalForm
LC ( const CanonicalForm & f, const Variable & v ) { return f.LC( v ); }
inline int
degree ( const CanonicalForm & f ) { return f.degree(); }
inline int
degree ( const CanonicalForm & f, const Variable & v ) { return f.degree( v ); }
inline int
taildegree ( const CanonicalForm & f ) { return f.taildegree(); }
inline CanonicalForm
tailcoeff ( const CanonicalForm & f ) { return f.tailcoeff(); }
inline CanonicalForm
tailcoeff (const CanonicalForm& f, const Variable& v) { return f.tailcoeff(v); }
inline int
level ( const CanonicalForm & f ) { return f.level(); }
inline Variable
mvar ( const CanonicalForm & f ) { return f.mvar(); }
inline CanonicalForm
num ( const CanonicalForm & f ) { return f.num(); }
inline CanonicalForm
den ( const CanonicalForm & f ) { return f.den(); }
inline int
sign ( const CanonicalForm & a ) { return a.sign(); }
inline CanonicalForm
deriv ( const CanonicalForm & f, const Variable & x ) { return f.deriv( x ); }
inline CanonicalForm
sqrt ( const CanonicalForm & a ) { return a.sqrt(); }
inline int
ilog2 ( const CanonicalForm & a ) { return a.ilog2(); }
inline CanonicalForm
mapinto ( const CanonicalForm & f ) { return f.mapinto(); }
//}}}
//{{{ inline functions
inline CanonicalForm
head ( const CanonicalForm & f )
{
if ( f.level() > 0 )
return power( f.mvar(), f.degree() ) * f.LC();
else
return f;
}
inline int
headdegree ( const CanonicalForm & f ) { return totaldegree( head( f ) ); }
//}}}
//{{{ other function declarations
void FACTORY_PUBLIC setCharacteristic( int c ); // -> Fp && Q
void setCharacteristic( int c, int n ); // -> PrimePower
void setCharacteristic( int c, int n, char name ); // -> GF(q)
int FACTORY_PUBLIC getCharacteristic();
int getGFDegree();
CanonicalForm getGFGenerator();
void FACTORY_PUBLIC On( int );
void FACTORY_PUBLIC Off( int );
bool FACTORY_PUBLIC isOn( int );
//}}}
//{{{ type definitions
typedef AFactor<CanonicalForm> CFAFactor;
typedef List <CFAFactor> CFAFList;
typedef ListIterator<CFAFactor> CFAFListIterator;
typedef Factor<CanonicalForm> CFFactor;
typedef List<CFFactor> CFFList;
typedef ListIterator<CFFactor> CFFListIterator;
typedef List<CanonicalForm> CFList;
typedef ListIterator<CanonicalForm> CFListIterator;
typedef Array<CanonicalForm> CFArray;
typedef Matrix<CanonicalForm> CFMatrix;
typedef List<CFList> ListCFList;
typedef ListIterator<CFList> ListCFListIterator ;
typedef List<int> IntList;
typedef ListIterator<int> IntListIterator;
typedef List<Variable> Varlist;
typedef ListIterator<Variable> VarlistIterator;
typedef Array<int> Intarray;
//}}}
/* stuff included from ./cf_algorithm.h */
//{{{ function declarations from cf_algorithm.cc
CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x );
CanonicalForm FACTORY_PUBLIC bCommonDen ( const CanonicalForm & f );
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g );
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm& quot );
bool tryFdivides ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm& M, bool& fail );
CanonicalForm maxNorm ( const CanonicalForm & f );
CanonicalForm euclideanNorm ( const CanonicalForm & f );
//}}}
//{{{ function declarations from cf_chinese.cc
void FACTORY_PUBLIC chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew );
void FACTORY_PUBLIC chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew );
void FACTORY_PUBLIC chineseRemainderCached ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew, CFArray &inv );
void FACTORY_PUBLIC chineseRemainderCached(const CFArray &a, const CFArray &n, CanonicalForm &xnew, CanonicalForm &prod, CFArray &inv);
CanonicalForm Farey ( const CanonicalForm & f, const CanonicalForm & q );
//}}}
//{{{ function declarations from cf_factor.cc
EXTERN_VAR int singular_homog_flag;
bool isPurePoly(const CanonicalForm & f);
bool isPurePoly_m(const CanonicalForm & f);
CFFList FACTORY_PUBLIC factorize ( const CanonicalForm & f, bool issqrfree = false );
CFFList FACTORY_PUBLIC factorize ( const CanonicalForm & f, const Variable & alpha );
CFFList FACTORY_PUBLIC sqrFree ( const CanonicalForm & f, bool sort= false );
CanonicalForm homogenize( const CanonicalForm & f, const Variable & x);
CanonicalForm homogenize( const CanonicalForm & f, const Variable & x,
const Variable & v1, const Variable & v2);
Variable get_max_degree_Variable(const CanonicalForm & f);
CFList get_Terms( const CanonicalForm & f );
void getTerms( const CanonicalForm & f, const CanonicalForm & t, CFList & result );
//}}}
//{{{ function declarations from cf_linsys.cc
bool linearSystemSolve ( CFMatrix & M );
CanonicalForm FACTORY_PUBLIC determinant ( const CFMatrix & M, int n );
//}}}
//{{{ function declarations from cf_resultant.cc
CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
CanonicalForm FACTORY_PUBLIC resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
//}}}
/** inline CanonicalForm abs ( const CanonicalForm & f )
*
* abs() - return absolute value of `f'.
*
* The absolute value is defined in terms of the function
* `sign()'. If it reports negative sign for `f' than -`f' is
* returned, otherwise `f'.
*
* This behaviour is most useful for integers and rationals. But
* it may be used to sign-normalize the leading coefficient of
* arbitrary polynomials, too.
*
* Type info:
* ----------
* f: CurrentPP
*
**/
inline CanonicalForm
abs ( const CanonicalForm & f )
{
// it is not only more general to use `sign()' instead of a
// direct comparison `f < 0', it is faster, too
if ( sign( f ) < 0 )
return -f;
else
return f;
}
//}}}
/* stuff included from ./cf_eval.h */
/**
* class to evaluate a polynomial at points
**/
class Evaluation
{
protected:
CFArray values;
public:
Evaluation() : values() {}
Evaluation( int min0, int max0 ) : values( min0, max0 ) {}
Evaluation( const Evaluation & e ) : values( e.values ) {}
virtual ~Evaluation() {}
Evaluation& operator= ( const Evaluation & e );
int min() const { return values.min(); }
int max() const { return values.max(); }
CanonicalForm operator[] ( int i ) const { return values[i]; }
CanonicalForm operator[] ( const Variable & v ) const { return operator[](v.level()); }
CanonicalForm operator() ( const CanonicalForm& f ) const;
CanonicalForm operator() ( const CanonicalForm & f, int i, int j ) const;
void setValue (int i, const CanonicalForm& f);
virtual void nextpoint();
#ifndef NOSTREAMIO
friend OSTREAM& operator<< ( OSTREAM& s, const Evaluation &e );
#endif /* NOSTREAMIO */
};
/* stuff included from ./cf_generator.h */
/**
* virtual class for generators
**/
class CFGenerator
{
public:
CFGenerator() {}
virtual ~CFGenerator() {}
virtual bool hasItems() const { return false; }
virtual void reset() {};
virtual CanonicalForm item() const { return 0; }
virtual void next() {};
virtual CFGenerator * clone() const { return new CFGenerator();}
};
/**
* generate integers starting from 0
**/
class IntGenerator : public CFGenerator
{
private:
int current;
public:
IntGenerator() : current(0) {}
~IntGenerator() {}
bool hasItems() const;
void reset() { current = 0; }
CanonicalForm item() const;
void next();
void operator++ () { next(); }
void operator++ ( int ) { next(); }
CFGenerator * clone() const;
};
/**
* generate all elements in F_p starting from 0
**/
class FFGenerator : public CFGenerator
{
private:
int current;
public:
FFGenerator() : current(0) {}
~FFGenerator() {}
bool hasItems() const;
void reset() { current = 0; }
CanonicalForm item() const;
void next();
void operator++ () { next(); }
void operator++ ( int ) { next(); }
CFGenerator * clone() const;
};
/**
* generate all elements in GF starting from 0
**/
class GFGenerator : public CFGenerator
{
private:
int current;
public:
GFGenerator();
~GFGenerator() {}
bool hasItems() const;
void reset();
CanonicalForm item() const;
void next();
void operator++ () { next(); }
void operator++ ( int ) { next(); }
CFGenerator * clone() const;
};
/**
* generate all elements in F_p(alpha) starting from 0
**/
class AlgExtGenerator: public CFGenerator
{
private:
Variable algext;
FFGenerator **gensf;
GFGenerator **gensg;
int n;
bool nomoreitems;
AlgExtGenerator();
AlgExtGenerator( const AlgExtGenerator & );
AlgExtGenerator& operator= ( const AlgExtGenerator & );
public:
AlgExtGenerator( const Variable & a );
~AlgExtGenerator();
bool hasItems() const { return ! nomoreitems; }
void reset();
CanonicalForm item() const;
void next();
void operator++ () { next(); }
void operator++ ( int ) { next(); }
CFGenerator * clone() const;
};
class CFGenFactory
{
public:
static CFGenerator* generate();
};
/* stuff included from ./cf_iter.h */
#undef CF_INLINE
#define CF_INLINE
#undef CF_NO_INLINE
#define CF_NO_INLINE
class term;
typedef term * termList;
/**
* class to iterate through CanonicalForm's
*
* @note a (multivariate) polynomial is viewed as a univariate poly in its main
* variable
**/
class FACTORY_PUBLIC CFIterator {
private:
CanonicalForm data;
termList cursor;
bool ispoly, hasterms;
public:
CFIterator ();
CFIterator ( const CFIterator& );
CFIterator ( const CanonicalForm& );
CFIterator ( const CanonicalForm&, const Variable& );
~CFIterator ();
CFIterator& operator= ( const CFIterator& );
CFIterator& operator= ( const CanonicalForm& );
CF_NO_INLINE CFIterator& operator++ ();
CF_NO_INLINE CFIterator& operator++ ( int );
CF_NO_INLINE int hasTerms () const; ///< check if iterator has reached
///< the end of CanonicalForm
CF_NO_INLINE CanonicalForm coeff () const;///< get the current coefficient
CF_NO_INLINE int exp () const; ///< get the current exponent
};
/* stuff included from ./cf_random.h */
/**
* virtual class for random element generation
**/
class CFRandom {
public:
virtual ~CFRandom() {}
virtual CanonicalForm generate() const { return 0; }
virtual CFRandom * clone() const { return new CFRandom(); }
};
/**
* generate random elements in GF
**/
class GFRandom : public CFRandom
{
public:
GFRandom() {};
~GFRandom() {}
CanonicalForm generate() const;
CFRandom * clone() const;
};
/**
* generate random elements in F_p
**/
class FFRandom : public CFRandom
{
public:
FFRandom() {}
~FFRandom() {}
CanonicalForm generate() const;
CFRandom * clone() const;
};
/**
* generate random integers
**/
class IntRandom : public CFRandom
{
private:
int max;
public:
IntRandom();
IntRandom( int m );
~IntRandom();
CanonicalForm generate() const;
CFRandom * clone() const;
};
/**
* generate random elements in F_p(alpha)
**/
class AlgExtRandomF : public CFRandom {
private:
Variable algext;
CFRandom * gen;
int n;
AlgExtRandomF();
AlgExtRandomF( const Variable & v, CFRandom * g, int nn );
AlgExtRandomF& operator= ( const AlgExtRandomF & );
public:
AlgExtRandomF( const AlgExtRandomF & );
AlgExtRandomF( const Variable & v );
AlgExtRandomF( const Variable & v1, const Variable & v2 );
~AlgExtRandomF();
CanonicalForm generate() const;
CFRandom * clone() const;
};
class CFRandomFactory {
public:
static CFRandom * generate();
};
/// random integers with abs less than n
int factoryrandom( int n );
/// random seed initializer
void FACTORY_PUBLIC factoryseed( int s );
/* stuff included from ./fac_util.h */
/**
* class to do operations mod p^k for int's p and k
**/
class modpk
{
private:
CanonicalForm pk;
CanonicalForm pkhalf;
int p;
int k;
public:
modpk();
modpk( int q, int l );
modpk( const modpk & m );
modpk& operator= ( const modpk& m );
~modpk() {}
int getp() const { return p; }
int getk() const { return k; }
CanonicalForm inverse( const CanonicalForm & f, bool symmetric = true ) const;
CanonicalForm getpk() const { return pk; }
CanonicalForm operator() ( const CanonicalForm & f, bool symmetric = true ) const;
};
CanonicalForm replaceLc( const CanonicalForm & f, const CanonicalForm & c );
/* stuff included from ./cf_map.h */
/** class MapPair
*
* class MapPair - stores one mapping pair (Variable -> CanonicalForm).
*
* This class is only used to store such pairs. It has no
* methods to transform a CanonicalForm as the class CFMap has.
*
* V, S: the pair (V -> S)
*
**/
/** inline method
*
* Variable var () const
* CanonicalForm subst () const
*
* var(), subst() - selectors, return V and P, resp.
*
**/
class MapPair
{
private:
Variable V;
CanonicalForm S;
public:
MapPair ( const Variable & v, const CanonicalForm & s ) : V(v), S(s) {}
MapPair () : V(), S(1) {}
MapPair ( const MapPair & p ) : V(p.V), S(p.S) {}
~MapPair () {}
MapPair & operator = ( const MapPair & p );
Variable var () const { return V; }
CanonicalForm subst () const { return S; }
#ifndef NOSTREAMIO
void print( OSTREAM&) const;
friend OSTREAM & operator << ( OSTREAM & s, const MapPair & p );
#endif /* NOSTREAMIO */
};
typedef List<MapPair> MPList;
typedef ListIterator<MapPair> MPListIterator;
/** class CFMap
*
* class CFMap - class to map canonical forms.
*
* Use an object of class CFMap to insert 'values' into canonical
* form. Such a mapping is defined by a list of MapPairs (V -> S)
* describing which canonical form S to insert for variable V.
* Hereby, the substituted canonical forms are not subject to
* further substitutions.
*
* P: list of MapPairs, sorted by level in descending order
*
**/
class CFMap
{
private:
MPList P;
public:
CFMap () {}
CFMap ( const CanonicalForm & s ) : P( MapPair( Variable(), s ) ) {}
CFMap ( const Variable & v ) : P( MapPair( v, 1 ) ) {}
CFMap ( const Variable & v, const CanonicalForm & s ) : P( MapPair( v, s ) ) {}
~CFMap () {}
CFMap ( const CFList & L );
CFMap ( const CFMap & m ) : P( m.P ) {}
CFMap & operator = ( const CFMap & m );
void newpair ( const Variable & v, const CanonicalForm & s );
CanonicalForm operator () ( const CanonicalForm & f ) const;
#ifndef NOSTREAMIO
friend OSTREAM & operator << ( OSTREAM & s, const CFMap & m );
#endif /* NOSTREAMIO */
};
CanonicalForm compress ( const CanonicalForm & f, CFMap & m );
void compress ( const CFArray & a, CFMap & M, CFMap & N );
void compress ( const CanonicalForm & f, const CanonicalForm & g, CFMap & M, CFMap & N );
/* stuff included from ./cf_reval.h */
/**
* class to generate random evaluation points
*
* @sa cf_eval.h
**/
class REvaluation : public Evaluation
{
protected: // neeeded in FFREvaluation
CFRandom * gen;
public:
REvaluation() : Evaluation(), gen(0) {}
REvaluation( int min0, int max0, const CFRandom & sample ) : Evaluation( min0, max0 ), gen( sample.clone() ) {}
REvaluation( const REvaluation & e );
~REvaluation();
REvaluation& operator= ( const REvaluation & e );
void nextpoint();
void nextpoint(int n);
};
/* stuff included from ./fac_sqrfree.h */
/* stuff included from ./gfops.h */
long gf_gf2ff ( long a );
int gf_gf2ff ( int a );
bool gf_isff ( long a );
bool gf_isff ( int a );
/* stuff included from ./cf_hnf.h */
/**
*
* The input matrix A is square matrix of integers
* output: the Hermite Normal Form of A; that is,
* the unique m x m matrix whose rows span L, such that
*
* - lower triangular,
* - the diagonal entries are positive,
* - any entry below the diagonal is a non-negative number
* strictly less than the diagonal entry in its column.
*
* @note: uses NTL
*
**/
CFMatrix* cf_HNF(CFMatrix& A);
/**
* performs LLL reduction.
*
* B is an m x n matrix, viewed as m rows of n-vectors. m may be less
* than, equal to, or greater than n, and the rows need not be
* linearly independent. B is transformed into an LLL-reduced basis,
* and the return value is the rank r of B. The first m-r rows of B
* are zero.
*
* More specifically, elementary row transformations are performed on
* B so that the non-zero rows of new-B form an LLL-reduced basis
* for the lattice spanned by the rows of old-B.
* The default reduction parameter is delta=3/4, which means
* that the squared length of the first non-zero basis vector
* is no more than 2^{r-1} times that of the shortest vector in
* the lattice.
*
* @note: uses NTL or FLINT
**/
CFMatrix* cf_LLL(CFMatrix& A);
/* stuff included from ./singext.h */
void FACTORY_PUBLIC gmp_numerator ( const CanonicalForm & f, mpz_ptr result );
void FACTORY_PUBLIC gmp_denominator ( const CanonicalForm & f, mpz_ptr result );
int gf_value (const CanonicalForm & f );
CanonicalForm FACTORY_PUBLIC make_cf ( const mpz_ptr n );
CanonicalForm FACTORY_PUBLIC make_cf ( const mpz_ptr n, const mpz_ptr d, bool normalize );
CanonicalForm make_cf_from_gf ( const int z );
/* stuff included from ./cf_util.h */
int igcd (int a, int b);
int FACTORY_PUBLIC ipower ( int b, int n );
void factoryError_intern(const char *s);
EXTERN_VAR void (*factoryError)(const char *s);
/* stuff included from ./facIrredTest.h */
/// given some error probIrredTest detects irreducibility or reducibility of F
/// with confidence level 1-error
///
/// @return probIrredTest returns 1 for irreducibility, -1 for reducibility
/// or 0 if the test is not applicable
int FACTORY_PUBLIC probIrredTest (const CanonicalForm& F, ///< [in] some poly over Z/p
double error ///< [in] 0 < error < 1
);
/* stuff included from ./facAbsFact.h */
/// absolute factorization of a multivariate poly over Q
///
/// @return absFactorize returns a list whose entries contain three
/// entities:
/// an absolute irreducible factor, an irreducible univariate polynomial
/// that defines the minimal field extension over which the irreducible
/// factor is defined (note: in case the factor is already defined over
/// Q[t]/(t), 1 is returned), and the multiplicity of the
/// absolute irreducible factor
CFAFList FACTORY_PUBLIC absFactorize (const CanonicalForm& G ///<[in] poly over Q
);
/* stuff included from ./cfModResultant.h */
/// modular resultant algorihtm over Z
///
/// @return @a resultantZ returns the resultant of A and B wrt. x
CanonicalForm
resultantZ (const CanonicalForm& A, ///<[in] some poly
const CanonicalForm& B, ///<[in] some poly
const Variable& x, ///<[in] some polynomial variable
bool prob= true ///<[in] if true use probabilistic algorithm
);
/* stuff included from ./facAlgFunc.h */
/// factorize a polynomial @a f that is irreducible over the ground field modulo
/// an extension given by an irreducible characteristic set @a as, @a f is
/// assumed to be integral, i.e. \f$ f\in K[x_1,\ldots,x_n]/(as) \f$, and each
/// element of @a as is assumed to be integral as well. \f$ K \f$ must be either
/// \f$ F_p \f$ or \f$ Q \f$.
///
/// @return the returned factors are not necessarily monic but only primitive
/// and the product of the factors equals @a f up to a unit.
CFFList facAlgFunc2 (const CanonicalForm & f,///<[in] univariate poly
const CFList & as ///<[in] irreducible characteristic
///< set
);
/// factorize a polynomial @a f modulo an extension given by an irreducible
/// characteristic set as, @a f is assumed to be integral, i.e.
/// \f$ f\in K[x_1,\ldots,x_n]/(as) \f$, and each element of @a as is assumed to
/// be integral as well. \f$ K \f$ must be either \f$ F_p \f$ or \f$ Q \f$.
///
/// @return the returned factors are not necessarily monic but only primitive
/// and the product of the factors equals @a f up to a unit.
CFFList facAlgFunc (const CanonicalForm & f, ///<[in] univariate poly
const CFList & as ///<[in] irreducible characteristic
///< set
);
/* stuff included from ./cfCharSetsUtil.h */
/**
* class to store factors that get removed during char set computation
**/
class StoreFactors
{
public:
CFList FS1; ///< factors that were removed
CFList FS2; ///< candidate factors that might get removed
inline StoreFactors& operator= (const StoreFactors& value)
{
if ( this != &value )
{
FS1 = value.FS1;
FS2 = value.FS2;
}
return *this;
}
};
CanonicalForm
Prem (const CanonicalForm& F, const CanonicalForm& G);
/* stuff included from ./cfCharSets.h */
/// basic set in the sense of Wang a.k.a. minimal ascending set in the sense of
/// Greuel/Pfister
CFList
basicSet (const CFList& PS);
/// characteristic set
CFList
charSet (const CFList& PS);
/// modified medial set
CFList
modCharSet (const CFList& PS, StoreFactors& StoredFactors,
bool removeContents= true);
CFList
modCharSet (const CFList& PS, bool removeContents);
CFList
charSetViaCharSetN (const CFList& PS);
CFList
charSetN (const CFList &PS);
/// modified characteristic set, i.e. a characteristic set with certain
/// factors removed
CFList
charSetViaModCharSet (const CFList& PS, StoreFactors& StoredFactors,
bool removeContents= true);
/// modified characteristic set, i.e. a characteristic set with certain
/// factors removed
CFList
charSetViaModCharSet (const CFList& PS, bool removeContents= true);
/// characteristic series
ListCFList
charSeries (const CFList& L);
/// irreducible characteristic series
ListCFList FACTORY_PUBLIC
irrCharSeries (const CFList & PS);
// the next three give you a heuristically optimal reorderd list of the
// variables. For internal and external (e.g. Singular/Macaulay2) library use.
// This is really experimental!
// See the comments in reorder.cc.
//
// this gives you a heuristically optimal ordering for the ring variables
// if you use the irreducible characteristic series.
Varlist neworder (const CFList & PolyList);
// the same as neworder(...) only returning a list of CanonicalForm 's
// (i.e. the variables as CanonicalForms)
CFList newordercf (const CFList & PolyList);
// the same as neworder(...) only returning a list of int 's (i.e. the levels)
IntList FACTORY_PUBLIC neworderint (const CFList & PolyList);
// for library internal use only:
// next function reorders the variables in PS:
// a code segment to use:
// ...
// #include "tmpl_inst.h" // for typedef's
// CFList PS= <setup-your-list-of-CanonicalForms>;
// Varlist betterorder= neworder(PS);
// PS= reorder(betterorder,PS); // reorder variables in PS from oldorder
// to betterorder
// ListCFList Q= IrrCharSeries( PS );
// Q= reorder(betterorder,Q); // revert ordering to oldorder
//
CFList reorder (const Varlist & betterorder, const CFList & PS);
CFFList reorder (const Varlist & betterorder, const CFFList & PS);
ListCFList reorder (const Varlist & betterorder, const ListCFList & Q);
/* stuff included from ./cfUnivarGcd.h */
CanonicalForm FACTORY_PUBLIC
extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a, CanonicalForm & b );
#endif /* ! INCL_FACTORY_H */
operator!=
bool operator!=(const Rational &a, const Rational &b)
Definition GMPrat.cc:318
operator<
bool operator<(const Rational &a, const Rational &b)
Definition GMPrat.cc:288
operator==
bool operator==(const Rational &a, const Rational &b)
Definition GMPrat.cc:312
abs
Rational abs(const Rational &a)
Definition GMPrat.cc:436
operator>
bool operator>(const Rational &a, const Rational &b)
Definition GMPrat.cc:300
operator<=
bool operator<=(const Rational &a, const Rational &b)
Definition GMPrat.cc:294
operator>=
bool operator>=(const Rational &a, const Rational &b)
Definition GMPrat.cc:306
bgcd
CanonicalForm bgcd(const CanonicalForm &f, const CanonicalForm &g)
CanonicalForm bgcd ( const CanonicalForm & f, const CanonicalForm & g ).
Definition canonicalform.cc:1648
divrem
void divrem(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r)
Definition canonicalform.cc:1032
operator>>
ISTREAM & operator>>(ISTREAM &is, CanonicalForm &cf)
Definition canonicalform.cc:1858
tryDivremt
bool tryDivremt(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r, const CanonicalForm &M, bool &fail)
same as divremt but handles zero divisors in case we are in Z_p[x]/(f) where f is not irreducible
Definition canonicalform.cc:1108
divremt
bool divremt(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r)
Definition canonicalform.cc:1066
bextgcd
CanonicalForm bextgcd(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &a, CanonicalForm &b)
CanonicalForm bextgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a,...
Definition canonicalform.cc:1722
Intarray
Array< int > Intarray
Definition canonicalform.h:405
CFAFactor
AFactor< CanonicalForm > CFAFactor
Definition canonicalform.h:389
OSTREAM
#define OSTREAM
Definition canonicalform.h:16
VarlistIterator
ListIterator< Variable > VarlistIterator
Definition canonicalform.h:404
CFAFListIterator
ListIterator< CFAFactor > CFAFListIterator
Definition canonicalform.h:391
CF_INLINE
#define CF_INLINE
Definition canonicalform.h:45
CFArray
Array< CanonicalForm > CFArray
Definition canonicalform.h:397
is_imm
int is_imm(const InternalCF *const ptr)
Definition canonicalform.h:65
CFFListIterator
ListIterator< CFFactor > CFFListIterator
Definition canonicalform.h:394
CFMatrix
Matrix< CanonicalForm > CFMatrix
Definition canonicalform.h:398
ListCFList
List< CFList > ListCFList
Definition canonicalform.h:399
CFListIterator
ListIterator< CanonicalForm > CFListIterator
Definition canonicalform.h:396
CFFList
List< CFFactor > CFFList
Definition canonicalform.h:393
ListCFListIterator
ListIterator< CFList > ListCFListIterator
Definition canonicalform.h:400
IntList
List< int > IntList
Definition canonicalform.h:401
CF_NO_INLINE
#define CF_NO_INLINE
Definition canonicalform.h:47
CFFactor
Factor< CanonicalForm > CFFactor
Definition canonicalform.h:392
reduce
CanonicalForm reduce(const CanonicalForm &f, const CanonicalForm &M)
polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of...
Definition cf_ops.cc:660
CFList
List< CanonicalForm > CFList
Definition canonicalform.h:395
IntListIterator
ListIterator< int > IntListIterator
Definition canonicalform.h:402
CFAFList
List< CFAFactor > CFAFList
Definition canonicalform.h:390
Varlist
List< Variable > Varlist
Definition canonicalform.h:403
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56
l
int l
Definition cfEzgcd.cc:100
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
x
Variable x
Definition cfModGcd.cc:4090
p
int p
Definition cfModGcd.cc:4086
g
g
Definition cfModGcd.cc:4098
b
CanonicalForm b
Definition cfModGcd.cc:4111
sort
static void sort(int **points, int sizePoints)
Definition cfNewtonPolygon.cc:100
singular_homog_flag
EXTERN_VAR int singular_homog_flag
Definition cf_algorithm.h:65
LEVELBASE
#define LEVELBASE
Definition cf_defs.h:25
SW_USE_QGCD
static const int SW_USE_QGCD
set to 1 to use Encarnacion GCD over Q(a)
Definition cf_defs.h:43
SW_USE_CHINREM_GCD
static const int SW_USE_CHINREM_GCD
set to 1 to use modular gcd over Z
Definition cf_defs.h:41
SW_USE_FL_GCD_P
static const int SW_USE_FL_GCD_P
set to 1 to use Flints gcd over F_p
Definition cf_defs.h:47
SW_USE_EZGCD_P
static const int SW_USE_EZGCD_P
set to 1 to use EZGCD over F_q
Definition cf_defs.h:37
SW_RATIONAL
static const int SW_RATIONAL
set to 1 for computations over Q
Definition cf_defs.h:31
SW_USE_NTL_SORT
static const int SW_USE_NTL_SORT
set to 1 to sort factors in a factorization
Definition cf_defs.h:39
SW_USE_FL_FAC_0
static const int SW_USE_FL_FAC_0
set to 1 to prefer flints multivariate factorization over Z/p
Definition cf_defs.h:57
SW_USE_FF_MOD_GCD
static const int SW_USE_FF_MOD_GCD
set to 1 to use modular GCD over F_q
Definition cf_defs.h:45
SW_USE_EZGCD
static const int SW_USE_EZGCD
set to 1 to use EZGCD over Z
Definition cf_defs.h:35
SW_SYMMETRIC_FF
static const int SW_SYMMETRIC_FF
set to 1 for symmetric representation over F_q
Definition cf_defs.h:33
SW_FAC_QUADRATICLIFT
static const int SW_FAC_QUADRATICLIFT
Definition cf_defs.h:53
SW_USE_FL_GCD_0
static const int SW_USE_FL_GCD_0
set to 1 to use Flints gcd over Q/Z
Definition cf_defs.h:49
LEVELQUOT
#define LEVELQUOT
Definition cf_defs.h:27
SW_USE_FL_FAC_0A
static const int SW_USE_FL_FAC_0A
set to 1 to prefer flints multivariate factorization over Z/p(a)
Definition cf_defs.h:59
SW_USE_FL_FAC_P
static const int SW_USE_FL_FAC_P
set to 1 to prefer flints multivariate factorization over Z/p
Definition cf_defs.h:55
SW_BERLEKAMP
static const int SW_BERLEKAMP
set to 1 to use Factorys Berlekamp alg.
Definition cf_defs.h:51
factoryConfiguration
const char factoryConfiguration[]
extern const char factoryConfiguration[];
cf_gmp.h
termList
term * termList
Definition cf_iter.h:36
MPListIterator
ListIterator< MapPair > MPListIterator
Definition cf_map.h:69
MPList
List< MapPair > MPList
Definition cf_map.h:68
factoryError
VAR void(* factoryError)(const char *s)
Definition cf_util.cc:80
f
FILE * f
Definition checklibs.c:9
AFactor
Definition ftmpl_afactor.h:17
AlgExtGenerator
generate all elements in F_p(alpha) starting from 0
Definition cf_generator.h:94
AlgExtGenerator::gensf
FFGenerator ** gensf
Definition cf_generator.h:97
AlgExtGenerator::operator++
void operator++()
Definition cf_generator.h:112
AlgExtGenerator::n
int n
Definition cf_generator.h:99
AlgExtGenerator::reset
void reset()
AlgExtGenerator::gensg
GFGenerator ** gensg
Definition cf_generator.h:98
AlgExtGenerator::item
CanonicalForm item() const
AlgExtGenerator::clone
CFGenerator * clone() const
AlgExtGenerator::AlgExtGenerator
AlgExtGenerator(const Variable &a)
AlgExtGenerator::hasItems
bool hasItems() const
Definition factory.h:773
AlgExtGenerator::nomoreitems
bool nomoreitems
Definition cf_generator.h:100
AlgExtGenerator::AlgExtGenerator
AlgExtGenerator()
AlgExtGenerator::AlgExtGenerator
AlgExtGenerator(const AlgExtGenerator &)
AlgExtGenerator::~AlgExtGenerator
~AlgExtGenerator()
AlgExtGenerator::operator=
AlgExtGenerator & operator=(const AlgExtGenerator &)
Definition cf_generator.cc:104
AlgExtGenerator::next
void next()
AlgExtGenerator::algext
Variable algext
Definition cf_generator.h:96
AlgExtRandomF
generate random elements in F_p(alpha)
Definition cf_random.h:70
AlgExtRandomF::clone
CFRandom * clone() const
AlgExtRandomF::AlgExtRandomF
AlgExtRandomF(const Variable &v, CFRandom *g, int nn)
AlgExtRandomF::gen
CFRandom * gen
Definition cf_random.h:73
AlgExtRandomF::algext
Variable algext
Definition cf_random.h:72
AlgExtRandomF::~AlgExtRandomF
~AlgExtRandomF()
AlgExtRandomF::operator=
AlgExtRandomF & operator=(const AlgExtRandomF &)
Definition cf_random.cc:120
AlgExtRandomF::AlgExtRandomF
AlgExtRandomF(const Variable &v1, const Variable &v2)
AlgExtRandomF::n
int n
Definition cf_random.h:74
AlgExtRandomF::AlgExtRandomF
AlgExtRandomF(const Variable &v)
AlgExtRandomF::AlgExtRandomF
AlgExtRandomF(const AlgExtRandomF &)
AlgExtRandomF::AlgExtRandomF
AlgExtRandomF()
AlgExtRandomF::generate
CanonicalForm generate() const
Array
Definition ftmpl_array.h:18
CFGenFactory
Definition cf_generator.h:118
CFGenFactory::generate
static CFGenerator * generate()
CFGenerator
virtual class for generators
Definition cf_generator.h:22
CFGenerator::CFGenerator
CFGenerator()
Definition factory.h:689
CFGenerator::clone
virtual CFGenerator * clone() const
Definition factory.h:695
CFGenerator::item
virtual CanonicalForm item() const
Definition factory.h:693
CFGenerator::~CFGenerator
virtual ~CFGenerator()
Definition factory.h:690
CFGenerator::hasItems
virtual bool hasItems() const
Definition factory.h:691
CFGenerator::next
virtual void next()
Definition factory.h:694
CFGenerator::reset
virtual void reset()
Definition factory.h:692
CFIterator
class to iterate through CanonicalForm's
Definition cf_iter.h:44
CFIterator::CFIterator
CFIterator(const CFIterator &)
CFIterator::CFIterator
CFIterator()
CFIterator::exp
CF_NO_INLINE int exp() const
get the current exponent
CFIterator::~CFIterator
~CFIterator()
CFIterator::coeff
CF_NO_INLINE CanonicalForm coeff() const
get the current coefficient
CFIterator::CFIterator
CFIterator(const CanonicalForm &, const Variable &)
CFIterator::CFIterator
CFIterator(const CanonicalForm &)
CFIterator::hasTerms
CF_NO_INLINE int hasTerms() const
check if iterator has reached the end of CanonicalForm
CFMap
class CFMap
Definition cf_map.h:85
CFMap::CFMap
CFMap(const Variable &v)
Definition factory.h:1009
CFMap::operator()
CanonicalForm operator()(const CanonicalForm &f) const
CanonicalForm CFMap::operator () ( const CanonicalForm & f ) const.
Definition cf_map.cc:178
CFMap::CFMap
CFMap(const CFMap &m)
Definition factory.h:1013
CFMap::CFMap
CFMap(const CFList &L)
CFMap::newpair
void newpair(const Variable &v, const CanonicalForm &s)
CFMap::CFMap
CFMap(const Variable &v, const CanonicalForm &s)
Definition factory.h:1010
CFMap::operator<<
friend OSTREAM & operator<<(OSTREAM &s, const CFMap &m)
OSTREAM & operator << ( OSTREAM & s, const CFMap & m ).
Definition cf_map.cc:191
CFMap::P
MPList P
Definition cf_map.h:87
CFMap::~CFMap
~CFMap()
Definition factory.h:1011
CFMap::operator=
CFMap & operator=(const CFMap &m)
CFMap & CFMap::operator = ( const CFMap & m ).
Definition cf_map.cc:77
CFMap::CFMap
CFMap()
Definition factory.h:1007
CFMap::CFMap
CFMap(const CanonicalForm &s)
Definition factory.h:1008
CFRandomFactory
Definition cf_random.h:87
CFRandomFactory::generate
static CFRandom * generate()
CFRandom
virtual class for random element generation
Definition cf_random.h:21
CFRandom::clone
virtual CFRandom * clone() const
Definition factory.h:842
CFRandom::generate
virtual CanonicalForm generate() const
Definition factory.h:841
CFRandom::~CFRandom
virtual ~CFRandom()
Definition factory.h:840
CanonicalForm
factory's main class
Definition canonicalform.h:86
CanonicalForm::den
CanonicalForm den() const
CanonicalForm::CanonicalForm
CF_INLINE CanonicalForm(const Variable &)
CanonicalForm::genOne
CanonicalForm genOne() const
CanonicalForm::LC
CanonicalForm LC() const
CanonicalForm::inGF
bool inGF() const
CanonicalForm::value
InternalCF * value
Definition canonicalform.h:88
CanonicalForm::isZero
CF_NO_INLINE bool isZero() const
CanonicalForm::isHomogeneous
bool isHomogeneous() const
CanonicalForm::isFFinGF
bool isFFinGF() const
CanonicalForm::CanonicalForm
CF_INLINE CanonicalForm(const CanonicalForm &)
CanonicalForm::~CanonicalForm
CF_NO_INLINE ~CanonicalForm()
CanonicalForm::inFF
bool inFF() const
CanonicalForm::degree
int degree() const
CanonicalForm::inExtension
bool inExtension() const
CanonicalForm::sign
int sign() const
CanonicalForm::deepCopy
CanonicalForm deepCopy() const
CanonicalForm::inQuotDomain
bool inQuotDomain() const
CanonicalForm::inPolyDomain
bool inPolyDomain() const
CanonicalForm::CanonicalForm
CF_INLINE CanonicalForm()
CanonicalForm::Lc
CanonicalForm Lc() const
CanonicalForm::mvar
Variable mvar() const
CanonicalForm::inQ
bool inQ() const
CanonicalForm::CanonicalForm
CF_INLINE CanonicalForm(InternalCF *)
CanonicalForm::getval
InternalCF * getval() const
CanonicalForm::isOne
CF_NO_INLINE bool isOne() const
CanonicalForm::CanonicalForm
CF_INLINE CanonicalForm(const Variable &, int)
CanonicalForm::tailcoeff
CanonicalForm tailcoeff() const
CanonicalForm::intval
long intval() const
CanonicalForm::genZero
CanonicalForm genZero() const
CanonicalForm::tailcoeff
CanonicalForm tailcoeff(const Variable &v) const
CanonicalForm::deriv
CanonicalForm deriv() const
CanonicalForm::CFIterator
friend class CFIterator
Definition canonicalform.h:202
CanonicalForm::inCoeffDomain
bool inCoeffDomain() const
CanonicalForm::print
void print(OSTREAM &) const
CanonicalForm::inZ
bool inZ() const
CanonicalForm::level
int level() const
CanonicalForm::CanonicalForm
CF_INLINE CanonicalForm(const int)
CanonicalForm::tryDiv
CanonicalForm & tryDiv(const CanonicalForm &, const CanonicalForm &, bool &)
CanonicalForm::sqrt
CanonicalForm sqrt() const
CanonicalForm::inBaseDomain
bool inBaseDomain() const
CanonicalForm::isImm
bool isImm() const
Definition factory.h:260
CanonicalForm::mod
CanonicalForm & mod(const CanonicalForm &)
CanonicalForm::mapinto
CanonicalForm mapinto() const
CanonicalForm::ilog2
int ilog2() const
CanonicalForm::degree
int degree(const Variable &v) const
CanonicalForm::CanonicalForm
CF_INLINE CanonicalForm(const long)
CanonicalForm::lc
CanonicalForm lc() const
CanonicalForm::mpzval
void mpzval(mpz_t val) const
CanonicalForm::LC
CanonicalForm LC(const Variable &v) const
CanonicalForm::deriv
CanonicalForm deriv(const Variable &x) const
CanonicalForm::CanonicalForm
CanonicalForm(const char *, const int base=10)
CanonicalForm::num
CanonicalForm num() const
CanonicalForm::print
void print(OSTREAM &, char *) const
CanonicalForm::taildegree
int taildegree() const
CanonicalForm::isUnivariate
bool isUnivariate() const
CanonicalForm::div
CanonicalForm & div(const CanonicalForm &)
Evaluation
class to evaluate a polynomial at points
Definition cf_eval.h:32
Evaluation::setValue
void setValue(int i, const CanonicalForm &f)
Evaluation::operator[]
CanonicalForm operator[](const Variable &v) const
Definition factory.h:669
Evaluation::values
CFArray values
Definition cf_eval.h:34
Evaluation::Evaluation
Evaluation(int min0, int max0)
Definition factory.h:662
Evaluation::operator=
Evaluation & operator=(const Evaluation &e)
Definition cf_eval.cc:15
Evaluation::min
int min() const
Definition factory.h:666
Evaluation::~Evaluation
virtual ~Evaluation()
Definition factory.h:664
Evaluation::max
int max() const
Definition factory.h:667
Evaluation::nextpoint
virtual void nextpoint()
Evaluation::operator()
CanonicalForm operator()(const CanonicalForm &f) const
Definition cf_eval.cc:24
Evaluation::operator[]
CanonicalForm operator[](int i) const
Definition cf_eval.h:43
Evaluation::operator<<
friend OSTREAM & operator<<(OSTREAM &s, const Evaluation &e)
Definition cf_eval.cc:60
Evaluation::Evaluation
Evaluation(const Evaluation &e)
Definition factory.h:663
Evaluation::Evaluation
Evaluation()
Definition factory.h:661
FFGenerator
generate all elements in F_p starting from 0
Definition cf_generator.h:56
FFGenerator::current
int current
Definition cf_generator.h:58
FFGenerator::FFGenerator
FFGenerator()
Definition factory.h:725
FFGenerator::operator++
void operator++()
Definition cf_generator.h:66
FFGenerator::~FFGenerator
~FFGenerator()
Definition factory.h:726
FFGenerator::hasItems
bool hasItems() const
FFGenerator::reset
void reset()
Definition factory.h:728
FFGenerator::item
CanonicalForm item() const
FFGenerator::clone
CFGenerator * clone() const
FFGenerator::next
void next()
FFRandom
generate random elements in F_p
Definition cf_random.h:44
FFRandom::generate
CanonicalForm generate() const
FFRandom::clone
CFRandom * clone() const
FFRandom::FFRandom
FFRandom()
Definition factory.h:863
FFRandom::~FFRandom
~FFRandom()
Definition factory.h:864
Factor
Definition ftmpl_factor.h:18
GFGenerator
generate all elements in GF starting from 0
Definition cf_generator.h:75
GFGenerator::hasItems
bool hasItems() const
GFGenerator::item
CanonicalForm item() const
GFGenerator::next
void next()
GFGenerator::clone
CFGenerator * clone() const
GFGenerator::current
int current
Definition cf_generator.h:77
GFGenerator::GFGenerator
GFGenerator()
GFGenerator::operator++
void operator++()
Definition cf_generator.h:85
GFGenerator::~GFGenerator
~GFGenerator()
Definition factory.h:745
GFGenerator::reset
void reset()
GFRandom
generate random elements in GF
Definition cf_random.h:32
GFRandom::clone
CFRandom * clone() const
GFRandom::~GFRandom
~GFRandom()
Definition factory.h:852
GFRandom::generate
CanonicalForm generate() const
GFRandom::GFRandom
GFRandom()
Definition factory.h:851
IntGenerator
generate integers starting from 0
Definition cf_generator.h:37
IntGenerator::clone
CFGenerator * clone() const
IntGenerator::~IntGenerator
~IntGenerator()
Definition factory.h:707
IntGenerator::operator++
void operator++()
Definition cf_generator.h:47
IntGenerator::reset
void reset()
Definition factory.h:709
IntGenerator::item
CanonicalForm item() const
IntGenerator::next
void next()
IntGenerator::current
int current
Definition cf_generator.h:39
IntGenerator::hasItems
bool hasItems() const
IntGenerator::IntGenerator
IntGenerator()
Definition factory.h:706
IntRandom
generate random integers
Definition cf_random.h:56
IntRandom::IntRandom
IntRandom()
IntRandom::generate
CanonicalForm generate() const
IntRandom::IntRandom
IntRandom(int m)
IntRandom::clone
CFRandom * clone() const
IntRandom::~IntRandom
~IntRandom()
InternalCF
virtual class for internal CanonicalForm's
Definition int_cf.h:47
ListIterator
Definition ftmpl_list.h:87
List
Definition ftmpl_list.h:52
MapPair
class MapPair
Definition cf_map.h:50
MapPair::var
Variable var() const
Definition factory.h:978
MapPair::S
CanonicalForm S
Definition cf_map.h:53
MapPair::print
void print(OSTREAM &) const
MapPair::MapPair
MapPair(const Variable &v, const CanonicalForm &s)
Definition factory.h:973
MapPair::operator<<
friend OSTREAM & operator<<(OSTREAM &s, const MapPair &p)
OSTREAM & operator << ( OSTREAM & s, const MapPair & p ).
Definition cf_map.cc:44
MapPair::MapPair
MapPair(const MapPair &p)
Definition factory.h:975
MapPair::V
Variable V
Definition cf_map.h:52
MapPair::operator=
MapPair & operator=(const MapPair &p)
MapPair & MapPair::operator = ( const MapPair & p ).
Definition cf_map.cc:28
MapPair::~MapPair
~MapPair()
Definition factory.h:976
MapPair::MapPair
MapPair()
Definition factory.h:974
MapPair::subst
CanonicalForm subst() const
Definition factory.h:979
Matrix
Definition ftmpl_matrix.h:29
REvaluation
class to generate random evaluation points
Definition cf_reval.h:26
REvaluation::gen
CFRandom * gen
Definition cf_reval.h:28
REvaluation::~REvaluation
~REvaluation()
REvaluation::REvaluation
REvaluation()
Definition factory.h:1040
REvaluation::REvaluation
REvaluation(const REvaluation &e)
REvaluation::REvaluation
REvaluation(int min0, int max0, const CFRandom &sample)
Definition factory.h:1041
REvaluation::nextpoint
void nextpoint()
REvaluation::nextpoint
void nextpoint(int n)
REvaluation::operator=
REvaluation & operator=(const REvaluation &e)
Definition cf_reval.cc:31
StoreFactors
class to store factors that get removed during char set computation
Definition cfCharSetsUtil.h:29
StoreFactors::operator=
StoreFactors & operator=(const StoreFactors &value)
Definition cfCharSetsUtil.h:33
StoreFactors::FS2
CFList FS2
candidate factors that might get removed
Definition cfCharSetsUtil.h:32
StoreFactors::FS1
CFList FS1
factors that were removed
Definition cfCharSetsUtil.h:31
Variable
factory's class for variables
Definition factory.h:127
Variable::Variable
Variable(const Variable &v)
Definition factory.h:136
Variable::Variable
Variable(int l, bool flag)
Definition variable.cc:47
Variable::swap_levels
friend void swap_levels()
Variable::Variable
Variable()
Definition factory.h:132
Variable::name
char name() const
Definition variable.cc:122
Variable::level
int level() const
Definition factory.h:143
Variable::next
Variable next() const
Definition factory.h:146
Variable::highest
static Variable highest()
Definition factory.h:145
Variable::~Variable
~Variable()
Definition factory.h:137
Variable::_level
int _level
Definition factory.h:129
modpk
class to do operations mod p^k for int's p and k
Definition fac_util.h:23
modpk::operator()
CanonicalForm operator()(const CanonicalForm &f, bool symmetric=true) const
Definition fac_util.cc:79
modpk::operator=
modpk & operator=(const modpk &m)
Definition fac_util.cc:47
modpk::modpk
modpk(int q, int l)
modpk::inverse
CanonicalForm inverse(const CanonicalForm &f, bool symmetric=true) const
modpk::getk
int getk() const
Definition factory.h:936
modpk::modpk
modpk()
modpk::getpk
CanonicalForm getpk() const
Definition factory.h:938
modpk::getp
int getp() const
Definition factory.h:935
modpk::modpk
modpk(const modpk &m)
modpk::p
int p
Definition fac_util.h:27
modpk::pkhalf
CanonicalForm pkhalf
Definition fac_util.h:26
modpk::~modpk
~modpk()
Definition factory.h:934
modpk::pk
CanonicalForm pk
Definition fac_util.h:25
modpk::k
int k
Definition fac_util.h:28
omallocClass
Definition omallocClass.h:20
term
Definition int_poly.h:33
alpha
Variable alpha
Definition facAbsBiFact.cc:52
result
return result
Definition facAbsBiFact.cc:76
s
const CanonicalForm int s
Definition facAbsFact.cc:51
mipo
CanonicalForm mipo
Definition facAlgExt.cc:57
B
b *CanonicalForm B
Definition facBivar.cc:52
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
j
int j
Definition facHensel.cc:110
prod
fq_nmod_poly_t prod
Definition facHensel.cc:100
isOn
bool FACTORY_PUBLIC isOn(int)
switches
Definition canonicalform.cc:1971
charSetViaCharSetN
CFList charSetViaCharSetN(const CFList &PS)
compute a characteristic set via medial set
Definition cfCharSets.cc:246
get_max_degree_Variable
Variable get_max_degree_Variable(const CanonicalForm &f)
get_max_degree_Variable returns Variable with highest degree.
Definition cf_factor.cc:264
isPurePoly
bool isPurePoly(const CanonicalForm &f)
Definition cf_factor.cc:248
cf_getNumSmallPrimes
int FACTORY_PUBLIC cf_getNumSmallPrimes()
Definition cf_primes.cc:34
setReduce
void setReduce(const Variable &alpha, bool reduce)
Definition variable.cc:238
headdegree
int headdegree(const CanonicalForm &f)
Definition factory.h:510
content
CanonicalForm FACTORY_PUBLIC content(const CanonicalForm &)
CanonicalForm content ( const CanonicalForm & f ).
Definition cf_gcd.cc:603
mapinto
CanonicalForm mapinto(const CanonicalForm &f)
Definition factory.h:496
charSeries
ListCFList charSeries(const CFList &L)
characteristic series
Definition cfCharSets.cc:411
getVars
CanonicalForm getVars(const CanonicalForm &f)
CanonicalForm getVars ( const CanonicalForm & f ).
Definition cf_ops.cc:350
blcm
CanonicalForm FACTORY_PUBLIC blcm(const CanonicalForm &f, const CanonicalForm &g)
Definition canonicalform.cc:1816
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600
charSet
CFList charSet(const CFList &PS)
characteristic set
Definition cfCharSets.cc:187
make_cf
CanonicalForm FACTORY_PUBLIC make_cf(const mpz_ptr n)
Definition singext.cc:66
div
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm div(const CanonicalForm &, const CanonicalForm &)
getNumVars
int getNumVars(const CanonicalForm &f)
int getNumVars ( const CanonicalForm & f )
Definition cf_ops.cc:314
lc
CanonicalForm lc(const CanonicalForm &f)
Definition factory.h:445
icontent
CanonicalForm FACTORY_PUBLIC icontent(const CanonicalForm &f)
CanonicalForm icontent ( const CanonicalForm & f ).
Definition cf_gcd.cc:74
irrCharSeries
ListCFList FACTORY_PUBLIC irrCharSeries(const CFList &PS)
irreducible characteristic series
Definition cfCharSets.cc:568
ilog2
int ilog2(const CanonicalForm &a)
Definition factory.h:493
leftShift
CanonicalForm leftShift(const CanonicalForm &F, int n)
left shift the main variable of F by n
Definition cf_ops.cc:697
replacevar
CanonicalForm FACTORY_PUBLIC replacevar(const CanonicalForm &, const Variable &, const Variable &)
CanonicalForm replacevar ( const CanonicalForm & f, const Variable & x1, const Variable & x2 ).
Definition cf_ops.cc:271
extgcd
CanonicalForm FACTORY_PUBLIC extgcd(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &a, CanonicalForm &b)
CanonicalForm extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a,...
Definition cfUnivarGcd.cc:174
level
int level(const Variable &v)
Definition factory.h:188
neworderint
IntList FACTORY_PUBLIC neworderint(const CFList &PolyList)
Definition cfCharSets.cc:88
isPurePoly_m
bool isPurePoly_m(const CanonicalForm &f)
Definition cf_factor.cc:238
name
char name(const Variable &v)
Definition factory.h:189
Off
void FACTORY_PUBLIC Off(int)
switches
Definition canonicalform.cc:1964
psqr
void psqr(const CanonicalForm &f, const CanonicalForm &g, CanonicalForm &q, CanonicalForm &r, const Variable &x)
sign
int sign(const CanonicalForm &a)
Definition factory.h:484
gcd
CanonicalForm FACTORY_PUBLIC gcd(const CanonicalForm &, const CanonicalForm &)
Definition cf_gcd.cc:685
rootOf
Variable FACTORY_PUBLIC rootOf(const CanonicalForm &, char name='@')
returns a symbolic root of polynomial with name name Use it to define algebraic variables
Definition variable.cc:162
tailcoeff
CanonicalForm tailcoeff(const CanonicalForm &f)
Definition factory.h:466
operator+
CF_INLINE FACTORY_PUBLIC CanonicalForm operator+(const CanonicalForm &, const CanonicalForm &)
CF_INLINE CanonicalForm operator +, -, *, /, % ( const CanonicalForm & lhs, const CanonicalForm & rhs...
Definition cf_inline.cc:503
getDefaultVarName
char getDefaultVarName()
Definition variable.cc:244
degrees
int * degrees(const CanonicalForm &f, int *degs=0)
int * degrees ( const CanonicalForm & f, int * degs )
Definition cf_ops.cc:493
prune1
void prune1(const Variable &alpha)
Definition variable.cc:291
determinant
CanonicalForm FACTORY_PUBLIC determinant(const CFMatrix &M, int n)
Definition cf_linsys.cc:222
operator*
CF_INLINE FACTORY_PUBLIC CanonicalForm operator*(const CanonicalForm &, const CanonicalForm &)
Definition cf_inline.cc:524
Farey
CanonicalForm Farey(const CanonicalForm &f, const CanonicalForm &q)
Farey rational reconstruction.
Definition cf_chinese.cc:202
Prem
CanonicalForm Prem(const CanonicalForm &F, const CanonicalForm &G)
pseudo remainder of F by G with certain factors of LC (g) cancelled
Definition cfCharSetsUtil.cc:616
mod
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm mod(const CanonicalForm &, const CanonicalForm &)
cf_getNumPrimes
int FACTORY_PUBLIC cf_getNumPrimes()
Definition cf_primes.cc:23
taildegree
int taildegree(const CanonicalForm &f)
Definition factory.h:463
charSetN
CFList charSetN(const CFList &PS)
medial set
Definition cfCharSets.cc:216
operator%
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator%(const CanonicalForm &, const CanonicalForm &)
probIrredTest
int FACTORY_PUBLIC probIrredTest(const CanonicalForm &F, double error)
given some error probIrredTest detects irreducibility or reducibility of F with confidence level 1-er...
Definition facIrredTest.cc:63
degree
int degree(const CanonicalForm &f)
Definition factory.h:457
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
deriv
CanonicalForm deriv(const CanonicalForm &f, const Variable &x)
Definition factory.h:487
sqrFree
CFFList FACTORY_PUBLIC sqrFree(const CanonicalForm &f, bool sort=false)
squarefree factorization
Definition cf_factor.cc:961
make_cf_from_gf
CanonicalForm make_cf_from_gf(const int z)
Definition singext.cc:76
lcm
CanonicalForm FACTORY_PUBLIC lcm(const CanonicalForm &, const CanonicalForm &)
CanonicalForm lcm ( const CanonicalForm & f, const CanonicalForm & g ).
Definition cf_gcd.cc:763
getTerms
void getTerms(const CanonicalForm &f, const CanonicalForm &t, CFList &result)
get_Terms: Split the polynomial in the containing terms.
Definition cf_factor.cc:283
get_Terms
CFList get_Terms(const CanonicalForm &f)
Definition cf_factor.cc:293
subResChain
CFArray subResChain(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ).
Definition cf_resultant.cc:42
size_maxexp
int size_maxexp(const CanonicalForm &f, int &maxexp)
Definition cf_ops.cc:641
getGFDegree
int getGFDegree()
Definition cf_char.cc:75
basicSet
CFList basicSet(const CFList &PS)
basic set in the sense of Wang a.k.a. minimal ascending set in the sense of Greuel/Pfister
Definition cfCharSets.cc:150
ExtensionLevel
int ExtensionLevel()
Definition variable.cc:254
igcd
int igcd(int a, int b)
Definition cf_util.cc:56
newordercf
CFList newordercf(const CFList &PolyList)
Definition cfCharSets.cc:75
maxNorm
CanonicalForm maxNorm(const CanonicalForm &f)
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
Definition cf_algorithm.cc:536
neworder
Varlist neworder(const CFList &PolyList)
facAlgFunc
CFFList facAlgFunc(const CanonicalForm &f, const CFList &as)
factorize a polynomial f modulo an extension given by an irreducible characteristic set as,...
Definition facAlgFunc.cc:1043
bCommonDen
CanonicalForm FACTORY_PUBLIC bCommonDen(const CanonicalForm &f)
void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r,...
Definition cf_algorithm.cc:293
vcontent
CanonicalForm FACTORY_PUBLIC vcontent(const CanonicalForm &f, const Variable &x)
CanonicalForm vcontent ( const CanonicalForm & f, const Variable & x ).
Definition cf_gcd.cc:653
cf_LLL
CFMatrix * cf_LLL(CFMatrix &A)
performs LLL reduction.
Definition cf_hnf.cc:66
setCharacteristic
void FACTORY_PUBLIC setCharacteristic(int c)
Definition cf_char.cc:28
fdivides
bool fdivides(const CanonicalForm &f, const CanonicalForm &g)
facAlgFunc2
CFFList facAlgFunc2(const CanonicalForm &f, const CFList &as)
factorize a polynomial f that is irreducible over the ground field modulo an extension given by an ir...
Definition facAlgFunc.cc:905
is_imm
int is_imm(const InternalCF *const ptr)
Definition factory.h:215
operator-
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator-(const CanonicalForm &, const CanonicalForm &)
hasFirstAlgVar
bool hasFirstAlgVar(const CanonicalForm &f, Variable &a)
check if poly f contains an algebraic variable a
Definition cf_ops.cc:679
resultantZ
CanonicalForm resultantZ(const CanonicalForm &A, const CanonicalForm &B, const Variable &x, bool prob=true)
modular resultant algorihtm over Z
Definition cfModResultant.cc:560
chineseRemainder
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,...
Definition cf_chinese.cc:57
getMipo
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
Definition variable.cc:207
factoryError_intern
void factoryError_intern(const char *s)
Definition cf_util.cc:75
tryFdivides
bool tryFdivides(const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &M, bool &fail)
gf_value
int gf_value(const CanonicalForm &f)
Definition singext.cc:60
swapvar
CanonicalForm FACTORY_PUBLIC swapvar(const CanonicalForm &, const Variable &, const Variable &)
swapvar() - swap variables x1 and x2 in f.
Definition cf_ops.cc:168
psr
CanonicalForm psr(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
homogenize
CanonicalForm homogenize(const CanonicalForm &f, const Variable &x)
homogenize homogenizes f with Variable x
Definition cf_factor.cc:317
linearSystemSolve
bool linearSystemSolve(CFMatrix &M)
Definition cf_linsys.cc:78
mapdomain
CanonicalForm mapdomain(const CanonicalForm &f, CanonicalForm(*mf)(const CanonicalForm &))
CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) ).
Definition cf_ops.cc:440
num
CanonicalForm num(const CanonicalForm &f)
Definition factory.h:478
den
CanonicalForm den(const CanonicalForm &f)
Definition factory.h:481
totaldegree
int totaldegree(const CanonicalForm &f)
int totaldegree ( const CanonicalForm & f )
Definition cf_ops.cc:523
sqrt
CanonicalForm sqrt(const CanonicalForm &a)
Definition factory.h:490
Lc
CanonicalForm Lc(const CanonicalForm &f)
Definition factory.h:448
psq
CanonicalForm psq(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
cf_algorithm.cc - simple mathematical algorithms.
Definition cf_algorithm.cc:172
operator/
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator/(const CanonicalForm &, const CanonicalForm &)
cf_HNF
CFMatrix * cf_HNF(CFMatrix &A)
The input matrix A is square matrix of integers output: the Hermite Normal Form of A; that is,...
Definition cf_hnf.cc:44
gcd_poly
CanonicalForm FACTORY_PUBLIC gcd_poly(const CanonicalForm &f, const CanonicalForm &g)
CanonicalForm gcd_poly ( const CanonicalForm & f, const CanonicalForm & g ).
Definition cf_gcd.cc:492
gf_gf2ff
long gf_gf2ff(long a)
Definition gfops.cc:209
head
CanonicalForm head(const CanonicalForm &f)
Definition factory.h:501
getGFGenerator
CanonicalForm getGFGenerator()
Definition cf_char.cc:81
reorder
CFList reorder(const Varlist &betterorder, const CFList &PS)
Definition cfCharSets.cc:101
cf_getNumBigPrimes
int FACTORY_PUBLIC cf_getNumBigPrimes()
Definition cf_primes.cc:45
power
CanonicalForm FACTORY_PUBLIC power(const CanonicalForm &f, int n)
exponentiation
Definition canonicalform.cc:1896
modCharSet
CFList modCharSet(const CFList &PS, StoreFactors &StoredFactors, bool removeContents=true)
modified medial set
Definition cfCharSets.cc:284
cf_getSmallPrime
int FACTORY_PUBLIC cf_getSmallPrime(int i)
Definition cf_primes.cc:28
prune
void FACTORY_PUBLIC prune(Variable &alpha)
Definition variable.cc:261
reduce
CanonicalForm reduce(const CanonicalForm &f, const CanonicalForm &M)
polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of...
Definition cf_ops.cc:660
euclideanNorm
CanonicalForm euclideanNorm(const CanonicalForm &f)
apply
CanonicalForm apply(const CanonicalForm &f, void(*mf)(CanonicalForm &, int &))
CanonicalForm apply ( const CanonicalForm & f, void (*mf)( CanonicalForm &, int & ) ).
Definition cf_ops.cc:402
absFactorize
CFAFList FACTORY_PUBLIC absFactorize(const CanonicalForm &G)
absolute factorization of a multivariate poly over Q
Definition facAbsFact.cc:262
cf_getBigPrime
int FACTORY_PUBLIC cf_getBigPrime(int i)
Definition cf_primes.cc:39
gmp_numerator
void FACTORY_PUBLIC gmp_numerator(const CanonicalForm &f, mpz_ptr result)
Definition singext.cc:20
factorize
CFFList FACTORY_PUBLIC factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
Definition cf_factor.cc:409
charSetViaModCharSet
CFList charSetViaModCharSet(const CFList &PS, StoreFactors &StoredFactors, bool removeContents=true)
modified characteristic set, i.e. a characteristic set with certain factors removed
Definition cfCharSets.cc:356
setMipo
void setMipo(const Variable &alpha, const CanonicalForm &mipo)
Definition variable.cc:219
factoryrandom
int factoryrandom(int n)
random integers with abs less than n
Definition cf_random.cc:177
factoryseed
void FACTORY_PUBLIC factoryseed(int s)
random seed initializer
Definition cf_random.cc:186
On
void FACTORY_PUBLIC On(int)
switches
Definition canonicalform.cc:1957
compress
CanonicalForm compress(const CanonicalForm &f, CFMap &m)
CanonicalForm compress ( const CanonicalForm & f, CFMap & m ).
Definition cf_map.cc:210
gmp_denominator
void FACTORY_PUBLIC gmp_denominator(const CanonicalForm &f, mpz_ptr result)
Definition singext.cc:40
getDefaultExtName
char getDefaultExtName()
Definition variable.cc:249
mvar
Variable mvar(const CanonicalForm &f)
Definition factory.h:475
LC
CanonicalForm LC(const CanonicalForm &f)
Definition factory.h:451
cf_getPrime
int FACTORY_PUBLIC cf_getPrime(int i)
Definition cf_primes.cc:14
ipower
int FACTORY_PUBLIC ipower(int b, int n)
int ipower ( int b, int m )
Definition cf_util.cc:27
getCharacteristic
int FACTORY_PUBLIC getCharacteristic()
Definition cf_char.cc:70
hasMipo
bool hasMipo(const Variable &alpha)
Definition variable.cc:226
chineseRemainderCached
void FACTORY_PUBLIC chineseRemainderCached(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew, CFArray &inv)
Definition cf_chinese.cc:308
gf_isff
bool gf_isff(long a)
Definition gfops.cc:253
replaceLc
CanonicalForm replaceLc(const CanonicalForm &f, const CanonicalForm &c)
Definition fac_util.cc:90
resultant
CanonicalForm FACTORY_PUBLIC resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ).
Definition cf_resultant.cc:173
factoryconf.h
factoryconf.h' serves as a configuration file for the installed source files (templates and factory....
max
static int max(int a, int b)
Definition fast_mult.cc:264
operator-
fglmVector operator-(const fglmVector &v)
Definition fglmvec.cc:398
ftmpl_afactor.h
ftmpl_array.h
ftmpl_factor.h
ftmpl_list.h
ftmpl_matrix.h
globaldefs.h
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
FACTORY_PUBLIC
#define FACTORY_PUBLIC
Definition globaldefs.h:25
OSTREAM
#define OSTREAM
CF_INLINE
#define CF_INLINE
Definition factory.h:208
CFArray
Array< CanonicalForm > CFArray
Definition factory.h:538
ISTREAM
#define ISTREAM
CF_NO_INLINE
#define CF_NO_INLINE
Definition factory.h:210
CFList
List< CanonicalForm > CFList
Definition factory.h:536
G
STATIC_VAR TreeM * G
Definition janet.cc:31
error
#define error(a)
Definition mpr_numeric.cc:966
omallocClass.h
omalloc.h
operator<<
ostream & operator<<(ostream &s, const spectrum &spec)
Definition semic.cc:249
si_log2.h
A
#define A
Definition sirandom.c:24
M
#define M
Definition sirandom.c:25
Q
#define Q
Definition sirandom.c:26
normalize
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition syz3.cc:1027