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

Bernhard R. Link brlink at debian.org
Tue Apr 24 15:55:30 UTC 2012


The following commit has been merged in the cleanedupstream branch:
commit d9d3321fa471ab022e06be63a135e45090fe4c05
Author: Martin Lee <martinlee84 at web.de>
Date:   Mon Apr 2 16:44:35 2012 +0200

    fix: need SW_RATIONAL to be On for computation of buf0 and buf1

diff --git a/factory/facFqBivar.cc b/factory/facFqBivar.cc
index 2072ca9..a4be0d5 100644
--- a/factory/facFqBivar.cc
+++ b/factory/facFqBivar.cc
@@ -486,8 +486,13 @@ factorRecombination (CFList& factors, CanonicalForm& F,
   TT= copy (factors);
   bool recombination= false;
   CanonicalForm test;
-  CanonicalForm buf0= mulNTL (buf (0, x), LCBuf);
   bool isRat= (isOn (SW_RATIONAL) && getCharacteristic() == 0) || getCharacteristic() > 0;
+  if (!isRat)
+    On (SW_RATIONAL);
+  CanonicalForm buf0= mulNTL (buf (0, x), LCBuf);
+  if (!isRat)
+    Off (SW_RATIONAL);
+  buf0= buf(0,x)*LCBuf;
   while (T.length() >= 2*s && s <= thres)
   {
     while (nosubset == false)
@@ -557,9 +562,9 @@ factorRecombination (CFList& factors, CanonicalForm& F,
             T= Difference (T, S);
             l -= degree (g);
             M= power (y, l);
+            buf0= mulNTL (buf (0, x), LCBuf);
             if (!isRat)
               Off (SW_RATIONAL);
-            buf0= mulNTL (buf (0, x), LCBuf);
             // compute new possible degree pattern
             bufDegs2= DegreePattern (T);
             bufDegs1.intersect (bufDegs2);
@@ -676,10 +681,15 @@ earlyFactorDetection (CFList& reconstructedFactors, CanonicalForm& F, CFList&
   CanonicalForm M= power (F.mvar(), deg);
   adaptedLiftBound= 0;
   int d= degree (F), l= 0;
+  bool isRat= (isOn (SW_RATIONAL) && getCharacteristic() == 0) || getCharacteristic() > 0;
+  if (!isRat)
+    On (SW_RATIONAL);
   CanonicalForm buf0= mulNTL (buf (0,x), LCBuf);
   CanonicalForm buf1= mulNTL (buf (1,x), LCBuf);
+  if (!isRat)
+    Off (SW_RATIONAL);
   CanonicalForm test0, test1;
-  bool isRat= (isOn (SW_RATIONAL) && getCharacteristic() == 0) || getCharacteristic() > 0;
+
   for (CFListIterator i= factors; i.hasItem(); i++, l++)
   {
     if (!bufDegs1.find (degree (i.getItem(), 1)) || factorsFoundIndex[l] == 1)
@@ -712,10 +722,10 @@ earlyFactorDetection (CFList& reconstructedFactors, CanonicalForm& F, CFList&
             buf= quot;
             d -= degree (g);
             LCBuf= LC (buf, x);
-            if (!isRat)
-              Off (SW_RATIONAL);
             buf0= mulNTL (buf (0,x), LCBuf);
             buf1= mulNTL (buf (1,x), LCBuf);
+            if (!isRat)
+              Off (SW_RATIONAL);
             T= Difference (T, CFList (i.getItem()));
             F= buf;
 
diff --git a/factory/facMul.cc b/factory/facMul.cc
index 57fda94..cb8c779 100644
--- a/factory/facMul.cc
+++ b/factory/facMul.cc
@@ -2827,19 +2827,19 @@ uniFdivides (const CanonicalForm& A, const CanonicalForm& B)
   if (CFFactory::gettype() == GaloisFieldDomain)
     return fdivides (A, B);
   int p= getCharacteristic();
+  if (A.inCoeffDomain() || B.inCoeffDomain())
+  {
+    if (A.inCoeffDomain())
+      return true;
+    else
+      return false;
+  }
   if (p > 0)
   {
     zz_p::init (p);
     Variable alpha;
     if (hasFirstAlgVar (A, alpha) || hasFirstAlgVar (B, alpha))
     {
-      if (A.inCoeffDomain() || B.inCoeffDomain())
-      {
-        if (A.inCoeffDomain())
-          return true;
-        else
-          return false;
-      }
       zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo (alpha));
       zz_pE::init (NTLMipo);
       zz_pEX NTLA= convertFacCF2NTLzz_pEX (A, NTLMipo);

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list