Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Factory changes #122

Merged
merged 2 commits into from

2 participants

@mmklee
Owner

No description provided.

@hannes14 hannes14 merged commit 817489c into from
@broune broune referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
8 factory/facBivar.cc
@@ -24,8 +24,8 @@
#ifdef HAVE_NTL
TIMING_DEFINE_PRINT(fac_uni_factorizer)
-TIMING_DEFINE_PRINT(fac_hensel_lift)
-TIMING_DEFINE_PRINT(fac_factor_recombination)
+TIMING_DEFINE_PRINT(fac_bi_hensel_lift)
+TIMING_DEFINE_PRINT(fac_bi_factor_recombination)
// bound on coeffs of f (cf. Musser: Multivariate Polynomial Factorization,
// Gelfond: Transcendental and Algebraic Numbers)
@@ -702,11 +702,11 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
dummy= ExtensionInfo (v, false);
bool earlySuccess= false;
CFList earlyFactors;
- TIMING_START (fac_hensel_lift);
+ TIMING_START (fac_bi_hensel_lift);
uniFactors= henselLiftAndEarly
(A, earlySuccess, earlyFactors, degs, liftBound,
uniFactors, dummy, evaluation, b);
- TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
+ TIMING_END_AND_PRINT (fac_bi_hensel_lift, "time for hensel lifting: ");
DEBOUTLN (cerr, "lifted factors= " << uniFactors);
CanonicalForm MODl= power (y, liftBound);
View
43 factory/facFactorize.cc
@@ -109,31 +109,44 @@ factorizationWRTDifferentSecondVars (const CanonicalForm& A, CFList*& Aeval,
irred= false;
Variable v;
CFList factors;
- for (int j= 0; j < A.level() - 2; j++)
+ CanonicalForm LCA= LC (A,1);
+ if (!LCA.inCoeffDomain())
{
- if (!Aeval[j].isEmpty())
+ for (int j= 0; j < A.level() - 2; j++)
{
- v= Variable (Aeval[j].getFirst().level());
+ if (!Aeval[j].isEmpty() && (degree (LCA, j+3) > 0))
+ {
+ v= Variable (Aeval[j].getFirst().level());
- factors= ratBiSqrfFactorize (Aeval[j].getFirst(), w);
+ factors= ratBiSqrfFactorize (Aeval[j].getFirst(), w);
- if (factors.getFirst().inCoeffDomain())
- factors.removeFirst();
+ if (factors.getFirst().inCoeffDomain())
+ factors.removeFirst();
- if (minFactorsLength == 0)
- minFactorsLength= factors.length();
- else
- minFactorsLength= tmin (minFactorsLength, factors.length());
+ if (minFactorsLength == 0)
+ minFactorsLength= factors.length();
+ else
+ minFactorsLength= tmin (minFactorsLength, factors.length());
- if (factors.length() == 1)
+ if (factors.length() == 1)
+ {
+ irred= true;
+ return;
+ }
+ sortList (factors, x);
+ Aeval [j]= factors;
+ }
+ else if (!Aeval[j].isEmpty())
{
- irred= true;
- return;
+ Aeval[j]=CFList();
}
- sortList (factors, x);
- Aeval [j]= factors;
}
}
+ else
+ {
+ for (int j= 0; j < A.level() - 2; j++)
+ Aeval[j]= CFList();
+ }
}
int
View
26 factory/facFqBivar.cc
@@ -42,9 +42,9 @@
#include "FLINTconvert.h"
#endif
-TIMING_DEFINE_PRINT(fac_uni_factorizer)
-TIMING_DEFINE_PRINT(fac_hensel_lift)
-TIMING_DEFINE_PRINT(fac_factor_recombination)
+TIMING_DEFINE_PRINT(fac_fq_uni_factorizer)
+TIMING_DEFINE_PRINT(fac_fq_bi_hensel_lift)
+TIMING_DEFINE_PRINT(fac_fq_bi_factor_recombination)
CanonicalForm prodMod0 (const CFList& L, const CanonicalForm& M, const modpk& b)
{
@@ -5974,18 +5974,18 @@ biFactorize (const CanonicalForm& F, const ExtensionInfo& info)
break;
// univariate factorization
- TIMING_START (fac_uni_factorizer);
+ TIMING_START (fac_fq_uni_factorizer);
bufUniFactors= uniFactorizer (bufAeval, alpha, GF);
- TIMING_END_AND_PRINT (fac_uni_factorizer,
+ TIMING_END_AND_PRINT (fac_fq_uni_factorizer,
"time for univariate factorization: ");
DEBOUTLN (cerr, "Lc (bufAeval)*prod (bufUniFactors)== bufAeval " <<
(prod (bufUniFactors)*Lc (bufAeval) == bufAeval));
if (!derivXZero && !fail2)
{
- TIMING_START (fac_uni_factorizer);
+ TIMING_START (fac_fq_uni_factorizer);
bufUniFactors2= uniFactorizer (bufAeval2, alpha, GF);
- TIMING_END_AND_PRINT (fac_uni_factorizer,
+ TIMING_END_AND_PRINT (fac_fq_uni_factorizer,
"time for univariate factorization in y: ");
DEBOUTLN (cerr, "Lc (bufAeval2)*prod (bufUniFactors2)== bufAeval2 " <<
(prod (bufUniFactors2)*Lc (bufAeval2) == bufAeval2));
@@ -6146,11 +6146,11 @@ biFactorize (const CanonicalForm& F, const ExtensionInfo& info)
{
bool earlySuccess= false;
CFList earlyFactors;
- TIMING_START (fac_hensel_lift);
+ TIMING_START (fac_fq_bi_hensel_lift);
uniFactors= henselLiftAndEarly
(A, earlySuccess, earlyFactors, degs, liftBound,
uniFactors, info, evaluation);
- TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
+ TIMING_END_AND_PRINT (fac_fq_bi_hensel_lift, "time for hensel lifting: ");
DEBOUTLN (cerr, "lifted factors= " << uniFactors);
CanonicalForm MODl= power (y, liftBound);
@@ -6169,7 +6169,7 @@ biFactorize (const CanonicalForm& F, const ExtensionInfo& info)
}
else if (degree (A) > 4 && beta.level() == 1 && (2*minBound)/degMipo < 32)
{
- TIMING_START (fac_hensel_lift);
+ TIMING_START (fac_fq_bi_hensel_lift);
if (extension)
{
CFList lll= extHenselLiftAndLatticeRecombi (A, uniFactors, info, degs,
@@ -6187,18 +6187,18 @@ biFactorize (const CanonicalForm& F, const ExtensionInfo& info)
CFList lll= henselLiftAndLatticeRecombi (A, uniFactors, alpha, degs);
factors= Union (lll, factors);
}
- TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
+ TIMING_END_AND_PRINT (fac_fq_bi_hensel_lift, "time for hensel lifting: ");
DEBOUTLN (cerr, "lifted factors= " << uniFactors);
}
else
{
bool earlySuccess= false;
CFList earlyFactors;
- TIMING_START (fac_hensel_lift);
+ TIMING_START (fac_fq_bi_hensel_lift);
uniFactors= henselLiftAndEarly
(A, earlySuccess, earlyFactors, degs, liftBound,
uniFactors, info, evaluation);
- TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
+ TIMING_END_AND_PRINT (fac_fq_bi_hensel_lift, "time for hensel lifting: ");
DEBOUTLN (cerr, "lifted factors= " << uniFactors);
CanonicalForm MODl= power (y, liftBound);
View
22 factory/facFqFactorize.cc
@@ -34,9 +34,9 @@
#ifdef HAVE_NTL
#include "NTLconvert.h"
-TIMING_DEFINE_PRINT(fac_bi_factorizer)
-TIMING_DEFINE_PRINT(fac_hensel_lift)
-TIMING_DEFINE_PRINT(fac_factor_recombination)
+TIMING_DEFINE_PRINT(fac_fq_bi_factorizer)
+TIMING_DEFINE_PRINT(fac_fq_hensel_lift)
+TIMING_DEFINE_PRINT(fac_fq_factor_recombination)
static inline
CanonicalForm
@@ -2406,14 +2406,14 @@ multiFactorize (const CanonicalForm& F, const ExtensionInfo& info)
bufLift= degree (A, y) + 1 + degree (LC(A, x), y);
- TIMING_START (fac_bi_factorizer);
+ TIMING_START (fac_fq_bi_factorizer);
if (!GF && alpha.level() == 1)
bufBiFactors= FpBiSqrfFactorize (bufAeval.getFirst());
else if (GF)
bufBiFactors= GFBiSqrfFactorize (bufAeval.getFirst());
else
bufBiFactors= FqBiSqrfFactorize (bufAeval.getFirst(), alpha);
- TIMING_END_AND_PRINT (fac_bi_factorizer,
+ TIMING_END_AND_PRINT (fac_fq_bi_factorizer,
"time for bivariate factorization: ");
bufBiFactors.removeFirst();
@@ -2710,24 +2710,24 @@ multiFactorize (const CanonicalForm& F, const ExtensionInfo& info)
CFList MOD;
bool earlySuccess;
CFList earlyFactors, liftedFactors;
- TIMING_START (fac_hensel_lift);
+ TIMING_START (fac_fq_hensel_lift);
liftedFactors= henselLiftAndEarly
(A, MOD, liftBounds, earlySuccess, earlyFactors,
Aeval, biFactors, evaluation, info);
- TIMING_END_AND_PRINT (fac_hensel_lift, "time for hensel lifting: ");
+ TIMING_END_AND_PRINT (fac_fq_hensel_lift, "time for hensel lifting: ");
if (!extension)
{
- TIMING_START (fac_factor_recombination);
+ TIMING_START (fac_fq_factor_recombination);
factors= factorRecombination (A, liftedFactors, MOD);
- TIMING_END_AND_PRINT (fac_factor_recombination,
+ TIMING_END_AND_PRINT (fac_fq_factor_recombination,
"time for factor recombination: ");
}
else
{
- TIMING_START (fac_factor_recombination);
+ TIMING_START (fac_fq_factor_recombination);
factors= extFactorRecombination (liftedFactors, A, MOD, info, evaluation);
- TIMING_END_AND_PRINT (fac_factor_recombination,
+ TIMING_END_AND_PRINT (fac_fq_factor_recombination,
"time for factor recombination: ");
}
Something went wrong with that request. Please try again.