My Project
|
This file implements functions for factoring a multivariate polynomial over a finite field. More...
#include "config.h"
#include "cf_assert.h"
#include "debug.h"
#include "timing.h"
#include "facFqFactorizeUtil.h"
#include "facFqFactorize.h"
#include "cf_random.h"
#include "facHensel.h"
#include "cf_irred.h"
#include "cf_map_ext.h"
#include "facSparseHensel.h"
#include "facMul.h"
#include "cfUnivarGcd.h"
Go to the source code of this file.
Macros | |
#define | CHAR_THRESHOLD 8 |
Functions | |
TIMING_DEFINE_PRINT (fac_fq_bi_factorizer) TIMING_DEFINE_PRINT(fac_fq_hensel_lift) TIMING_DEFINE_PRINT(fac_fq_factor_recombination) TIMING_DEFINE_PRINT(fac_fq_shift_to_zero) TIMING_DEFINE_PRINT(fac_fq_precompute_leadcoeff) TIMING_DEFINE_PRINT(fac_fq_evaluation) TIMING_DEFINE_PRINT(fac_fq_recover_factors) TIMING_DEFINE_PRINT(fac_fq_preprocess_and_content) TIMING_DEFINE_PRINT(fac_fq_bifactor_total) TIMING_DEFINE_PRINT(fac_fq_luckswang) TIMING_DEFINE_PRINT(fac_fq_lcheuristic) TIMING_DEFINE_PRINT(fac_fq_content) TIMING_DEFINE_PRINT(fac_fq_check_mainvar) TIMING_DEFINE_PRINT(fac_fq_compress) static inline CanonicalForm listGCD(const CFList &L) | |
static CanonicalForm | myContent (const CanonicalForm &F) |
static CanonicalForm | listGCD (const CFList &L) |
static CanonicalForm | myContent (const CanonicalForm &F, const Variable &x) |
CanonicalForm | myCompress (const CanonicalForm &F, CFMap &N) |
compress a polynomial s.t. and no gaps between the variables occur More... | |
CFList | extFactorRecombination (const CFList &factors, const CanonicalForm &F, const CFList &M, const ExtensionInfo &info, const CFList &evaluation) |
Naive factor recombination for multivariate factorization over an extension of the initial field. No precomputed is used to exclude combinations. More... | |
CFList | factorRecombination (const CanonicalForm &F, const CFList &factors, const CFList &M) |
Naive factor recombination for multivariate factorization. No precomputed is used to exclude combinations. More... | |
int | liftBoundAdaption (const CanonicalForm &F, const CFList &factors, bool &success, const int deg, const CFList &MOD, const int bound) |
Lift bound adaption. Essentially an early factor detection but only the lift bound is adapted. More... | |
int | extLiftBoundAdaption (const CanonicalForm &F, const CFList &factors, bool &success, const ExtensionInfo &info, const CFList &eval, const int deg, const CFList &MOD, const int bound) |
Lift bound adaption over an extension of the initial field. Essentially an early factor detection but only the lift bound is adapted. More... | |
CFList | earlyFactorDetect (CanonicalForm &F, CFList &factors, int &adaptedLiftBound, bool &success, const int deg, const CFList &MOD, const int bound) |
detects factors of F at stage deg of Hensel lifting. No combinations of more than one factor are tested. Lift bound is adapted. More... | |
CFList | extEarlyFactorDetect (CanonicalForm &F, CFList &factors, int &adaptedLiftBound, bool &success, const ExtensionInfo &info, const CFList &eval, const int deg, const CFList &MOD, const int bound) |
detects factors of F at stage deg of Hensel lifting. No combinations of more than one factor are tested. Lift bound is adapted. More... | |
CFList | evalPoints (const CanonicalForm &F, CFList &eval, const Variable &alpha, CFList &list, const bool &GF, bool &fail) |
evaluation point search for multivariate factorization, looks for a (F.level() - 1)-tuple such that the resulting univariate polynomial has main variable Variable (1), is squarefree and its degree coincides with degree(F) and the bivariate one is primitive wrt. Variable(1), and successively evaluated polynomials have the same degree in their main variable as F has, fails if there are no valid evaluation points, eval contains the intermediate evaluated polynomials. More... | |
static int | newMainVariableSearch (CanonicalForm &A, CFList &Aeval, CFList &evaluation, const Variable &alpha, const int lev, CanonicalForm &g) |
CanonicalForm | lcmContent (const CanonicalForm &A, CFList &contentAi) |
compute the LCM of the contents of A wrt to each variable occuring in A. More... | |
CFList | henselLiftAndEarly (CanonicalForm &A, CFList &MOD, int *&liftBounds, bool &earlySuccess, CFList &earlyFactors, const CFList &Aeval, const CFList &biFactors, const CFList &evaluation, const ExtensionInfo &info) |
hensel Lifting and early factor detection More... | |
void | gcdFreeBasis (CFFList &factors1, CFFList &factors2) |
gcd free basis of two lists of factors More... | |
CFList | distributeContent (const CFList &L, const CFList *differentSecondVarFactors, int length) |
distribute content More... | |
int | testFactors (const CanonicalForm &G, const CFList &uniFactors, const Variable &alpha, CanonicalForm &sqrfPartF, CFList &factors, CFFList *&bufSqrfFactors, CFList &evalSqrfPartF, const CFArray &evalPoint) |
CFList | precomputeLeadingCoeff (const CanonicalForm &LCF, const CFList &LCFFactors, const Variable &alpha, const CFList &evaluation, CFList *&differentSecondVarLCs, int lSecondVarLCs, Variable &y) |
computes a list l of length length(LCFFactors)+1 of polynomials such that prod (l)=LCF, note that the first entry of l may be non constant. Intended to be used to precompute coefficients of a polynomial f from its bivariate factorizations. More... | |
void | evaluationWRTDifferentSecondVars (CFList *&Aeval, const CFList &evaluation, const CanonicalForm &A) |
evaluate a poly A with main variable at level 1 at an evaluation point in K^(n-1) wrt different second variables. If this evaluation is valid (see evalPoints) then Aeval contains A successively evaluated at this point, otherwise this entry is empty More... | |
static CanonicalForm | prodEval (const CFList &l, const CanonicalForm &evalPoint, const Variable &v) |
void | checkHelper (const CanonicalForm &f1, CFList &factors1, CFList &factors2, CFList &l1, CFList &l2) |
CFList | checkOneToOne (const CFList &factors1, const CFList &factors2, CFList &factors3, const CanonicalForm &evalPoint, const Variable &x) |
check if univariate factors factors2 of factors3 coincide with univariate factors of factors1 and recombine if necessary. The recombined factors of factors1 are returned and factors3 is recombined accordingly. More... | |
CFList | recombination (const CFList &factors1, const CFList &factors2, int s, int thres, const CanonicalForm &evalPoint, const Variable &x) |
recombination of bivariate factors factors1 s. t. the result evaluated at evalPoint coincides with factors2 More... | |
void | factorizationWRTDifferentSecondVars (const CanonicalForm &A, CFList *&Aeval, const ExtensionInfo &info, int &minFactorsLength, bool &irred) |
CFList | conv (const CFArray &A) |
void | getLeadingCoeffs (const CanonicalForm &A, CFList *&Aeval) |
extract leading coefficients wrt Variable(1) from bivariate factors obtained from factorizations of A wrt different second variables More... | |
void | sortByUniFactors (CFList *&Aeval, int AevalLength, CFList &uniFactors, CFList &biFactors, const CFList &evaluation) |
sort bivariate factors in Aeval such that their corresponding univariate factors coincide with uniFactors, uniFactors and biFactors may get recombined if necessary More... | |
CFList | buildUniFactors (const CFList &biFactors, const CanonicalForm &evalPoint, const Variable &y) |
plug in evalPoint for y in a list of polys More... | |
void | refineBiFactors (const CanonicalForm &A, CFList &biFactors, CFList *const &Aeval, const CFList &evaluation, int minFactorsLength) |
refine a bivariate factorization of A with l factors to one with minFactorsLength if possible More... | |
void | prepareLeadingCoeffs (CFList *&LCs, CanonicalForm &A, CFList &Aeval, int n, const CFList &leadingCoeffs, const CFList &biFactors, const CFList &evaluation) |
normalize precomputed leading coefficients such that leading coefficients evaluated at evaluation in K^(n-2) equal the leading coeffs wrt Variable(1) of bivariate factors and change A and Aeval accordingly More... | |
CFList | extNonMonicFactorRecombination (const CFList &factors, const CanonicalForm &F, const ExtensionInfo &info) |
void | changeSecondVariable (CanonicalForm &A, CFList &biFactors, CFList &evaluation, CFList *&oldAeval, int lengthAeval2, const CFList &uniFactors, const Variable &w) |
changes the second variable to be w and updates all relevant data More... | |
void | distributeLCmultiplier (CanonicalForm &A, CFList &leadingCoeffs, CFList &biFactors, const CFList &evaluation, const CanonicalForm &LCmultipler) |
distributes a divisor LCmultiplier of LC(A,1) on the bivariate factors and the precomputed leading coefficients More... | |
void | LCHeuristic (CanonicalForm &A, const CanonicalForm &LCmultiplier, CFList &biFactors, CFList *&leadingCoeffs, const CFList *oldAeval, int lengthAeval, const CFList &evaluation, const CFList &oldBiFactors) |
heuristic to distribute LCmultiplier onto factors based on the variables that occur in LCmultiplier and in the leading coeffs of bivariate factors More... | |
void | LCHeuristicCheck (const CFList &LCs, const CFList &contents, CanonicalForm &A, const CanonicalForm &oldA, CFList &leadingCoeffs, bool &foundTrueMultiplier) |
checks if prod(LCs)==LC (oldA,1) and if so divides elements of leadingCoeffs by elements in contents, sets A to oldA and sets foundTrueMultiplier to true More... | |
void | LCHeuristic2 (const CanonicalForm &LCmultiplier, const CFList &factors, CFList &leadingCoeffs, CFList &contents, CFList &LCs, bool &foundTrueMultiplier) |
heuristic to distribute LCmultiplier onto factors based on the contents of factors. factors are assumed to come from LucksWangSparseHeuristic. If not successful contents will contain the content of each element of factors and LCs will contain the LC of each element of factors divided by its content More... | |
void | LCHeuristic3 (const CanonicalForm &LCmultiplier, const CFList &factors, const CFList &oldBiFactors, const CFList &contents, const CFList *oldAeval, CanonicalForm &A, CFList *&leadingCoeffs, int lengthAeval, bool &foundMultiplier) |
heuristic to remove LCmultiplier from a factor based on the contents of factors. factors are assumed to come from LucksWangSparseHeuristic. More... | |
void | LCHeuristic4 (const CFList &oldBiFactors, const CFList *oldAeval, const CFList &contents, const CFList &factors, const CanonicalForm &testVars, int lengthAeval, CFList *&leadingCoeffs, CanonicalForm &A, CanonicalForm &LCmultiplier, bool &foundMultiplier) |
heuristic to remove factors of LCmultiplier from factors. More precisely checks if elements of contents divide LCmultiplier. Assumes LCHeuristic3 is run before it and was successful. More... | |
CFList | extFactorize (const CanonicalForm &F, const ExtensionInfo &info) |
multivariate factorization over an extension of the initial field More... | |
CFList | multiFactorize (const CanonicalForm &F, const ExtensionInfo &info) |
This file implements functions for factoring a multivariate polynomial over a finite field.
ABSTRACT: "Efficient Multivariate Factorization over Finite Fields" by L. Bernardin & M. Monagon. Precomputation of leading coefficients is described in "Sparse Hensel lifting" by E. Kaltofen
Definition in file facFqFactorize.cc.
#define CHAR_THRESHOLD 8 |
Definition at line 748 of file facFqFactorize.cc.
CFList buildUniFactors | ( | const CFList & | biFactors, |
const CanonicalForm & | evalPoint, | ||
const Variable & | y | ||
) |
plug in evalPoint for y in a list of polys
[in] | biFactors | a list of polys |
[in] | evalPoint | some evaluation point |
[in] | y | some variable |
Definition at line 2320 of file facFqFactorize.cc.
void changeSecondVariable | ( | CanonicalForm & | A, |
CFList & | biFactors, | ||
CFList & | evaluation, | ||
CFList *& | oldAeval, | ||
int | lengthAeval2, | ||
const CFList & | uniFactors, | ||
const Variable & | w | ||
) |
changes the second variable to be w and updates all relevant data
[in,out] | A | a multivariate poly |
[in,out] | biFactors | bivariate factors |
[in,out] | evaluation | evaluation point |
[in,out] | oldAeval | old bivariate factors wrt. different second vars |
[in] | lengthAeval2 | length of oldAeval |
[in] | uniFactors | univariate factors |
[in] | w | some variable |
Definition at line 2543 of file facFqFactorize.cc.
void checkHelper | ( | const CanonicalForm & | f1, |
CFList & | factors1, | ||
CFList & | factors2, | ||
CFList & | l1, | ||
CFList & | l2 | ||
) |
Definition at line 2021 of file facFqFactorize.cc.
CFList checkOneToOne | ( | const CFList & | factors1, |
const CFList & | factors2, | ||
CFList & | factors3, | ||
const CanonicalForm & | evalPoint, | ||
const Variable & | x | ||
) |
check if univariate factors factors2 of factors3 coincide with univariate factors of factors1 and recombine if necessary. The recombined factors of factors1 are returned and factors3 is recombined accordingly.
Definition at line 2045 of file facFqFactorize.cc.
distribute content
[in] | L | list of polys, first entry the content to be distributed |
[in] | differentSecondVarFactors | factorization wrt different second vars |
[in] | length | length ofdifferentSecondVarFactors |
Definition at line 1294 of file facFqFactorize.cc.
void distributeLCmultiplier | ( | CanonicalForm & | A, |
CFList & | leadingCoeffs, | ||
CFList & | biFactors, | ||
const CFList & | evaluation, | ||
const CanonicalForm & | LCmultipler | ||
) |
distributes a divisor LCmultiplier of LC(A,1) on the bivariate factors and the precomputed leading coefficients
[in,out] | A | some poly |
[in,out] | leadingCoeffs | leading coefficients |
[in,out] | biFactors | bivariate factors |
[in] | evaluation | eval. point |
[in] | LCmultipler | multiplier |
Definition at line 2590 of file facFqFactorize.cc.
CFList earlyFactorDetect | ( | CanonicalForm & | F, |
CFList & | factors, | ||
int & | adaptedLiftBound, | ||
bool & | success, | ||
const int | deg, | ||
const CFList & | MOD, | ||
const int | bound | ||
) |
detects factors of F at stage deg of Hensel lifting. No combinations of more than one factor are tested. Lift bound is adapted.
[in,out] | F | poly to be factored, returns poly divided by detected factors in case of success |
[in,out] | factors | list of factors lifted up to deg, returns a list of factors without detected factors |
[in,out] | adaptedLiftBound | adapted lift bound |
[in,out] | success | indicating success |
[in] | deg | stage of Hensel lifting |
[in] | MOD | a list of powers of Variables |
[in] | bound | initial lift bound |
Definition at line 611 of file facFqFactorize.cc.
CFList evalPoints | ( | const CanonicalForm & | F, |
CFList & | eval, | ||
const Variable & | alpha, | ||
CFList & | list, | ||
const bool & | GF, | ||
bool & | fail | ||
) |
evaluation point search for multivariate factorization, looks for a (F.level() - 1)-tuple such that the resulting univariate polynomial has main variable Variable (1), is squarefree and its degree coincides with degree(F) and the bivariate one is primitive wrt. Variable(1), and successively evaluated polynomials have the same degree in their main variable as F has, fails if there are no valid evaluation points, eval contains the intermediate evaluated polynomials.
[in] | F | a compressed poly |
[in,out] | eval | an empty list, returns F successive evaluated |
[in] | alpha | algebraic variable |
[in,out] | list | a list of points already considered, a point is encoded as a poly of degree F.level()-1 in Variable(1) |
[in] | GF | GF? |
[in,out] | fail | indicates failure |
Definition at line 750 of file facFqFactorize.cc.
void evaluationWRTDifferentSecondVars | ( | CFList *& | Aeval, |
const CFList & | evaluation, | ||
const CanonicalForm & | A | ||
) |
evaluate a poly A with main variable at level 1 at an evaluation point in K^(n-1) wrt different second variables. If this evaluation is valid (see evalPoints) then Aeval contains A successively evaluated at this point, otherwise this entry is empty
[in,out] | Aeval | an array of length n-2 if variable at level i > 2 admits a valid evaluation this entry contains A successively evaluated at this point otherwise an empty list |
[in] | evaluation | a valid evaluation point for main variable at level 1 and second variable at level 2 |
[in] | A | some poly |
Definition at line 1965 of file facFqFactorize.cc.
CFList extEarlyFactorDetect | ( | CanonicalForm & | F, |
CFList & | factors, | ||
int & | adaptedLiftBound, | ||
bool & | success, | ||
const ExtensionInfo & | info, | ||
const CFList & | eval, | ||
const int | deg, | ||
const CFList & | MOD, | ||
const int | bound | ||
) |
detects factors of F at stage deg of Hensel lifting. No combinations of more than one factor are tested. Lift bound is adapted.
[in,out] | F | poly to be factored, returns poly divided by detected factors in case of success |
[in,out] | factors | list of factors lifted up to deg, returns a list of factors without detected factors |
[in,out] | adaptedLiftBound | adapted lift bound |
[in,out] | success | indicating succes |
[in] | info | info about extension |
[in] | eval | evaluation point |
[in] | deg | stage of Hensel lifting |
[in] | MOD | a list of powers of Variables |
[in] | bound | initial lift bound |
Definition at line 664 of file facFqFactorize.cc.
CFList extFactorize | ( | const CanonicalForm & | F, |
const ExtensionInfo & | info | ||
) |
multivariate factorization over an extension of the initial field
Factorization over an extension of initial field.
[in] | F | poly to be factored |
[in] | info | info about extension |
Definition at line 3660 of file facFqFactorize.cc.
CFList extFactorRecombination | ( | const CFList & | factors, |
const CanonicalForm & | F, | ||
const CFList & | M, | ||
const ExtensionInfo & | info, | ||
const CFList & | evaluation | ||
) |
Naive factor recombination for multivariate factorization over an extension of the initial field. No precomputed is used to exclude combinations.
[in] | factors | list of lifted factors that are monic wrt Variable (1) |
[in] | F | poly to be factored |
[in] | M | a list of powers of Variables |
[in] | info | info about extension |
[in] | evaluation | evaluation point |
Definition at line 215 of file facFqFactorize.cc.
int extLiftBoundAdaption | ( | const CanonicalForm & | F, |
const CFList & | factors, | ||
bool & | success, | ||
const ExtensionInfo & | info, | ||
const CFList & | eval, | ||
const int | deg, | ||
const CFList & | MOD, | ||
const int | bound | ||
) |
Lift bound adaption over an extension of the initial field. Essentially an early factor detection but only the lift bound is adapted.
[in] | F | a poly |
[in] | factors | list of list of lifted factors that are monic wrt |
[in,out] | success | indicates that no further lifting is necessary |
[in] | info | info about extension |
[in] | eval | evaluation point |
[in] | deg | stage of Hensel lifting |
[in] | MOD | a list of powers of Variables |
[in] | bound | initial lift bound |
Definition at line 513 of file facFqFactorize.cc.
CFList extNonMonicFactorRecombination | ( | const CFList & | factors, |
const CanonicalForm & | F, | ||
const ExtensionInfo & | info | ||
) |
Definition at line 2420 of file facFqFactorize.cc.
void factorizationWRTDifferentSecondVars | ( | const CanonicalForm & | A, |
CFList *& | Aeval, | ||
const ExtensionInfo & | info, | ||
int & | minFactorsLength, | ||
bool & | irred | ||
) |
Definition at line 2183 of file facFqFactorize.cc.
Naive factor recombination for multivariate factorization. No precomputed is used to exclude combinations.
[in] | F | poly to be factored |
[in] | factors | list of lifted factors that are monic wrt Variable (1) |
[in] | M | a list of powers of Variables |
Definition at line 360 of file facFqFactorize.cc.
gcd free basis of two lists of factors
[in,out] | factors1 | list of factors, returns gcd free factors |
[in,out] | factors2 | list of factors, returns gcd free factors |
Definition at line 1268 of file facFqFactorize.cc.
void getLeadingCoeffs | ( | const CanonicalForm & | A, |
CFList *& | Aeval | ||
) |
extract leading coefficients wrt Variable(1) from bivariate factors obtained from factorizations of A wrt different second variables
[in] | A | some poly |
[in,out] | Aeval | array of bivariate factors, returns the leading coefficients of these factors |
Definition at line 2232 of file facFqFactorize.cc.
CFList henselLiftAndEarly | ( | CanonicalForm & | A, |
CFList & | MOD, | ||
int *& | liftBounds, | ||
bool & | earlySuccess, | ||
CFList & | earlyFactors, | ||
const CFList & | Aeval, | ||
const CFList & | biFactors, | ||
const CFList & | evaluation, | ||
const ExtensionInfo & | info | ||
) |
hensel Lifting and early factor detection
[in,out] | A | poly to be factored, returns poly divided by detected factors, in case of success |
[in,out] | MOD | a list of powers of Variables |
[in,out] | liftBounds | initial lift bounds, returns adapted lift bounds |
[in,out] | earlySuccess | indicating success |
[in,out] | earlyFactors | early factors |
[in] | Aeval | A successively evaluated at elements of evaluation@param biFactors bivariate factors |
[in] | evaluation | evaluation point |
[in] | info | info about extension |
Definition at line 984 of file facFqFactorize.cc.
void LCHeuristic | ( | CanonicalForm & | A, |
const CanonicalForm & | LCmultiplier, | ||
CFList & | biFactors, | ||
CFList *& | leadingCoeffs, | ||
const CFList * | oldAeval, | ||
int | lengthAeval, | ||
const CFList & | evaluation, | ||
const CFList & | oldBiFactors | ||
) |
heuristic to distribute LCmultiplier onto factors based on the variables that occur in LCmultiplier and in the leading coeffs of bivariate factors
[in,out] | A | a poly |
[in,out] | LCmultiplier | divisor of LC (A,1) |
[in,out] | biFactors | bivariate factors |
[in,out] | leadingCoeffs | leading coeffs |
[in] | oldAeval | bivariate factors wrt. different second vars |
[in] | lengthAeval | length of oldAeval |
[in] | evaluation | evaluation point |
[in] | oldBiFactors | bivariate factors without LCmultiplier distributed on them |
Definition at line 2614 of file facFqFactorize.cc.
void LCHeuristic2 | ( | const CanonicalForm & | LCmultiplier, |
const CFList & | factors, | ||
CFList & | leadingCoeffs, | ||
CFList & | contents, | ||
CFList & | LCs, | ||
bool & | foundTrueMultiplier | ||
) |
heuristic to distribute LCmultiplier onto factors based on the contents of factors. factors are assumed to come from LucksWangSparseHeuristic. If not successful contents will contain the content of each element of factors and LCs will contain the LC of each element of factors divided by its content
[in] | LCmultiplier | divisor of LC (A,1) |
[in] | factors | result of LucksWangSparseHeuristic |
[in,out] | leadingCoeffs | leading coeffs |
[in,out] | contents | content of factors |
[in,out] | LCs | LC of factors divided by content of factors |
[in,out] | foundTrueMultiplier | success? |
Definition at line 2778 of file facFqFactorize.cc.
void LCHeuristic3 | ( | const CanonicalForm & | LCmultiplier, |
const CFList & | factors, | ||
const CFList & | oldBiFactors, | ||
const CFList & | contents, | ||
const CFList * | oldAeval, | ||
CanonicalForm & | A, | ||
CFList *& | leadingCoeffs, | ||
int | lengthAeval, | ||
bool & | foundMultiplier | ||
) |
heuristic to remove LCmultiplier from a factor based on the contents of factors. factors are assumed to come from LucksWangSparseHeuristic.
[in] | LCmultiplier | divisor of LC (A,1) |
[in] | factors | result of LucksWangSparseHeuristic |
[in] | oldBiFactors | bivariate factors without LCmultiplier distributed on them |
[in] | contents | content of factors |
[in] | oldAeval | bivariate factors wrt. different second vars |
[in,out] | A | poly |
[in,out] | leadingCoeffs | leading coeffs |
[in] | lengthAeval | length of oldAeval |
[in,out] | foundMultiplier | success? |
Definition at line 2808 of file facFqFactorize.cc.
void LCHeuristic4 | ( | const CFList & | oldBiFactors, |
const CFList * | oldAeval, | ||
const CFList & | contents, | ||
const CFList & | factors, | ||
const CanonicalForm & | testVars, | ||
int | lengthAeval, | ||
CFList *& | leadingCoeffs, | ||
CanonicalForm & | A, | ||
CanonicalForm & | LCmultiplier, | ||
bool & | foundMultiplier | ||
) |
heuristic to remove factors of LCmultiplier from factors. More precisely checks if elements of contents divide LCmultiplier. Assumes LCHeuristic3 is run before it and was successful.
[in] | oldBiFactors | bivariate factors without LCmultiplier distributed on them |
[in] | oldAeval | bivariate factors wrt. different second vars |
[in] | contents | content of factors |
[in] | factors | result of LucksWangSparseHeuristic |
[in] | testVars | product of second vars that occur among oldAeval |
[in] | lengthAeval | length of oldAeval |
[in,out] | leadingCoeffs | leading coeffs |
[in,out] | A | poly |
[in,out] | LCmultiplier | divisor of LC (A,1) |
[in] | foundMultiplier | success? |
Definition at line 2856 of file facFqFactorize.cc.
void LCHeuristicCheck | ( | const CFList & | LCs, |
const CFList & | contents, | ||
CanonicalForm & | A, | ||
const CanonicalForm & | oldA, | ||
CFList & | leadingCoeffs, | ||
bool & | foundTrueMultiplier | ||
) |
checks if prod(LCs)==LC (oldA,1) and if so divides elements of leadingCoeffs by elements in contents, sets A to oldA and sets foundTrueMultiplier to true
[in] | LCs | leading coeffs computed |
[in] | contents | content of factors |
[in,out] | A | oldA*LCmultiplier^m |
[in] | oldA | some poly |
[in,out] | leadingCoeffs | leading coefficients |
[in,out] | foundTrueMultiplier | success? |
Definition at line 2762 of file facFqFactorize.cc.
CanonicalForm lcmContent | ( | const CanonicalForm & | A, |
CFList & | contentAi | ||
) |
compute the LCM of the contents of A wrt to each variable occuring in A.
[in] | A | a compressed multivariate poly |
[in,out] | contentAi | an empty list, returns a list of the contents of A wrt to each variable occuring in A starting from A.mvar(). |
Definition at line 965 of file facFqFactorize.cc.
int liftBoundAdaption | ( | const CanonicalForm & | F, |
const CFList & | factors, | ||
bool & | success, | ||
const int | deg, | ||
const CFList & | MOD, | ||
const int | bound | ||
) |
Lift bound adaption. Essentially an early factor detection but only the lift bound is adapted.
[in] | F | a poly |
[in] | factors | list of list of lifted factors that are monic wrt Variable (1) |
[in,out] | success | indicates that no further lifting is necessary |
[in] | deg | stage of Hensel lifting |
[in] | MOD | a list of powers of Variables |
[in] | bound | initial lift bound |
Definition at line 447 of file facFqFactorize.cc.
|
inlinestatic |
Definition at line 74 of file facFqFactorize.cc.
CFList multiFactorize | ( | const CanonicalForm & | F, |
const ExtensionInfo & | info | ||
) |
Definition at line 2928 of file facFqFactorize.cc.
CanonicalForm myCompress | ( | const CanonicalForm & | F, |
CFMap & | N | ||
) |
compress a polynomial s.t. and no gaps between the variables occur
[in] | F | a poly |
[in,out] | N | a map to decompress |
Definition at line 133 of file facFqFactorize.cc.
|
inlinestatic |
Definition at line 58 of file facFqFactorize.cc.
|
inlinestatic |
Definition at line 101 of file facFqFactorize.cc.
|
inlinestatic |
Definition at line 924 of file facFqFactorize.cc.
CFList precomputeLeadingCoeff | ( | const CanonicalForm & | LCF, |
const CFList & | LCFFactors, | ||
const Variable & | alpha, | ||
const CFList & | evaluation, | ||
CFList *& | differentSecondVarLCs, | ||
int | lSecondVarLCs, | ||
Variable & | y | ||
) |
computes a list l of length length(LCFFactors)+1 of polynomials such that prod (l)=LCF, note that the first entry of l may be non constant. Intended to be used to precompute coefficients of a polynomial f from its bivariate factorizations.
[in] | LCF | a multivariate poly |
[in] | LCFFactors | a list of univariate factors of LCF of level 2 |
[in] | alpha | algebraic var. |
[in] | evaluation | an evaluation point having lSecondVarLCs+1 components |
[in] | differentSecondVarLCs | LCs of factors of f wrt different second variables |
[in] | lSecondVarLCs | length of the above |
[in,out] | y | if y.level() is not 1 on output the second variable has been changed to y |
Definition at line 1478 of file facFqFactorize.cc.
void prepareLeadingCoeffs | ( | CFList *& | LCs, |
CanonicalForm & | A, | ||
CFList & | Aeval, | ||
int | n, | ||
const CFList & | leadingCoeffs, | ||
const CFList & | biFactors, | ||
const CFList & | evaluation | ||
) |
normalize precomputed leading coefficients such that leading coefficients evaluated at evaluation in K^(n-2) equal the leading coeffs wrt Variable(1) of bivariate factors and change A and Aeval accordingly
[in,out] | LCs | |
[in,out] | A | |
[in,out] | Aeval | |
[in] | n | level of poly to be factored |
[in] | leadingCoeffs | precomputed leading coeffs |
[in] | biFactors | bivariate factors |
[in] | evaluation | evaluation point |
Definition at line 2381 of file facFqFactorize.cc.
|
inlinestatic |
Definition at line 2011 of file facFqFactorize.cc.
CFList recombination | ( | const CFList & | factors1, |
const CFList & | factors2, | ||
int | s, | ||
int | thres, | ||
const CanonicalForm & | evalPoint, | ||
const Variable & | x | ||
) |
recombination of bivariate factors factors1 s. t. the result evaluated at evalPoint coincides with factors2
[in] | factors1 | list of bivariate factors |
[in] | factors2 | list univariate factors |
[in] | s | algorithm starts checking subsets of size s |
[in] | thres | threshold for the size of subsets which are checked |
[in] | evalPoint | evaluation point |
[in] | x | second variable of bivariate factors |
Definition at line 2113 of file facFqFactorize.cc.
void refineBiFactors | ( | const CanonicalForm & | A, |
CFList & | biFactors, | ||
CFList *const & | Aeval, | ||
const CFList & | evaluation, | ||
int | minFactorsLength | ||
) |
refine a bivariate factorization of A with l factors to one with minFactorsLength if possible
[in] | A | some poly |
[in,out] | biFactors | list of bivariate to be refined, returns refined factors |
[in] | Aeval | list of bivariate factorizations of A wrt different second variables |
[in] | evaluation | the evaluation point |
[in] | minFactorsLength | the minimal number of factors |
Definition at line 2334 of file facFqFactorize.cc.
void sortByUniFactors | ( | CFList *& | Aeval, |
int | AevalLength, | ||
CFList & | uniFactors, | ||
CFList & | biFactors, | ||
const CFList & | evaluation | ||
) |
sort bivariate factors in Aeval such that their corresponding univariate factors coincide with uniFactors, uniFactors and biFactors may get recombined if necessary
[in,out] | Aeval | array of bivariate factors |
[in] | AevalLength | length of Aeval |
[in,out] | uniFactors | univariate factors |
[in,out] | biFactors | bivariate factors |
[in] | evaluation | evaluation point |
Definition at line 2250 of file facFqFactorize.cc.
int testFactors | ( | const CanonicalForm & | G, |
const CFList & | uniFactors, | ||
const Variable & | alpha, | ||
CanonicalForm & | sqrfPartF, | ||
CFList & | factors, | ||
CFFList *& | bufSqrfFactors, | ||
CFList & | evalSqrfPartF, | ||
const CFArray & | evalPoint | ||
) |
Definition at line 1384 of file facFqFactorize.cc.
TIMING_DEFINE_PRINT | ( | fac_fq_bi_factorizer | ) | const & |