[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323

Bernhard R. Link brlink at debian.org
Tue Apr 24 15:54:50 UTC 2012


The following commit has been merged in the cleanedupstream branch:
commit 63f505dcb458fba9b84322bd036c46b952a20cda
Author: Martin Lee <martinlee84 at web.de>
Date:   Fri Feb 10 12:10:28 2012 +0100

    chg: threshold for use of LucksWangHeuristic

diff --git a/factory/facFactorize.cc b/factory/facFactorize.cc
index a7b94c0..a5cf33f 100644
--- a/factory/facFactorize.cc
+++ b/factory/facFactorize.cc
@@ -447,7 +447,9 @@ precomputeLeadingCoeff (const CanonicalForm& LCF, const CFList& LCFFactors,
       i.getItem() *= LC1eval.getFirst()/Lc (i.getItem());
 
     bool success= false;
-    if (LucksWangSparseHeuristic (oldSqrfPartF*power (LC1, factors.length()-1),
+    CanonicalForm oldSqrfPartFPowLC= oldSqrfPartF*power(LC1,factors.length()-1);
+    if (size (oldSqrfPartFPowLC)/getNumVars (oldSqrfPartFPowLC) < 500 &&
+        LucksWangSparseHeuristic (oldSqrfPartFPowLC,
                                   oldFactors, 1, leadingCoeffs, factors))
     {
       interMedResult= recoverFactors (oldSqrfPartF, factors);
@@ -880,8 +882,9 @@ multiFactorize (const CanonicalForm& F, const Variable& v)
 
   A /= hh;
 
-  /*if (LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
-      factors))
+  if (size (A)/getNumVars (A) < 500 &&
+      LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
+                                factors))
   {
     int check= factors.length();
     factors= recoverFactors (A, factors);
@@ -895,7 +898,7 @@ multiFactorize (const CanonicalForm& F, const Variable& v)
     }
     else
       factors= CFList();
-  }*/
+  }
 
 
   //shifting to zero
diff --git a/factory/facFqFactorize.cc b/factory/facFqFactorize.cc
index dacc4c9..d84c43f 100644
--- a/factory/facFqFactorize.cc
+++ b/factory/facFqFactorize.cc
@@ -1625,7 +1625,9 @@ precomputeLeadingCoeff (const CanonicalForm& LCF, const CFList& LCFFactors,
       i.getItem() *= LC1eval.getFirst()/Lc (i.getItem());
 
     bool success= false;
-    if (LucksWangSparseHeuristic (oldSqrfPartF*power (LC1, factors.length()-1),
+    CanonicalForm oldSqrfPartFPowLC= oldSqrfPartF*power(LC1,factors.length()-1);
+    if (size (oldSqrfPartFPowLC)/getNumVars (oldSqrfPartFPowLC) < 500 &&
+        LucksWangSparseHeuristic (oldSqrfPartFPowLC,
                                   oldFactors, 1, leadingCoeffs, factors))
     {
       interMedResult= recoverFactors (oldSqrfPartF, factors);
@@ -2601,8 +2603,9 @@ multiFactorize (const CanonicalForm& F, const ExtensionInfo& info)
 
   A /= hh;
 
-  if (LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
-      factors))
+  if (size (A)/getNumVars (A) < 500 && 
+      LucksWangSparseHeuristic (A, biFactors, 2, leadingCoeffs2 [A.level() - 3],
+                                factors))
   {
     int check= factors.length();
     factors= recoverFactors (A, factors);

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list