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

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


The following commit has been merged in the cleanedupstream branch:
commit 6c03e199f4cb7e422f5f882759e5c41ce8a23fcf
Author: Martin Lee <martinlee84 at web.de>
Date:   Mon Mar 5 22:31:58 2012 +0100

    chg: do not require coeff bound to be const

diff --git a/factory/facFqBivar.cc b/factory/facFqBivar.cc
index 166e2bc..b1631e6 100644
--- a/factory/facFqBivar.cc
+++ b/factory/facFqBivar.cc
@@ -880,7 +880,7 @@ CFList
 henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
                     earlyFactors, DegreePattern& degs, int& liftBound,
                     const CFList& uniFactors, const ExtensionInfo& info,
-                    const CanonicalForm& eval, const modpk& b)
+                    const CanonicalForm& eval, modpk& b)
 {
   Variable alpha= info.getAlpha();
   Variable beta= info.getBeta();
@@ -918,10 +918,10 @@ henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
     factorsFoundIndex [i]= 0;
 
   if (smallFactorDeg >= liftBound || degree (A,y) <= 4)
-    henselLift12 (A, bufUniFactors, liftBound, Pi, diophant, M, true, b);
+    henselLift12 (A, bufUniFactors, liftBound, Pi, diophant, M, b, true);
   else if (sizeOfLiftPre > 1 && sizeOfLiftPre < 30)
   {
-    henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M, true, b);
+    henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M, b, true);
     if (!extension)
       earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
                             factorsFoundIndex, degs, earlySuccess,
@@ -981,7 +981,7 @@ henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
   }
   else
   {
-    henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M, true, b);
+    henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M, b, true);
     if (!extension)
       earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
                             factorsFoundIndex, degs, earlySuccess,
@@ -1048,6 +1048,17 @@ henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
   return bufUniFactors;
 }
 
+CFList
+henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
+                    earlyFactors, DegreePattern& degs, int& liftBound,
+                    const CFList& uniFactors, const ExtensionInfo& info,
+                    const CanonicalForm& eval)
+{
+  modpk dummy= modpk();
+  return henselLiftAndEarly (A, earlySuccess, earlyFactors, degs, liftBound,
+                             uniFactors, info, eval, dummy);
+}
+
 long isReduced (const mat_zz_p& M)
 {
   long i, j, nonZero;
diff --git a/factory/facFqBivar.h b/factory/facFqBivar.h
index 46ec50f..8d6b684 100644
--- a/factory/facFqBivar.h
+++ b/factory/facFqBivar.h
@@ -743,7 +743,29 @@ henselLiftAndEarly (
         const CFList& uniFactors,  ///< [in] univariate factors
         const ExtensionInfo& info, ///< [in] information about extension
         const CanonicalForm& eval, ///< [in] evaluation point
-        const modpk& b= modpk()    ///< [in] coeff bound
+        modpk& b                   ///< [in] coeff bound
+                  );
+
+/// hensel Lifting and early factor detection
+///
+/// @return @a henselLiftAndEarly returns monic (wrt Variable (1)) lifted
+///         factors without factors which have been detected at an early stage
+///         of Hensel lifting
+/// @sa earlyFactorDetection(), extEarlyFactorDetection()
+
+CFList
+henselLiftAndEarly (
+        CanonicalForm& A,          ///< [in,out] poly to be factored,
+                                   ///< returns poly divided by detected factors
+                                   ///< in case of success
+        bool& earlySuccess,        ///< [in,out] indicating success
+        CFList& earlyFactors,      ///< [in,out] list of factors detected
+                                   ///< at early stage of Hensel lifting
+        DegreePattern& degs,       ///< [in,out] degree pattern
+        int& liftBound,            ///< [in,out] (adapted) lift bound
+        const CFList& uniFactors,  ///< [in] univariate factors
+        const ExtensionInfo& info, ///< [in] information about extension
+        const CanonicalForm& eval  ///< [in] evaluation point
                   );
 
 /// Factorization over an extension of initial field
diff --git a/factory/facHensel.cc b/factory/facHensel.cc
index aedbc8b..cbbdb9c 100644
--- a/factory/facHensel.cc
+++ b/factory/facHensel.cc
@@ -444,7 +444,8 @@ diophantineHensel (const CanonicalForm & F, const CFList& factors,
 }
 
 CFList
-diophantine (const CanonicalForm& F, const CFList& factors, const modpk& b)
+diophantine (const CanonicalForm& F, const CanonicalForm& G,
+             const CFList& factors, modpk& b)
 {
   if (getCharacteristic() == 0)
   {
@@ -492,7 +493,7 @@ CFList
 diophantine (const CanonicalForm& F, const CFList& factors)
 {
   modpk b= modpk();
-  return diophantine (F, factors, b);
+  return diophantine (F, 1, factors, b);
 }
 
 void
@@ -719,13 +720,13 @@ henselStep12 (const CanonicalForm& F, const CFList& factors,
 
 void
 henselLift12 (const CanonicalForm& F, CFList& factors, int l, CFArray& Pi,
-              CFList& diophant, CFMatrix& M, bool sort, const modpk& b)
+              CFList& diophant, CFMatrix& M, modpk& b, bool sort)
 {
   if (sort)
     sortList (factors, Variable (1));
   Pi= CFArray (factors.length() - 1);
   CFListIterator j= factors;
-  diophant= diophantine (F[0], factors, b);
+  diophant= diophantine (F[0], F, factors, b);
   DEBOUTLN (cerr, "diophant= " << diophant);
   j++;
   Pi [0]= mulNTL (j.getItem(), mod (factors.getFirst(), F.mvar()), b);
@@ -754,7 +755,14 @@ henselLift12 (const CanonicalForm& F, CFList& factors, int l, CFArray& Pi,
   for (i= 0; i < factors.length (); i++, k++)
     k.getItem()= bufFactors[i];
   factors.removeFirst();
-  return;
+}
+
+void
+henselLift12 (const CanonicalForm& F, CFList& factors, int l, CFArray& Pi,
+              CFList& diophant, CFMatrix& M, bool sort)
+{
+  modpk dummy= modpk();
+  henselLift12 (F, factors, l, Pi, diophant, M, dummy, sort);
 }
 
 void
diff --git a/factory/facHensel.h b/factory/facHensel.h
index 0095649..b8a8460 100644
--- a/factory/facHensel.h
+++ b/factory/facHensel.h
@@ -44,9 +44,27 @@ henselLift12 (const CanonicalForm& F, ///< [in] compressed, bivariate poly
               CFArray& Pi,            ///< [in,out] stores intermediate results
               CFList& diophant,       ///< [in,out] result of diophantine()
               CFMatrix& M,            ///< [in,out] stores intermediate results
-              bool sort= true,        ///< [in] sort factors by degree in
+              modpk& b,               ///< [in] coeff bound
+              bool sort= true         ///< [in] sort factors by degree in
+                                      ///< Variable(1)
+             );
+
+/// Hensel lift from univariate to bivariate.
+///
+/// @sa henselLiftResume12(), henselLift23(), henselLiftResume(), henselLift()
+void
+henselLift12 (const CanonicalForm& F, ///< [in] compressed, bivariate poly
+              CFList& factors,        ///< [in, out] monic univariate factors of
+                                      ///< F, including leading coefficient as
+                                      ///< first element. Returns monic lifted
+                                      ///< factors without the leading
+                                      ///< coefficient
+              int l,                  ///< [in] lifting precision
+              CFArray& Pi,            ///< [in,out] stores intermediate results
+              CFList& diophant,       ///< [in,out] result of diophantine()
+              CFMatrix& M,            ///< [in,out] stores intermediate results
+              bool sort= true        ///< [in] sort factors by degree in
                                       ///< Variable(1)
-              const modpk& b= modpk ()///< [in] coeff bound
              );
 
 /// resume Hensel lift from univariate to bivariate. Assumes factors are lifted

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list