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

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


The following commit has been merged in the cleanedupstream branch:
commit a334839b04b1c1bede5902bdb4a8aea001cfd007
Author: Martin Lee <martinlee84 at web.de>
Date:   Tue Mar 20 11:47:05 2012 +0100

    fix: getTerms2 and patch for coeffs

diff --git a/factory/facSparseHensel.h b/factory/facSparseHensel.h
index c890356..1edfc66 100644
--- a/factory/facSparseHensel.h
+++ b/factory/facSparseHensel.h
@@ -411,6 +411,12 @@ isEqual (const CFArray& A, const CFArray& B)
 inline CFArray
 getTerms2 (const CanonicalForm& F)
 {
+  if (F.inCoeffDomain())
+  {
+    CFArray result= CFArray (1);
+    result[0]= F;
+    return result;
+  }
   CFArray result= CFArray (size (F));
   int j= 0;
   Variable x= F.mvar();
@@ -418,8 +424,16 @@ getTerms2 (const CanonicalForm& F)
   CFIterator k;
   for (CFIterator i= F; i.hasTerms(); i++)
   {
-    for (k= i.coeff(); k.hasTerms(); k++, j++)
-      result[j]= k.coeff()*power (x,i.exp())*power (y,k.exp());
+    if (i.coeff().inCoeffDomain())
+    {
+      result[j]= i.coeff()*power (x,i.exp());
+      j++;
+    }
+    else
+    {
+      for (k= i.coeff(); k.hasTerms(); k++, j++)
+        result[j]= k.coeff()*power (x,i.exp())*power (y,k.exp());
+    }
   }
   sort (result);
   return result;
@@ -484,7 +498,7 @@ CanonicalForm patch (const CanonicalForm& F1, const CanonicalForm& F2,
                      const CanonicalForm& eval)
 {
   CanonicalForm result= F1;
-  if (F2.level() != 1)
+  if (F2.level() != 1 && !F2.inCoeffDomain())
   {
     int d= degree (F2);
     result *= power (F2.mvar(), d);

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list