![]() |
My Project
|
‘factory.h’ is the user interface to Factory. More...
#include "factory/factoryconf.h"
#include "factory/globaldefs.h"
#include <stdint.h>
#include "factory/si_log2.h"
#include "omalloc/omalloc.h"
#include "omalloc/omallocClass.h"
#include <iostream>
#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"
Go to the source code of this file.
Data Structures | |
class | Variable |
factory's class for variables More... | |
class | CanonicalForm |
factory's main class More... | |
class | Evaluation |
class to evaluate a polynomial at points More... | |
class | CFGenerator |
virtual class for generators More... | |
class | IntGenerator |
generate integers starting from 0 More... | |
class | FFGenerator |
generate all elements in F_p starting from 0 More... | |
class | GFGenerator |
generate all elements in GF starting from 0 More... | |
class | AlgExtGenerator |
generate all elements in F_p(alpha) starting from 0 More... | |
class | CFGenFactory |
class | CFIterator |
class to iterate through CanonicalForm's More... | |
class | CFRandom |
virtual class for random element generation More... | |
class | GFRandom |
generate random elements in GF More... | |
class | FFRandom |
generate random elements in F_p More... | |
class | IntRandom |
generate random integers More... | |
class | AlgExtRandomF |
generate random elements in F_p(alpha) More... | |
class | CFRandomFactory |
class | modpk |
class to do operations mod p^k for int's p and k More... | |
class | MapPair |
class MapPair More... | |
class | CFMap |
class CFMap More... | |
class | REvaluation |
class to generate random evaluation points More... | |
class | StoreFactors |
class to store factors that get removed during char set computation More... | |
Macros | |
#define | OSTREAM std::ostream |
#define | ISTREAM std::istream |
#define | LEVELBASE -1000000 |
#define | LEVELTRANS -500000 |
#define | LEVELQUOT 1000000 |
#define | LEVELEXPR 1000001 |
#define | CF_INLINE |
#define | CF_NO_INLINE |
#define | CF_INLINE |
#define | CF_NO_INLINE |
Typedefs | |
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 |
typedef term * | termList |
typedef List< MapPair > | MPList |
typedef ListIterator< MapPair > | MPListIterator |
Variables | |
const char | factoryConfiguration [] |
static const int | SW_RATIONAL = 0 |
set to 1 for computations over Q More... | |
static const int | SW_SYMMETRIC_FF = 1 |
set to 1 for symmetric representation over F_q More... | |
static const int | SW_USE_EZGCD = 2 |
set to 1 to use EZGCD over Z More... | |
static const int | SW_USE_EZGCD_P = 3 |
set to 1 to use EZGCD over F_q More... | |
static const int | SW_USE_NTL_SORT =4 |
set to 1 to sort factors in a factorization More... | |
static const int | SW_USE_CHINREM_GCD =5 |
set to 1 to use modular gcd over Z More... | |
static const int | SW_USE_QGCD =6 |
set to 1 to use Encarnacion GCD over Q(a) More... | |
static const int | SW_USE_FF_MOD_GCD =7 |
set to 1 to use modular GCD over F_q More... | |
static const int | SW_USE_FL_GCD_P =8 |
set to 1 to use Flints gcd over F_p More... | |
static const int | SW_USE_FL_GCD_0 =9 |
set to 1 to use Flints gcd over Q/Z More... | |
static const int | SW_BERLEKAMP =10 |
set to 1 to use Factorys Berlekamp alg. More... | |
static const int | SW_FAC_QUADRATICLIFT =11 |
static const int | SW_USE_FL_FAC_P =12 |
set to 1 to prefer flints multivariate factorization over Z/p More... | |
static const int | SW_USE_FL_FAC_0 =13 |
set to 1 to prefer flints multivariate factorization over Z/p More... | |
static const int | SW_USE_FL_FAC_0A =14 |
set to 1 to prefer flints multivariate factorization over Z/p(a) More... | |
EXTERN_VAR int | singular_homog_flag |
EXTERN_VAR void(* | factoryError )(const char *s) |
‘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.
Definition in file factory.h.
typedef AFactor<CanonicalForm> CFAFactor |
typedef ListIterator<CFAFactor> CFAFListIterator |
typedef Array<CanonicalForm> CFArray |
typedef Factor<CanonicalForm> CFFactor |
typedef ListIterator<CFFactor> CFFListIterator |
typedef List<CanonicalForm> CFList |
typedef ListIterator<CanonicalForm> CFListIterator |
typedef Matrix<CanonicalForm> CFMatrix |
typedef ListIterator<int> IntListIterator |
typedef List<CFList> ListCFList |
typedef ListIterator<CFList> ListCFListIterator |
typedef ListIterator<MapPair> MPListIterator |
typedef ListIterator<Variable> VarlistIterator |
|
inline |
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.
f: CurrentPP
Definition at line 638 of file factory.h.
CFAFList FACTORY_PUBLIC absFactorize | ( | const CanonicalForm & | G | ) |
absolute factorization of a multivariate poly over Q
[in] | G | poly over Q |
Definition at line 262 of file facAbsFact.cc.
CanonicalForm apply | ( | const CanonicalForm & | f, |
void(*)(CanonicalForm &, int &) | mf | ||
) |
CanonicalForm apply ( const CanonicalForm & f, void (*mf)( CanonicalForm &, int & ) )
apply() - apply mf to terms of f.
Calls mf( f[i], i ) for each term f[i]*x^i of f and builds a new term from the result. If f is in a coefficient domain, mf( f, i ) should result in an i == 0, since otherwise it is not clear which variable to use for the resulting term.
An example:
Then apply( f, diff ) is differentation of f with respect to the main variable of f.
Definition at line 402 of file cf_ops.cc.
basic set in the sense of Wang a.k.a. minimal ascending set in the sense of Greuel/Pfister
Definition at line 150 of file cfCharSets.cc.
CanonicalForm FACTORY_PUBLIC bCommonDen | ( | const CanonicalForm & | f | ) |
CanonicalForm bCommonDen ( const CanonicalForm & f )
bCommonDen() - calculate multivariate common denominator of coefficients of ‘f’.
The common denominator is calculated with respect to all coefficients of ‘f’ which are in a base domain. In other words, common_den( ‘f’ ) * ‘f’ is guaranteed to have integer coefficients only. The common denominator of zero is one.
Returns something non-trivial iff the current domain is Q.
f: CurrentPP
Definition at line 293 of file cf_algorithm.cc.
CanonicalForm FACTORY_PUBLIC blcm | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
Definition at line 1816 of file canonicalform.cc.
int FACTORY_PUBLIC cf_getBigPrime | ( | int | i | ) |
Definition at line 39 of file cf_primes.cc.
int FACTORY_PUBLIC cf_getNumBigPrimes | ( | ) |
Definition at line 45 of file cf_primes.cc.
int FACTORY_PUBLIC cf_getNumPrimes | ( | ) |
Definition at line 23 of file cf_primes.cc.
int FACTORY_PUBLIC cf_getNumSmallPrimes | ( | ) |
Definition at line 34 of file cf_primes.cc.
int FACTORY_PUBLIC cf_getPrime | ( | int | i | ) |
Definition at line 14 of file cf_primes.cc.
int FACTORY_PUBLIC cf_getSmallPrime | ( | int | i | ) |
Definition at line 28 of file cf_primes.cc.
CFMatrix *FACTORY_PUBLIC cf_HNF | ( | CFMatrix & | A | ) |
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.
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.
W is computed as the Hermite Normal Form of A; that is, W is the unique m x m matrix whose rows span L, such that
Definition at line 44 of file cf_hnf.cc.
CFMatrix *FACTORY_PUBLIC cf_LLL | ( | 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.
Definition at line 66 of file cf_hnf.cc.
ListCFList charSeries | ( | const CFList & | L | ) |
characteristic series
Definition at line 411 of file cfCharSets.cc.
characteristic set
Definition at line 187 of file cfCharSets.cc.
medial set
Definition at line 216 of file cfCharSets.cc.
compute a characteristic set via medial set
Definition at line 246 of file cfCharSets.cc.
modified characteristic set, i.e. a characteristic set with certain factors removed
Definition at line 397 of file cfCharSets.cc.
CFList charSetViaModCharSet | ( | const CFList & | PS, |
StoreFactors & | StoredFactors, | ||
bool | removeContents | ||
) |
modified characteristic set, i.e. a characteristic set with certain factors removed
modified characteristic set, i.e. a characteristic set with certain factors removed
Definition at line 356 of file cfCharSets.cc.
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, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew )
chineseRemainder - integer chinese remaindering.
Calculate xnew such that xnew=x1 (mod q1) and xnew=x2 (mod q2) and qnew = q1*q2. q1 and q2 should be positive integers, pairwise prime, x1 and x2 should be polynomials with integer coefficients. If x1 and x2 are polynomials with positive coefficients, the result is guaranteed to have positive coefficients, too.
Note: This algorithm is optimized for the case q1>>q2.
This is a standard algorithm. See, for example, Geddes/Czapor/Labahn - 'Algorithms for Computer Algebra', par. 5.6 and 5.8, or the article of M. Lauer - 'Computing by Homomorphic Images' in B. Buchberger - 'Computer Algebra - Symbolic and Algebraic Computation'.
Note: Be sure you are calculating in Z, and not in Q!
Definition at line 57 of file cf_chinese.cc.
void FACTORY_PUBLIC chineseRemainder | ( | const CFArray & | x, |
const CFArray & | q, | ||
CanonicalForm & | xnew, | ||
CanonicalForm & | qnew | ||
) |
void chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew )
chineseRemainder - integer chinese remaindering.
Calculate xnew such that xnew=x[i] (mod q[i]) and qnew is the product of all q[i]. q[i] should be positive integers, pairwise prime. x[i] should be polynomials with integer coefficients. If all coefficients of all x[i] are positive integers, the result is guaranteed to have positive coefficients, too.
This is a standard algorithm, too, except for the fact that we use a divide-and-conquer method instead of a linear approach to calculate the remainder.
Note: Be sure you are calculating in Z, and not in Q!
Definition at line 124 of file cf_chinese.cc.
void FACTORY_PUBLIC chineseRemainderCached | ( | const CanonicalForm & | x1, |
const CanonicalForm & | q1, | ||
const CanonicalForm & | x2, | ||
const CanonicalForm & | q2, | ||
CanonicalForm & | xnew, | ||
CanonicalForm & | qnew, | ||
CFArray & | inv | ||
) |
Definition at line 308 of file cf_chinese.cc.
void FACTORY_PUBLIC chineseRemainderCached | ( | const CFArray & | a, |
const CFArray & | n, | ||
CanonicalForm & | xnew, | ||
CanonicalForm & | prod, | ||
CFArray & | inv | ||
) |
Definition at line 290 of file cf_chinese.cc.
CanonicalForm compress | ( | const CanonicalForm & | f, |
CFMap & | m | ||
) |
CanonicalForm compress ( const CanonicalForm & f, CFMap & m )
compress() - compress the canonical form f.
Compress the polynomial f such that the levels of its polynomial variables are ordered without any gaps starting from level 1. Return the compressed polynomial and a map m to undo the compression. That is, if f' = compress(f, m), than f = m(f').
Definition at line 210 of file cf_map.cc.
void compress | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
CFMap & | M, | ||
CFMap & | N | ||
) |
void compress ( const CanonicalForm & f, const CanonicalForm & g, CFMap & M, CFMap & N )
compress() - compress the variables occurring in f and g with respect to optimal variables
Compress the polynomial variables occurring in f and g so that the levels of variables common to f and g are ordered without any gaps starting from level 1, whereas the variables occuring in only one of f or g are moved to levels higher than the levels of the common variables. Return the CFMap M to realize the compression and its inverse, the CFMap N. N needs only variables common to f and g.
Definition at line 349 of file cf_map.cc.
void compress ( const CFArray & a, CFMap & M, CFMap & N )
compress() - compress the variables occuring in an a.
Compress the polynomial variables occuring in a so that their levels are ordered without any gaps starting from level 1. Return the CFMap M to realize the compression and its inverse, the CFMap N. Note that if you compress a member of a using M the result of the compression is not necessarily compressed, since the map is constructed using all variables occuring in a.
Definition at line 245 of file cf_map.cc.
CanonicalForm FACTORY_PUBLIC content | ( | const CanonicalForm & | f | ) |
CanonicalForm content ( const CanonicalForm & f )
content() - return content(f) with respect to main variable.
Normalizes result.
CanonicalForm FACTORY_PUBLIC content | ( | const CanonicalForm & | f, |
const Variable & | x | ||
) |
CanonicalForm content ( const CanonicalForm & f, const Variable & x )
content() - return content(f) with respect to x.
x should be a polynomial variable.
Definition at line 629 of file cf_gcd.cc.
|
inline |
|
inline |
int * degrees | ( | const CanonicalForm & | f, |
int * | degs | ||
) |
int * degrees ( const CanonicalForm & f, int * degs )
degress() - return the degrees of all polynomial variables in f.
Returns 0 if f is in a coefficient domain, the degrees of f in all its polynomial variables in an array of int otherwise:
degrees( f, 0 )[i] = degree( f, Variable(i) )
If degs is not the zero pointer the degrees are stored in this array. In this case degs should be larger than the level of f. If degs is the zero pointer, an array of sufficient size is allocated automatically.
Definition at line 493 of file cf_ops.cc.
|
inline |
|
inline |
CanonicalForm FACTORY_PUBLIC determinant | ( | const CFMatrix & | M, |
int | n | ||
) |
Definition at line 222 of file cf_linsys.cc.
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm div | ( | const CanonicalForm & | , |
const CanonicalForm & | |||
) |
CanonicalForm euclideanNorm | ( | const CanonicalForm & | f | ) |
CanonicalForm euclideanNorm ( const CanonicalForm & f )
euclideanNorm() - return Euclidean norm of ‘f’.
Returns the largest integer smaller or equal norm(‘f’) = sqrt(sum( ‘f’[i]^2 )).
f: UVPoly( Z )
Definition at line 565 of file cf_algorithm.cc.
int ExtensionLevel | ( | ) |
Definition at line 254 of file variable.cc.
CanonicalForm FACTORY_PUBLIC extgcd | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
CanonicalForm & | a, | ||
CanonicalForm & | b | ||
) |
CanonicalForm extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a, CanonicalForm & b )
extgcd() - returns polynomial extended gcd of f and g.
Returns gcd(f, g) and a and b sucht that f*a+g*b=gcd(f, g). The gcd is calculated using an extended euclidean polynomial remainder sequence, so f and g should be polynomials over an euclidean domain. Normalizes result.
Note: be sure that f and g have the same level!
Definition at line 174 of file cfUnivarGcd.cc.
CFFList facAlgFunc | ( | const CanonicalForm & | f, |
const CFList & | as | ||
) |
factorize a polynomial f modulo an extension given by an irreducible characteristic set as, f is assumed to be integral, i.e. , and each element of as is assumed to be integral as well.
must be either
or
.
factorize a polynomial f modulo an extension given by an irreducible characteristic set as, f is assumed to be integral, i.e. , and each element of as is assumed to be integral as well.
must be either
or
.
[in] | f | univariate poly |
[in] | as | irreducible characteristic set |
Definition at line 1043 of file facAlgFunc.cc.
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 irreducible characteristic set as, f is assumed to be integral, i.e. , and each element of as is assumed to be integral as well.
must be either
or
.
factorize a polynomial f that is irreducible over the ground field modulo an extension given by an irreducible characteristic set as, f is assumed to be integral, i.e. , and each element of as is assumed to be integral as well.
must be either
or
.
[in] | f | univariate poly |
[in] | as | irreducible characteristic set |
Definition at line 905 of file facAlgFunc.cc.
CFFList FACTORY_PUBLIC factorize | ( | const CanonicalForm & | f, |
bool | issqrfree = false |
||
) |
factorization over or
Definition at line 405 of file cf_factor.cc.
CFFList FACTORY_PUBLIC factorize | ( | const CanonicalForm & | f, |
const Variable & | alpha | ||
) |
factorization over or
Definition at line 774 of file cf_factor.cc.
void factoryError_intern | ( | const char * | s | ) |
Definition at line 75 of file cf_util.cc.
int factoryrandom | ( | int | n | ) |
random integers with abs less than n
Definition at line 180 of file cf_random.cc.
void FACTORY_PUBLIC factoryseed | ( | int | s | ) |
random seed initializer
Definition at line 189 of file cf_random.cc.
CanonicalForm Farey | ( | const CanonicalForm & | f, |
const CanonicalForm & | q | ||
) |
Farey rational reconstruction.
If NTL is available it uses the fast algorithm from NTL, i.e. Encarnacion, Collins.
Definition at line 202 of file cf_chinese.cc.
bool fdivides | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
bool fdivides ( const CanonicalForm & f, const CanonicalForm & g )
fdivides() - check whether ‘f’ divides ‘g’.
Returns true iff ‘f’ divides ‘g’. Uses some extra heuristic to avoid polynomial division. Without the heuristic, the test essentialy looks like ‘divremt(g, f, q, r) && r.isZero()’.
f, g: Current
Elements from prime power domains (or polynomials over such domains) are admissible if ‘f’ (or lc(‘f’), resp.) is not a zero divisor. This is a slightly stronger precondition than mathematically necessary since divisibility is a well-defined notion in arbitrary rings. Hence, we decided not to declare the weaker type ‘CurrentPP’.
One may consider the the test ‘fdivides( f.LC(), g.LC() )’ in the main ‘if’-test superfluous since ‘divremt()’ in the ‘if’-body repeats the test. However, ‘divremt()’ does not use any heuristic to do so.
It seems not reasonable to call ‘fdivides()’ from ‘divremt()’ to check divisibility of leading coefficients. ‘fdivides()’ is on a relatively high level compared to ‘divremt()’.
Definition at line 340 of file cf_algorithm.cc.
bool fdivides | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
CanonicalForm & | quot | ||
) |
same as fdivides if true returns quotient quot of g by f otherwise quot == 0
Definition at line 390 of file cf_algorithm.cc.
CanonicalForm FACTORY_PUBLIC gcd | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
Definition at line 685 of file cf_gcd.cc.
CanonicalForm FACTORY_PUBLIC gcd_poly | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
CanonicalForm gcd_poly ( const CanonicalForm & f, const CanonicalForm & g )
gcd_poly() - calculate polynomial gcd.
This is the dispatcher for polynomial gcd calculation. Different gcd variants get called depending the input, characteristic, and on switches (cf_defs.h)
With the current settings from Singular (i.e. SW_USE_EZGCD= on, SW_USE_EZGCD_P= on, SW_USE_CHINREM_GCD= on, the EZ GCD variants are the default algorithms for multivariate polynomial GCD computations)
Definition at line 492 of file cf_gcd.cc.
Variable get_max_degree_Variable | ( | const CanonicalForm & | f | ) |
get_max_degree_Variable returns Variable with highest degree.
We assume f is not a constant!
Definition at line 260 of file cf_factor.cc.
CFList get_Terms | ( | const CanonicalForm & | f | ) |
Definition at line 289 of file cf_factor.cc.
int FACTORY_PUBLIC getCharacteristic | ( | ) |
Definition at line 70 of file cf_char.cc.
char getDefaultExtName | ( | ) |
Definition at line 249 of file variable.cc.
char getDefaultVarName | ( | ) |
Definition at line 244 of file variable.cc.
int getGFDegree | ( | ) |
Definition at line 75 of file cf_char.cc.
CanonicalForm getGFGenerator | ( | ) |
Definition at line 81 of file cf_char.cc.
CanonicalForm getMipo | ( | const Variable & | alpha, |
const Variable & | x | ||
) |
Definition at line 207 of file variable.cc.
int getNumVars | ( | const CanonicalForm & | f | ) |
int getNumVars ( const CanonicalForm & f )
getNumVars() - get number of polynomial variables in f.
Definition at line 314 of file cf_ops.cc.
void getTerms | ( | const CanonicalForm & | f, |
const CanonicalForm & | t, | ||
CFList & | result | ||
) |
get_Terms: Split the polynomial in the containing terms.
getTerms: the real work is done here.
Definition at line 279 of file cf_factor.cc.
CanonicalForm getVars | ( | const CanonicalForm & | f | ) |
CanonicalForm getVars ( const CanonicalForm & f )
getVars() - get polynomial variables of f.
Return the product of all of them, 1 if there are not any.
Definition at line 350 of file cf_ops.cc.
int gf_gf2ff | ( | int | a | ) |
Definition at line 231 of file gfops.cc.
long gf_gf2ff | ( | long | a | ) |
Definition at line 209 of file gfops.cc.
bool gf_isff | ( | int | a | ) |
bool gf_isff | ( | long | a | ) |
int gf_value | ( | const CanonicalForm & | f | ) |
Definition at line 60 of file singext.cc.
void FACTORY_PUBLIC gmp_denominator | ( | const CanonicalForm & | f, |
mpz_ptr | result | ||
) |
Definition at line 40 of file singext.cc.
void FACTORY_PUBLIC gmp_numerator | ( | const CanonicalForm & | f, |
mpz_ptr | result | ||
) |
Definition at line 20 of file singext.cc.
bool hasFirstAlgVar | ( | const CanonicalForm & | f, |
Variable & | a | ||
) |
check if poly f contains an algebraic variable a
Definition at line 679 of file cf_ops.cc.
|
inline |
|
inline |
Definition at line 510 of file factory.h.
CanonicalForm homogenize | ( | const CanonicalForm & | f, |
const Variable & | x | ||
) |
homogenize homogenizes f with Variable x
Definition at line 313 of file cf_factor.cc.
CanonicalForm homogenize | ( | const CanonicalForm & | f, |
const Variable & | x, | ||
const Variable & | v1, | ||
const Variable & | v2 | ||
) |
Definition at line 353 of file cf_factor.cc.
CanonicalForm FACTORY_PUBLIC icontent | ( | const CanonicalForm & | f | ) |
CanonicalForm icontent ( const CanonicalForm & f )
icontent() - return gcd over all coefficients of f which are in a coefficient domain.
Definition at line 74 of file cf_gcd.cc.
int igcd | ( | int | a, |
int | b | ||
) |
|
inline |
int FACTORY_PUBLIC ipower | ( | int | b, |
int | m | ||
) |
int ipower ( int b, int m )
ipower() - calculate b^m in standard integer arithmetic.
Note: Beware of overflows.
Definition at line 27 of file cf_util.cc.
ListCFList FACTORY_PUBLIC irrCharSeries | ( | const CFList & | PS | ) |
irreducible characteristic series
Definition at line 568 of file cfCharSets.cc.
|
inline |
bool FACTORY_PUBLIC isOn | ( | int | sw | ) |
bool isPurePoly | ( | const CanonicalForm & | f | ) |
Definition at line 244 of file cf_factor.cc.
bool isPurePoly_m | ( | const CanonicalForm & | f | ) |
Definition at line 234 of file cf_factor.cc.
|
inline |
|
inline |
|
inline |
|
inline |
CanonicalForm FACTORY_PUBLIC lcm | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
CanonicalForm lcm ( const CanonicalForm & f, const CanonicalForm & g )
lcm() - return least common multiple of f and g.
The lcm is calculated using the formula lcm(f, g) = f * g / gcd(f, g).
Returns zero if one of f or g equals zero.
CanonicalForm leftShift | ( | const CanonicalForm & | F, |
int | n | ||
) |
|
inline |
bool linearSystemSolve | ( | CFMatrix & | M | ) |
Definition at line 78 of file cf_linsys.cc.
CanonicalForm FACTORY_PUBLIC make_cf | ( | const mpz_ptr | n | ) |
Definition at line 66 of file singext.cc.
CanonicalForm FACTORY_PUBLIC make_cf | ( | const mpz_ptr | n, |
const mpz_ptr | d, | ||
bool | normalize | ||
) |
Definition at line 71 of file singext.cc.
CanonicalForm make_cf_from_gf | ( | const int | z | ) |
Definition at line 76 of file singext.cc.
CanonicalForm mapdomain | ( | const CanonicalForm & | f, |
CanonicalForm(*)(const CanonicalForm &) | mf | ||
) |
CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) )
mapdomain() - map all coefficients of f through mf.
Recursively descends down through f to the coefficients which are in a coefficient domain mapping each such coefficient through mf and returns the result.
Definition at line 440 of file cf_ops.cc.
|
inline |
CanonicalForm maxNorm | ( | const CanonicalForm & | f | ) |
CanonicalForm maxNorm ( const CanonicalForm & f )
maxNorm() - return maximum norm of ‘f’.
That is, the base coefficient of ‘f’ with the largest absolute value.
Valid for arbitrary polynomials over arbitrary domains, but most useful for multivariate polynomials over Z.
f: CurrentPP
Definition at line 536 of file cf_algorithm.cc.
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm mod | ( | const CanonicalForm & | , |
const CanonicalForm & | |||
) |
Definition at line 404 of file cfCharSets.cc.
CFList modCharSet | ( | const CFList & | PS, |
StoreFactors & | StoredFactors, | ||
bool | removeContents = true |
||
) |
modified medial set
Definition at line 284 of file cfCharSets.cc.
|
inline |
Definition at line 75 of file cfCharSets.cc.
IntList FACTORY_PUBLIC neworderint | ( | const CFList & | PolyList | ) |
|
inline |
void FACTORY_PUBLIC Off | ( | int | sw | ) |
void FACTORY_PUBLIC On | ( | int | sw | ) |
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator% | ( | const CanonicalForm & | , |
const CanonicalForm & | |||
) |
CF_INLINE CanonicalForm operator* | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
Definition at line 524 of file cf_inline.cc.
CF_INLINE CanonicalForm operator+ | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
CF_INLINE CanonicalForm operator +, -, *, /, % ( const CanonicalForm & lhs, const CanonicalForm & rhs )
operators +, -, *, /, %(), div(), mod() - binary arithmetic operators.
The binary operators have their standard (mathematical) semantics. As explained for the corresponding arithmetic assignment operators, the operators ‘/’ and ‘%’ return the quotient resp. remainder of (polynomial) division with remainder, whereas ‘div()’ and ‘mod()’ may be used for exact division and term-wise remaindering, resp.
It is faster to use the arithmetic assignment operators (e.g., ‘f += g;’) instead of the binary operators (‘f = f+g;’ ).
lhs, rhs: CurrentPP
There are weaker preconditions for some cases (e.g., arithmetic operations with elements from Q or Z work in any domain), but type ‘CurrentPP’ is the only one guaranteed to work for all cases.
All binary operators have their corresponding ‘CanonicalForm’ assignment operators (e.g., ‘operator +()’ corresponds to ‘CanonicalForm::operator +=()’, ‘div()’ corresponds to `CanonicalFormdiv()).
And that is how they are implemented, too: Each of the binary operators first creates a copy of ‘lhs’, adds ‘rhs’ to this copy using the assignment operator, and returns the result.
Definition at line 503 of file cf_inline.cc.
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator- | ( | const CanonicalForm & | , |
const CanonicalForm & | |||
) |
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm operator/ | ( | const CanonicalForm & | , |
const CanonicalForm & | |||
) |
CanonicalForm FACTORY_PUBLIC power | ( | const CanonicalForm & | f, |
int | n | ||
) |
exponentiation
Definition at line 1896 of file canonicalform.cc.
CanonicalForm FACTORY_PUBLIC power | ( | const Variable & | v, |
int | n | ||
) |
exponentiation
Definition at line 1939 of file canonicalform.cc.
CanonicalForm FACTORY_PUBLIC pp | ( | const CanonicalForm & | f | ) |
CanonicalForm pp ( const CanonicalForm & f )
pp() - return primitive part of f.
Returns zero if f equals zero, otherwise f / content(f).
CanonicalForm Prem | ( | const CanonicalForm & | F, |
const CanonicalForm & | G | ||
) |
pseudo remainder of F by G with certain factors of LC (g) cancelled
Definition at line 616 of file cfCharSetsUtil.cc.
int FACTORY_PUBLIC probIrredTest | ( | const CanonicalForm & | F, |
double | error | ||
) |
given some error probIrredTest detects irreducibility or reducibility of F with confidence level 1-error
[in] | F | some poly over Z/p |
[in] | error | 0 < error < 1 |
Definition at line 63 of file facIrredTest.cc.
void FACTORY_PUBLIC prune | ( | Variable & | alpha | ) |
Definition at line 261 of file variable.cc.
Definition at line 291 of file variable.cc.
CanonicalForm psq | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
const Variable & | x | ||
) |
CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
psq() - return pseudo quotient of ‘f’ and ‘g’ with respect to ‘x’.
‘g’ must not equal zero.
f, g: Current x: Polynomial
This is not an optimal implementation. Better would have been an implementation in ‘InternalPoly’ avoiding the exponentiation of the leading coefficient of ‘g’. It seemed not worth to do so.
Definition at line 172 of file cf_algorithm.cc.
void psqr | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
CanonicalForm & | q, | ||
CanonicalForm & | r, | ||
const Variable & | x | ||
) |
void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x )
psqr() - calculate pseudo quotient and remainder of ‘f’ and ‘g’ with respect to ‘x’.
Returns the pseudo quotient of ‘f’ and ‘g’ in ‘q’, the pseudo remainder in ‘r’. ‘g’ must not equal zero.
See ‘psr()’ for more detailed information.
f, g: Current q, r: Anything x: Polynomial
This is not an optimal implementation. Better would have been an implementation in ‘InternalPoly’ avoiding the exponentiation of the leading coefficient of ‘g’. It seemed not worth to do so.
Definition at line 223 of file cf_algorithm.cc.
CanonicalForm psr | ( | const CanonicalForm & | rr, |
const CanonicalForm & | vv, | ||
const Variable & | x | ||
) |
CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
psr() - return pseudo remainder of ‘f’ and ‘g’ with respect to ‘x’.
‘g’ must not equal zero.
For f and g in R[x], R an arbitrary ring, g != 0, there is a representation
LC(g)^s*f = g*q + r
with r = 0 or deg(r) < deg(g) and s = 0 if f = 0 or s = max( 0, deg(f)-deg(g)+1 ) otherwise. r = psr(f, g) and q = psq(f, g) are called "pseudo remainder" and "pseudo quotient", resp. They are uniquely determined if LC(g) is not a zero divisor in R.
See H.-J. Reiffen/G. Scheja/U. Vetter - "Algebra", 2nd ed., par. 15, for a reference.
f, g: Current x: Polynomial
Polynomials over prime power domains are admissible if lc(LC(‘g’,‘x’)) is not a zero divisor. This is a slightly stronger precondition than mathematically necessary since pseudo remainder and quotient are well-defined if LC(‘g’,‘x’) is not a zero divisor.
For example, psr(y^2, (13*x+1)*y) is well-defined in (Z/13^2[x])[y] since (13*x+1) is not a zero divisor. But calculating it with Factory would fail since 13 is a zero divisor in Z/13^2.
Due to this inconsistency with mathematical notion, we decided not to declare type ‘CurrentPP’ for ‘f’ and ‘g’.
This is not an optimal implementation. Better would have been an implementation in ‘InternalPoly’ avoiding the exponentiation of the leading coefficient of ‘g’. In contrast to ‘psq()’ and ‘psqr()’ it definitely seems worth to implement the pseudo remainder on the internal level.
Definition at line 117 of file cf_algorithm.cc.
CanonicalForm reduce | ( | const CanonicalForm & | f, |
const CanonicalForm & | M | ||
) |
polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of f are reduced modulo M
Definition at line 660 of file cf_ops.cc.
Definition at line 120 of file cfCharSets.cc.
Definition at line 101 of file cfCharSets.cc.
ListCFList reorder | ( | const Varlist & | betterorder, |
const ListCFList & | Q | ||
) |
Definition at line 140 of file cfCharSets.cc.
CanonicalForm replaceLc | ( | const CanonicalForm & | f, |
const CanonicalForm & | c | ||
) |
CanonicalForm FACTORY_PUBLIC replacevar | ( | const CanonicalForm & | f, |
const Variable & | x1, | ||
const Variable & | x2 | ||
) |
CanonicalForm replacevar ( const CanonicalForm & f, const Variable & x1, const Variable & x2 )
replacevar() - replace all occurences of x1 in f by x2.
In contrast to swapvar(), x1 may be an algebraic variable, but x2 must be a polynomial variable.
Definition at line 271 of file cf_ops.cc.
CanonicalForm FACTORY_PUBLIC resultant | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
const Variable & | x | ||
) |
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
resultant() - return resultant of f and g with respect to x.
The chain is calculated from f and g with respect to variable x which should not be an algebraic variable. If f or q equals zero, zero is returned. If f is a coefficient with respect to x, f^degree(g, x) is returned, analogously for g.
This algorithm serves as a wrapper around other resultant algorithms which do the real work. Here we use standard properties of resultants only.
Definition at line 173 of file cf_resultant.cc.
CanonicalForm resultantZ | ( | const CanonicalForm & | A, |
const CanonicalForm & | B, | ||
const Variable & | x, | ||
bool | prob = true |
||
) |
modular resultant algorihtm over Z
[in] | A | some poly |
[in] | B | some poly |
[in] | x | some polynomial variable |
[in] | prob | if true use probabilistic algorithm |
Definition at line 559 of file cfModResultant.cc.
Variable FACTORY_PUBLIC rootOf | ( | const CanonicalForm & | mipo, |
char | name | ||
) |
returns a symbolic root of polynomial with name name Use it to define algebraic variables
returns a symbolic root of polynomial with name name.
Use it to define algebraic variables
Definition at line 162 of file variable.cc.
void FACTORY_PUBLIC setCharacteristic | ( | int | c | ) |
Definition at line 28 of file cf_char.cc.
void setCharacteristic | ( | int | c, |
int | n | ||
) |
void setCharacteristic | ( | int | c, |
int | n, | ||
char | name | ||
) |
Definition at line 61 of file cf_char.cc.
void setMipo | ( | const Variable & | alpha, |
const CanonicalForm & | mipo | ||
) |
Definition at line 219 of file variable.cc.
Definition at line 238 of file variable.cc.
|
inline |
int size | ( | const CanonicalForm & | f | ) |
int size ( const CanonicalForm & f )
size() - return number of monomials in f which are in an coefficient domain.
Returns one if f is in an coefficient domain.
Definition at line 627 of file cf_ops.cc.
int size | ( | const CanonicalForm & | f, |
const Variable & | v | ||
) |
int size ( const CanonicalForm & f, const Variable & v )
size() - count number of monomials of f with level higher or equal than level of v.
Returns one if f is in an base domain.
Definition at line 600 of file cf_ops.cc.
int size_maxexp | ( | const CanonicalForm & | f, |
int & | maxexp | ||
) |
CFFList FACTORY_PUBLIC sqrFree | ( | const CanonicalForm & | f, |
bool | sort = false |
||
) |
squarefree factorization
Definition at line 957 of file cf_factor.cc.
|
inline |
Definition at line 490 of file factory.h.
CFArray subResChain | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
const Variable & | x | ||
) |
CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x )
subResChain() - caculate extended subresultant chain.
The chain is calculated from f and g with respect to variable x which should not be an algebraic variable. If f or q equals zero, an array consisting of one zero entry is returned.
Note: this is not the standard subresultant chain but the extended chain!
This algorithm is from the article of R. Loos - 'Generalized Polynomial Remainder Sequences' in B. Buchberger - 'Computer Algebra - Symbolic and Algebraic Computation' with some necessary extensions concerning the calculation of the first step.
Definition at line 42 of file cf_resultant.cc.
CanonicalForm FACTORY_PUBLIC swapvar | ( | const CanonicalForm & | f, |
const Variable & | x1, | ||
const Variable & | x2 | ||
) |
swapvar() - swap variables x1 and x2 in f.
Returns the image of f under the map which maps x1 to x2 and x2 to x1. This is done quite efficiently because it is used really often. x1 and x2 should be polynomial variables.
Definition at line 168 of file cf_ops.cc.
|
inline |
|
inline |
|
inline |
int totaldegree | ( | const CanonicalForm & | f | ) |
int totaldegree ( const CanonicalForm & f )
totaldegree() - return the total degree of f.
If f is zero, return -1. If f is in a coefficient domain, return 0. Otherwise return the total degree of f in all polynomial variables.
Definition at line 523 of file cf_ops.cc.
int totaldegree ( const CanonicalForm & f, const Variable & v1, const Variable & v2 )
totaldegree() - return the total degree of f as a polynomial in the polynomial variables between v1 and v2 (inclusively).
If f is zero, return -1. If f is in a coefficient domain, return 0. Also, return 0 if v1 > v2. Otherwise, take f to be a polynomial in the polynomial variables between v1 and v2 and return its total degree.
Definition at line 554 of file cf_ops.cc.
bool tryFdivides | ( | const CanonicalForm & | f, |
const CanonicalForm & | g, | ||
const CanonicalForm & | M, | ||
bool & | fail | ||
) |
same as fdivides but handles zero divisors in Z_p[t]/(f)[x1,...,xn] for reducible f
Definition at line 456 of file cf_algorithm.cc.
CanonicalForm FACTORY_PUBLIC vcontent | ( | const CanonicalForm & | f, |
const Variable & | x | ||
) |
CanonicalForm vcontent ( const CanonicalForm & f, const Variable & x )
vcontent() - return content of f with repect to variables >= x.
The content is recursively calculated over all coefficients in f having level less than x. x should be a polynomial variable.
Definition at line 653 of file cf_gcd.cc.
|
extern |
EXTERN_VAR void(* factoryError) (const char *s) | ( | const char * | s | ) |
EXTERN_VAR int singular_homog_flag |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |