[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:52:53 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit b39974a35e993c82df3b74afc01fb3f2fe8ddd2e
Author: Martin Lee <martinlee84 at web.de>
Date: Mon Jan 9 13:59:20 2012 +0100
chg: added functions to compute better lifting precisions
based on the shape of the Newton polygon
diff --git a/factory/facFqBivar.cc b/factory/facFqBivar.cc
index 47d62c5..5eb5539 100644
--- a/factory/facFqBivar.cc
+++ b/factory/facFqBivar.cc
@@ -777,6 +777,61 @@ extEarlyFactorDetection (CanonicalForm& F, CFList& factors,
return result;
}
+int*
+getCombinations (int * rightSide, int sizeOfRightSide, int& sizeOfOutput,
+ int degreeLC)
+{
+ Variable x= Variable (1);
+ int p= getCharacteristic();
+ int d= getGFDegree();
+ char cGFName= gf_name;
+ setCharacteristic(0);
+ CanonicalForm buf= 1;
+ for (int i= 0; i < sizeOfRightSide; i++)
+ buf *= (power (x, rightSide [i]) + 1);
+
+ int j= 0;
+ for (CFIterator i= buf; i.hasTerms(); i++, j++)
+ {
+ if (i.exp() < degreeLC)
+ {
+ j++;
+ break;
+ }
+ }
+
+ ASSERT ( j > 1, "j > 1 expected" );
+
+ int* result = new int [j - 1];
+ sizeOfOutput= j - 1;
+
+ int i= 0;
+ for (CFIterator m = buf; i < j - 1; i++, m++)
+ result [i]= m.exp();
+
+ if (d > 1)
+ setCharacteristic (p, d, cGFName);
+ else
+ setCharacteristic (p);
+ return result;
+}
+
+int *
+getLiftPrecisions (const CanonicalForm& F, int& sizeOfOutput, int degreeLC)
+{
+ int sizeOfNewtonPoly;
+ int ** newtonPolyg= newtonPolygon (F, sizeOfNewtonPoly);
+ int sizeOfRightSide;
+ int * rightSide= getRightSide(newtonPolyg, sizeOfNewtonPoly, sizeOfRightSide);
+ int * result= getCombinations(rightSide, sizeOfRightSide, sizeOfOutput,
+ degreeLC);
+ delete [] rightSide;
+ for (int i= 0; i < sizeOfNewtonPoly; i++)
+ delete [] newtonPolyg[i];
+ delete [] newtonPolyg;
+ return result;
+}
+
CFList
henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
earlyFactors, DegreePattern& degs, int& liftBound,
diff --git a/factory/facFqBivar.h b/factory/facFqBivar.h
index 7933a6b..4a7f63b 100644
--- a/factory/facFqBivar.h
+++ b/factory/facFqBivar.h
@@ -661,6 +661,18 @@ Variable chooseExtension (
int k ///< [in] some int
);
+/// compute lifting precisions from the shape of the Newton polygon of F
+///
+/// @return @a getLiftPrecisions returns lifting precisions computed from the
+/// shape of the Newton polygon of F
+int *
+getLiftPrecisions (const CanonicalForm& F, ///< [in] a bivariate poly
+ int& sizeOfOutput, ///< [in,out] size of the output
+ int degreeLC ///< [in] degree of the leading coeff
+ ///< [in] of F wrt. Variable (1)
+ );
+
+
/// detects factors of @a F at stage @a deg of Hensel lifting.
/// No combinations of more than one factor are tested. Lift bound and possible
/// degree pattern are updated.
--
an open source computer algebra system
More information about the debian-science-commits
mailing list