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

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


The following commit has been merged in the cleanedupstream branch:
commit 1dfcb707d1fac7425ae3a1f19fd9800bbc8e4f86
Author: Martin Lee <martinlee84 at web.de>
Date:   Tue Mar 20 18:42:42 2012 +0100

    fix: bug in evaluation point search

diff --git a/factory/facBivar.cc b/factory/facBivar.cc
index dc8a972..933cb7a 100644
--- a/factory/facBivar.cc
+++ b/factory/facBivar.cc
@@ -171,7 +171,12 @@ CanonicalForm evalPoint (const CanonicalForm& F, int& i)
       else
       {
         if (testPoint (F, result, -i))
+        {
+          i= -i;
           return result;
+        }
+        else if (i < 0)
+          i= -i;
       }
       k++;
     }
@@ -486,7 +491,6 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
     bufAeval2= buf;
     bufAeval2= evalPoint (buf, bufEvaluation2);
 
-
     // univariate factorization
     TIMING_START (fac_uni_factorizer);
 
@@ -591,21 +595,24 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
       }
       if (bufUniFactors.length() < uniFactors.length())
       {
-        if (evaluation != 0)
-        {
-          uniFactors= bufUniFactors;
-          Aeval= bufAeval;
-          evaluation= bufEvaluation;
-        }
+        uniFactors= bufUniFactors;
+        Aeval= bufAeval;
+        evaluation= bufEvaluation;
       }
     }
-    bufEvaluation++;
-    bufEvaluation2++;
+    if (bufEvaluation > 0)
+      bufEvaluation++;
+    else
+      bufEvaluation= -bufEvaluation + 1;
+    if (bufEvaluation > 0)
+      bufEvaluation2++;
+    else
+      bufEvaluation2= -bufEvaluation2 + 1;
   }
 
-  if (evaluation != 0 && (uniFactors.length() > uniFactors2.length() ||
+  if (uniFactors.length() > uniFactors2.length() ||
       (uniFactors.length() == uniFactors2.length()
-       && degs.getLength() > degs2.getLength())))
+       && degs.getLength() > degs2.getLength()))
   {
     degs= degs2;
     uniFactors= uniFactors2;

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list