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

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


The following commit has been merged in the cleanedupstream branch:
commit 31f731e018905392d868da5cffecf25f51785b25
Author: Martin Lee <martinlee84 at web.de>
Date:   Fri Mar 9 12:47:25 2012 +0100

    chg: coeff bound for factorization over Q(a), now Hensel
         lifting is done over ZZ_p^k[t]/(f) for suitable p and k

diff --git a/factory/facBivar.cc b/factory/facBivar.cc
index ccd9ffb..f54ff29 100644
--- a/factory/facBivar.cc
+++ b/factory/facBivar.cc
@@ -103,7 +103,9 @@ coeffBound ( const CanonicalForm & f, int p, const CanonicalForm& mipo )
     K *= power (CanonicalForm (2), M);
     int N= degree (mipo);
     CanonicalForm b;
-    b= 2*power (maxNorm (f), N)*power (maxNorm (mipo), 4*N)*K*power (CanonicalForm (2), N)*(CanonicalForm (M+1).sqrt()+1)*power (CanonicalForm (N+1).sqrt()+1, 7*N);
+    b= 2*power (maxNorm (f), N)*power (maxNorm (mipo), 4*N)*K*
+       power (CanonicalForm (2), N)*(CanonicalForm (M+1).sqrt()+1)*
+       power (CanonicalForm (N+1).sqrt()+1, 7*N);
     b /= power (abs (lc (mipo)), N);
 
     ZZX NTLmipo= convertFacCF2NTLZZX (mipo);
@@ -355,6 +357,10 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
   else
     A= F;
 
+  CanonicalForm mipo;
+  if (extension)
+    mipo= getMipo (v);
+
   if (A.isUnivariate())
   {
     CFFList buf;
@@ -609,7 +615,6 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
     swap2= true;
   }
 
-
   if (degs.getLength() == 1) // A is irreducible
   {
     factors.append (A);
@@ -642,12 +647,35 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
       bb= coeffBound (F, p);
     if (bb.getk() > b.getk() ) b=bb;
   }
+  else
+  {
+    A /= Lc (Aeval);
+    A *= bCommonDen (A);
+    // make factors elements of Z(a)[x] disable for modularDiophant
+    for (CFListIterator i= uniFactors; i.hasItem(); i++)
+      i.getItem()= i.getItem()*bCommonDen(i.getItem());
+    Off (SW_RATIONAL);
+    int i= 0;
+    ZZX NTLmipo= convertFacCF2NTLZZX (mipo);
+    CanonicalForm discMipo= convertZZ2CF (discriminant (NTLmipo));
+    findGoodPrime (F*discMipo,i);
+    findGoodPrime (Aeval*discMipo,i);
+    findGoodPrime (A*discMipo,i);
+
+    int p=cf_getBigPrime(i);
+    b = coeffBound( A, p, mipo );
+    modpk bb= coeffBound (Aeval, p, mipo);
+    if (bb.getk() > b.getk() ) b=bb;
+      bb= coeffBound (F, p, mipo);
+    if (bb.getk() > b.getk() ) b=bb;
+  }
 
   ExtensionInfo dummy= ExtensionInfo (false);
+  if (extension)
+    dummy= ExtensionInfo (v, false);
   bool earlySuccess= false;
   CFList earlyFactors;
   TIMING_START (fac_hensel_lift);
-  //maybe one should use a multiple of LC (A,1) and try a nonmonic lifting here?
   uniFactors= henselLiftAndEarly
               (A, earlySuccess, earlyFactors, degs, liftBound,
                uniFactors, dummy, evaluation, b);
@@ -659,8 +687,7 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v)
   factors= factorRecombination (uniFactors, A, MODl, degs, 1,
                                 uniFactors.length()/2, b);
 
-  if (!extension)
-    On (SW_RATIONAL);
+  On (SW_RATIONAL);
 
   if (earlySuccess)
     factors= Union (earlyFactors, factors);

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list