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

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


The following commit has been merged in the cleanedupstream branch:
commit 355437feb995d2a3089b1385f5225b1b5d7c7864
Author: Martin Lee <martinlee84 at web.de>
Date:   Tue Mar 6 11:37:13 2012 +0100

    chg: use a big prime instead of a small prime in coeff bound
    fix: map recResult in Z/p in diophantineHensel

diff --git a/factory/facBivar.cc b/factory/facBivar.cc
index 8cc08c0..e5e4f60 100644
--- a/factory/facBivar.cc
+++ b/factory/facBivar.cc
@@ -55,8 +55,8 @@ void find_good_prime(const CanonicalForm &f, int &start)
       if  ( i.hasTerms() )
       {
         find_good_prime(i.coeff(),start);
-        if (0==cf_getSmallPrime(start)) return;
-        if((i.exp()!=0) && ((i.exp() % cf_getSmallPrime(start))==0))
+        if (0==cf_getBigPrime(start)) return;
+        if((i.exp()!=0) && ((i.exp() % cf_getBigPrime(start))==0))
         {
           start++;
           i=f;
@@ -70,11 +70,11 @@ void find_good_prime(const CanonicalForm &f, int &start)
   {
     if (f.inZ())
     {
-      if (0==cf_getSmallPrime(start)) return;
-      while((!f.isZero()) && (mod(f,cf_getSmallPrime(start))==0))
+      if (0==cf_getBigPrime(start)) return;
+      while((!f.isZero()) && (mod(f,cf_getBigPrime(start))==0))
       {
         start++;
-        if (0==cf_getSmallPrime(start)) return;
+        if (0==cf_getBigPrime(start)) return;
       }
     }
   }
@@ -591,10 +591,10 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
     find_good_prime(F,i);
     find_good_prime(Aeval,i);
     find_good_prime(A,i);
-    if (i >= cf_getNumSmallPrimes())
+    if (i >= cf_getNumBigPrimes())
       printf ("out of primes\n"); //TODO exit
 
-    int p=cf_getSmallPrime(i);
+    int p=cf_getBigPrime(i);
     b = coeffBound( A, p );
     modpk bb= coeffBound (Aeval, p);
     if (bb.getk() > b.getk() ) b=bb;
diff --git a/factory/facHensel.cc b/factory/facHensel.cc
index cbbdb9c..03e397f 100644
--- a/factory/facHensel.cc
+++ b/factory/facHensel.cc
@@ -407,6 +407,9 @@ diophantineHensel (const CanonicalForm & F, const CFList& factors,
   CanonicalForm coeffE;
   CFList s;
   CFList result= recResult;
+  setCharacteristic (p);
+  recResult= mapinto (recResult);
+  setCharacteristic (0);
   CanonicalForm g;
   CanonicalForm modulus= p;
   int d= b.getk();
@@ -425,7 +428,7 @@ diophantineHensel (const CanonicalForm & F, const CFList& factors,
       for (; j.hasItem(); j++, k++, l++, ii++)
       {
         setCharacteristic (p);
-        g= coeffE*j.getItem();
+        g= mulNTL (coeffE, j.getItem());
         g= modNTL (g, bufFactors[ii]);
         setCharacteristic (0);
         k.getItem() += g.mapinto()*modulus;

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list